Open jonananas opened 2 months ago
Hi @jonananas - thanks for reporting this.
I have had a look at the recipe and it is confusing -
this line replace_in_file(self, os.path.join(self.source_folder, "configure.ac")
disables looking for pcre2 with pkg-config, but relies on Conan still propagating the flags.
So the build system is recording that it was built "without" pcre, but it may actually be build with it - however, it's unclear to me.
Have you encountered a situation where pcre2 support actually does not work and results in an error? It will be easier to troubleshoot from there.
Hi @jonananas - thanks for reporting this.
I have had a look at the recipe and it is confusing - this line
replace_in_file(self, os.path.join(self.source_folder, "configure.ac")
disables looking for pcre2 with pkg-config, but relies on Conan still propagating the flags. So the build system is recording that it was built "without" pcre, but it may actually be build with it - however, it's unclear to me.Have you encountered a situation where pcre2 support actually does not work and results in an error? It will be easier to troubleshoot from there.
Not pkg-config. It was using a custom pcre2-config
executable provided by pcre2
for the package info and build flags. I had to swap it out at the time because it was reporting incorrect library names for static libs. This has been fixed since then (#20586) and the workaround in swig
can probably be reverted.
Hi @jonananas - thanks for reporting this.
I have had a look at the recipe and it is confusing - this line
replace_in_file(self, os.path.join(self.source_folder, "configure.ac")
disables looking for pcre2 with pkg-config, but relies on Conan still propagating the flags. So the build system is recording that it was built "without" pcre, but it may actually be build with it - however, it's unclear to me.Have you encountered a situation where pcre2 support actually does not work and results in an error? It will be easier to troubleshoot from there.
Yes, we got failing builds after clearing our conan cache with the errors:
SWIG(999999): error : PCRE regex matching is not available in this SWIG build. SWIG(33): error : PCRE regex matching is not available in this SWIG build.
Indicating that SWIG / !HAVE_PCRE /, from SWIG source:
https://github.com/swig/swig/blob/master/Source/Swig/naming.c#L1283-L1289
I can also add that we have temporarily fixed this by removing lines 144-145 in conanfile.py and uploading the modified swig to an internal conan repo.
Not pkg-config. It was using a custom
pcre2-config
executable provided bypcre2
for the package info and build flags. I had to swap it out at the time because it was reporting incorrect library names for static libs. This has been fixed since then (#20586) and the workaround inswig
can probably be reverted.
Are there any plans for fixing this? I'll be happy to push a PR for dropping the workaround, but while it solves our problem, I'm not certain it doesn't have any other unwanted impacts?
Description
As of the latest push to conancenter 2024-07-01 pcre is disabled for all versions. This was not the case with the previous recipe, and I believe pcre should be enabled since it is listed as a requirement.
This affects all platforms, the effect can be seen clearly by doing
swig -version
, -pcre should be +pcre:Note: We are still on conan 1, but the steps are reproducable using conan 2.
Package and Environment Details
Conan profile
Steps to reproduce
(Alternatively install swig from conan and run
swig -version
)Logs
Click to expand log
``` root@8744ed43f0c9:/swig# conan create . --version 4.0.2 ======== Exporting recipe to the cache ======== swig/4.0.2: Exporting package recipe: /swig/conanfile.py swig/4.0.2: exports: File 'conandata.yml' found. Exporting it... swig/4.0.2: Calling export_sources() swig/4.0.2: Copied 1 '.yml' file: conandata.yml swig/4.0.2: Copied 1 '.py' file: conanfile.py swig/4.0.2: Copied 2 '.patch' files: 0002-4.0.2-do-not-define-SWIG_LIB_WIN_UNIX.patch, 0001-swig-linux-library-path.patch swig/4.0.2: Copied 1 '.cmake' file: conan-swig-variables.cmake swig/4.0.2: Exported to cache folder: /root/.conan2/p/swigc0b05bc86069a/e swig/4.0.2: Exported: swig/4.0.2#23899eee472a609cf28ffeb56f4986b0 (2024-09-02 13:05:08 UTC) ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu17 compiler.libcxx=libstdc++11 compiler.version=11 os=Linux Profile build: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu17 compiler.libcxx=libstdc++11 compiler.version=11 os=Linux ======== Computing dependency graph ======== pcre/8.45: Not found in local cache, looking in remotes... pcre/8.45: Checking remote: conancenter pcre/8.45: Downloaded recipe revision 64cdfd792761c32817cd31d7967c3709 bzip2/1.0.8: Not found in local cache, looking in remotes... bzip2/1.0.8: Checking remote: conancenter bzip2/1.0.8: Downloaded recipe revision d00dac990f08d991998d624be81a9526 zlib/1.3.1: Not found in local cache, looking in remotes... zlib/1.3.1: Checking remote: conancenter zlib/1.3.1: Downloaded recipe revision f52e03ae3d251dec704634230cd806a2 bison/3.8.2: Not found in local cache, looking in remotes... bison/3.8.2: Checking remote: conancenter bison/3.8.2: Downloaded recipe revision ed1ba0c42d2ab7ab64fc3a62e9ecc673 m4/1.4.19: Not found in local cache, looking in remotes... m4/1.4.19: Checking remote: conancenter m4/1.4.19: Downloaded recipe revision b38ced39a01e31fef5435bc634461fd2 flex/2.6.4: Not found in local cache, looking in remotes... flex/2.6.4: Checking remote: conancenter flex/2.6.4: Downloaded recipe revision e35bc44b3fcbcd661e0af0dc5b5b1ad4 automake/1.16.5: Not found in local cache, looking in remotes... automake/1.16.5: Checking remote: conancenter automake/1.16.5: Downloaded recipe revision 058bda3e21c36c9aa8425daf3c1faf50 autoconf/2.71: Not found in local cache, looking in remotes... autoconf/2.71: Checking remote: conancenter autoconf/2.71: Downloaded recipe revision f9307992909d7fb3df459340f1932809 Graph root cli Requirements bzip2/1.0.8#d00dac990f08d991998d624be81a9526 - Downloaded (conancenter) pcre/8.45#64cdfd792761c32817cd31d7967c3709 - Downloaded (conancenter) swig/4.0.2#23899eee472a609cf28ffeb56f4986b0 - Cache zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Downloaded (conancenter) Build requirements autoconf/2.71#f9307992909d7fb3df459340f1932809 - Downloaded (conancenter) automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50 - Downloaded (conancenter) bison/3.8.2#ed1ba0c42d2ab7ab64fc3a62e9ecc673 - Downloaded (conancenter) flex/2.6.4#e35bc44b3fcbcd661e0af0dc5b5b1ad4 - Downloaded (conancenter) m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Downloaded (conancenter) Resolved version ranges zlib/[>=1.2.11 <2]: zlib/1.3.1 ======== Computing necessary packages ======== swig/4.0.2: Forced build from source Requirements bzip2/1.0.8#d00dac990f08d991998d624be81a9526:763ddd53d7a4775fe84a285f56005a096d9786fd#95b3785cd0f27ffb3d7da411e4890fbc - Download (conancenter) pcre/8.45#64cdfd792761c32817cd31d7967c3709:24fae8e8d99a46c440fa29021b0374b12596cb61#255b006564e5011913a6cc2b806a0216 - Download (conancenter) swig/4.0.2#23899eee472a609cf28ffeb56f4986b0:970ab23d84b6df59e8f16e585ba9332aa2e446ca - Build zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:b647c43bfefae3f830561ca202b6cfd935b56205#6b307bbcbae23635c4006543ffdbf3ef - Download (conancenter) Build requirements autoconf/2.71#f9307992909d7fb3df459340f1932809:da39a3ee5e6b4b0d3255bfef95601890afd80709#5b77f70c17ad1741f5845d4e468a347e - Download (conancenter) automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50:9a4eb3c8701508aa9458b1a73d0633783ecc2270#9719e51a6a62041af6a63e00eef35434 - Download (conancenter) bison/3.8.2#ed1ba0c42d2ab7ab64fc3a62e9ecc673:500c2a3f502e0ca7d4a4c65cb2a4a0b0a24994f5#5cb896361e56e9799eac5902503e1efc - Download (conancenter) m4/1.4.19#b38ced39a01e31fef5435bc634461fd2:3593751651824fb813502c69c971267624ced41a#cd8019a4f9b70880d548f7cc26569604 - Download (conancenter) Skipped binaries flex/2.6.4 ======== Installing packages ======== -------- Downloading 7 packages -------- bzip2/1.0.8: Retrieving package 763ddd53d7a4775fe84a285f56005a096d9786fd from remote 'conancenter' bzip2/1.0.8: Package installed 763ddd53d7a4775fe84a285f56005a096d9786fd bzip2/1.0.8: Downloaded package revision 95b3785cd0f27ffb3d7da411e4890fbc m4/1.4.19: Retrieving package 3593751651824fb813502c69c971267624ced41a from remote 'conancenter' m4/1.4.19: Package installed 3593751651824fb813502c69c971267624ced41a m4/1.4.19: Downloaded package revision cd8019a4f9b70880d548f7cc26569604 zlib/1.3.1: Retrieving package b647c43bfefae3f830561ca202b6cfd935b56205 from remote 'conancenter' zlib/1.3.1: Package installed b647c43bfefae3f830561ca202b6cfd935b56205 zlib/1.3.1: Downloaded package revision 6b307bbcbae23635c4006543ffdbf3ef bison/3.8.2: Retrieving package 500c2a3f502e0ca7d4a4c65cb2a4a0b0a24994f5 from remote 'conancenter' bison/3.8.2: Package installed 500c2a3f502e0ca7d4a4c65cb2a4a0b0a24994f5 bison/3.8.2: Downloaded package revision 5cb896361e56e9799eac5902503e1efc autoconf/2.71: Retrieving package da39a3ee5e6b4b0d3255bfef95601890afd80709 from remote 'conancenter' autoconf/2.71: Package installed da39a3ee5e6b4b0d3255bfef95601890afd80709 autoconf/2.71: Downloaded package revision 5b77f70c17ad1741f5845d4e468a347e pcre/8.45: Retrieving package 24fae8e8d99a46c440fa29021b0374b12596cb61 from remote 'conancenter' pcre/8.45: Package installed 24fae8e8d99a46c440fa29021b0374b12596cb61 pcre/8.45: Downloaded package revision 255b006564e5011913a6cc2b806a0216 automake/1.16.5: Retrieving package 9a4eb3c8701508aa9458b1a73d0633783ecc2270 from remote 'conancenter' automake/1.16.5: Package installed 9a4eb3c8701508aa9458b1a73d0633783ecc2270 automake/1.16.5: Downloaded package revision 9719e51a6a62041af6a63e00eef35434 swig/4.0.2: Calling source() in /root/.conan2/p/swigc0b05bc86069a/s/src swig/4.0.2: Unzipping rel-4.0.2.tar.gz to . -------- Installing package swig/4.0.2 (8 of 8) -------- swig/4.0.2: Building from source swig/4.0.2: Package swig/4.0.2:970ab23d84b6df59e8f16e585ba9332aa2e446ca swig/4.0.2: Copying sources to build folder swig/4.0.2: Building your package in /root/.conan2/p/b/swig0d20c6a323402/b swig/4.0.2: Calling generate() swig/4.0.2: Generators folder: /root/.conan2/p/b/swig0d20c6a323402/b/build-release/conan swig/4.0.2: Generating aggregated env files swig/4.0.2: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh'] swig/4.0.2: Calling build() swig/4.0.2: Apply patch (portability): swig -swiglib should return the correct path next to the binary even when relocated swig/4.0.2: Apply patch (portability): swig -swiglib should return the correct path next to the binary even when relocated swig/4.0.2: RUN: ./autogen.sh + test -d Tools/config + aclocal -I Tools/config + autoheader + automake --add-missing --copy --force-missing configure.ac:23: installing 'Tools/config/compile' configure.ac:11: installing 'Tools/config/config.guess' configure.ac:11: installing 'Tools/config/config.sub' configure.ac:12: installing 'Tools/config/install-sh' configure.ac:12: installing 'Tools/config/missing' Source/Makefile.am: installing 'Tools/config/depcomp' configure.ac: installing 'Tools/config/ylwrap' + autoconf configure.ac:33: warning: The macro `AC_HEADER_STDC' is obsolete. configure.ac:33: You should run autoupdate. /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from... configure.ac:33: the top level configure.ac:541: warning: The macro `AC_TRY_CPP' is obsolete. configure.ac:541: You should run autoupdate. /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/general.m4:2762: AC_TRY_CPP is expanded from... configure.ac:541: the top level + cd CCache + autoreconf configure.ac:9: warning: The macro `AC_CONFIG_HEADER' is obsolete. configure.ac:9: You should run autoupdate. /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from... configure.ac:9: the top level configure.ac:44: warning: The macro `AC_HEADER_TIME' is obsolete. configure.ac:44: You should run autoupdate. /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/headers.m4:743: AC_HEADER_TIME is expanded from... configure.ac:44: the top level configure.ac:53: warning: The macro `AC_TRY_COMPILE' is obsolete. configure.ac:53: You should run autoupdate. /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... configure.ac:53: the top level configure.ac:65: warning: The macro `AC_TRY_RUN' is obsolete. configure.ac:65: You should run autoupdate. /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/general.m4:2997: AC_TRY_RUN is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... /home/conan/workspace/prod-v2/bsr/11331/fcdae/p/b/autoc5661555550ad3/b/src/lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... configure.ac:65: the top level swig/4.0.2: RUN: "/root/.conan2/p/b/swig0d20c6a323402/b/src/configure" --disable-shared --enable-static --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --host=x86_64 '--with-swiglibdir=${prefix}/bin/swiglib' --with-pcre-prefix=/root/.conan2/p/pcre474b464f09b74/p LIBS=-ldl checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-none checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for x86_64-strip... no checking for strip... strip checking for a race-free mkdir -p... /usr/bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for x86_64-gcc... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... none needed checking whether gcc understands -c and -o together... yes checking whether make supports the include directive... yes (GNU style) checking dependency style of gcc... gcc3 checking for x86_64-g++... no checking for x86_64-c++... no checking for x86_64-gpp... no checking for x86_64-aCC... no checking for x86_64-CC... no checking for x86_64-cxx... no checking for x86_64-cc++... no checking for x86_64-cl.exe... no checking for x86_64-FCC... no checking for x86_64-KCC... no checking for x86_64-RCC... no checking for x86_64-xlC_r... no checking for x86_64-xlC... no checking for x86_64-clang++... no checking for g++... g++ checking whether the compiler supports GNU C++... yes checking whether g++ accepts -g... yes checking for g++ option to enable C++11 features... none needed checking dependency style of g++... gcc3 checking maximum warning verbosity option... -Wall -W -ansi -pedantic for C++ -Wall -W -ansi -pedantic for C checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for popen... yes checking whether to enable PCRE support... yes checking whether to use local PCRE... no checking for a sed that does not truncate output... /usr/bin/sed checking whether to enable ccache-swig... yes Checking packages required for SWIG developers. Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball checking for bison... bison -y Checking for installed target languages and other information in order to compile and run the examples and test-suite invoked by 'make check'. Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball checking for boostlib >= (102000)... configure: We could not detect the boost libraries (version or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in