Mingw task for Cirrus CI - Mailing list pgsql-hackers
From | Melih Mutlu |
---|---|
Subject | Mingw task for Cirrus CI |
Date | |
Msg-id | CAGPVpCSKS9E0An4=e7ZDnme+y=WOcQFJYJegKO8kE9=gh8NJKQ@mail.gmail.com Whole thread Raw |
Responses |
Re: Mingw task for Cirrus CI
Re: Mingw task for Cirrus CI |
List | pgsql-hackers |
Hi All,
I've been working on adding Windows+MinGW environment into cirrus-ci tasks (discussion about ci is here [1]).
It uses MSYS2 to set the environment. UCRT is chosen as C standard library, instead of MSVCRT.
The task configures postgres with features that are available in MSYS2 (see available packages [2]) and tap tests are enabled.
I already added the necessary docker image, you can find the related PR at [3] and a successful cirruc-ci run with these changes at [4].
Attached patch adds a task runs on Windows with MinGW for cirrus-ci
However, I cannot run configure with --with-python, --with-perl or --with-tcl.
There are two issues I encountered while trying to enable. e.g. for --with-python
1- python_ldlibrary is set to "libpython3.9.dll.a". So the related line in configure cannot retrieve "ldlibrary"
2- src/pl/plpython/Makefile looks under "C:/Windows/system32/" for PYTHONDLL. gendef cannot open that file, give an error like " failed to open()" when creating a .def file.
To overcome those, I added the correct pattern to extract ldlibrary by appending "-e 's/\.dll.a$//'" at the end of the related line.
Then, I tried to use python dll from MSYS instead of windows/system32 by changing PYTHONDLL path to "/ucrt64/bin/libpython3.9.dll". I'm not sure if this is the correct dll.
Here is the diff of these two changes:
diff --git a/configure b/configureindex f3cb5c2b51..42ea580442 100755--- a/configure+++ b/configure@@ -10536,7 +10536,7 @@ python_libdir=`${PYTHON} -c "import sysconfig; print(' '.join(filter(None,sysconpython_ldlibrary=`${PYTHON} -c "import sysconfig; print(' '.join(filter(None,sysconfig.get_config_vars('LDLIBRARY'))))"`# If LDLIBRARY exists and has a shlib extension, use it verbatim.-ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//'`+ldlibrary=`echo "${python_ldlibrary}" | sed -e 's/\.so$//' -e 's/\.dll$//' -e 's/\.dylib$//' -e 's/\.sl$//' -e 's/\.dll.a$//'`if test -e "${python_libdir}/${python_ldlibrary}" -a x"${python_ldlibrary}" != x"${ldlibrary}"thenldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`diff --git a/src/pl/plpython/Makefile b/src/pl/plpython/Makefileindex a83ae8865c..4254ef94d7 100644--- a/src/pl/plpython/Makefile+++ b/src/pl/plpython/Makefile@@ -61,7 +61,8 @@ INCS = plpython.h \ifeq ($(PORTNAME), win32)pytverstr=$(subst .,,${python_version})-PYTHONDLL=$(subst \,/,$(WINDIR))/system32/python${pytverstr}.dll+#PYTHONDLL=$(subst \,/,$(WINDIR))/system32/python${pytverstr}.dll+PYTHONDLL=/ucrt64/bin/libpython3.9.dllOBJS += libpython${pytverstr}.a
In the end, make check-world still fails, even though I was able to run configure and make without any obvious error.
I see bunch of errors in tests like:
+ERROR: language "plpython3u" does not exist
+HINT: Use CREATE EXTENSION to load the language into the database.
+HINT: Use CREATE EXTENSION to load the language into the database.
Here is the logs from failed ci run: https://api.cirrus-ci.com/v1/artifact/task/4645682031099904/log/build/src/pl/plpython/regression.diffs
Any thoughts on how postgres can be built with --with-python etc. on mingw?
Best,
Melih
Attachment
pgsql-hackers by date: