Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] libcurl/8.4.0: build fails - can't run m4 on msys2 gcc #26405

Open
RudolfRendier opened this issue Jan 17, 2025 · 2 comments
Open
Labels
question Further information is requested

Comments

@RudolfRendier
Copy link

What is your question?

Hi! I have a problem with libcurl when trying to build it with conan 2.11. It worked before on conan 1.x
I have a CI-agent that has msys2 pre-installed with the compiler to run our builds.

-------- Installing package libcurl/8.11.1 (15 of 16) --------
libcurl/8.11.1: Building from source
libcurl/8.11.1: Package libcurl/8.11.1:f4dce8faf67fa2457b5dd4080902e114dab98fef
libcurl/8.11.1: Copying sources to build folder
libcurl/8.11.1: Building your package in D:\agent-vocamdev\_work\7\conan_cache\p\b\libcu6edaacfacc2e1\b
libcurl/8.11.1: Calling generate()
libcurl/8.11.1: Generators folder: D:\agent-vocamdev\_work\7\conan_cache\p\b\libcu6edaacfacc2e1\b\build-release\conan
libcurl/8.11.1: Generating aggregated env files
libcurl/8.11.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.bat']
libcurl/8.11.1: Calling build()
libcurl/8.11.1: RUN: autoreconf --force --install

autom4te: error: need GNU m4 1.4 or later: /d/agent-vocamdev/_work/7/conan_cache/p/b/m489829311a5955/p/bin/m4.exe
aclocal: error: /d/agent-vocamdev/_work/7/conan_cache/p/autocf2af015330354/p/bin/autom4te failed with exit status: 1
autoreconf: error: aclocal failed with exit status: 1

libcurl/8.11.1: ERROR: 
Package 'f4dce8faf67fa2457b5dd4080902e114dab98fef' build failed
libcurl/8.11.1: WARN: Build folder D:\agent-vocamdev\_work\7\conan_cache\p\b\libcu6edaacfacc2e1\b\build-release
ERROR: libcurl/8.11.1: Error in build() method, line 245
	autotools.autoreconf()
	ConanException: Error 1 while executing
##[error]Cmd.exe exited with code '1'.

It resembles this issue from 2023, but that has a workaround with building m4 from source.
I tried that and it doesn't work. (and the issue is something with glibc too)

conan install --requires=libcurl/8.11.1@ -pr:h=pr_mingw32.txt -pr:b=pr_mingw64.txt --build=libcurl* -build=automake* --build=m4*

Here's my profiles that cross-build for Windows x86:
Build:

[settings]
# We are cross building to x86
os=Windows
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=14
compiler.exception=dwarf2
os.subsystem=msys2
compiler.threads=posix

[options]

[tool_requires]
cmake/3.25.3
[buildenv]
CONAN_CMAKE_SYSTEM_NAME=Windows
CONAN_CMAKE_GENERATOR=MSYS Makefiles
# Workaround for https://github.com/msys2/msys2-runtime/issues/145
MSYS2_ARG_CONV_EXCL=--import=TYPES#
# Workaround for https://github.com/msys2/msys2-runtime/issues/109
MSYS=disable_pcon

# Prepend to path to find msys tooling first
PATH=+(path)c:/msys64/mingw64/bin/
[conf]
tools.build:compiler_executables={"cpp": "C:/msys64/mingw64/bin/g++.exe", "c": "C:/msys64/mingw64/bin/gcc.exe"}
tools.cmake.cmaketoolchain:generator=MSYS Makefiles

Host:

[settings]
# We are cross building to x86
os=Windows
arch=x86
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=14
compiler.cppstd=gnu17
compiler.exception=dwarf2
compiler.threads=mcf
os.subsystem=msys2

[options]

[tool_requires]
cmake/3.25.3
[buildenv]
CONAN_CMAKE_SYSTEM_NAME=Windows
CONAN_CMAKE_GENERATOR=MSYS Makefiles
# Workaround for https://github.com/msys2/msys2-runtime/issues/145
MSYS2_ARG_CONV_EXCL=--import=TYPES#
# Workaround for https://github.com/msys2/msys2-runtime/issues/109
MSYS=disable_pcon

# Prepend to path to find msys tooling first
PATH=+(path)c:/tools/mingw32/bin/
[conf]
tools.build:compiler_executables={"cpp": "C:/tools/mingw32/bin/g++.exe", "c": "C:/tools/mingw32/bin/gcc.exe"}
tools.cmake.cmaketoolchain:generator=MSYS Makefiles

When I try to run m4.exe manually it shows an error-dialog.
Image
This is probably because it finds the x86 libraries on the path first.

depends.exe shows this in red:
Image

Pre-pending the folder to the path resolves that (and that's how it's setup in the conan-profile too)

Image

But when I do that in a terminal, m4 freezes:

Image

What could be the issue here?

@RudolfRendier RudolfRendier added the question Further information is requested label Jan 17, 2025
@RudolfRendier
Copy link
Author

Adding this to my x64-build-profile didn't help:

[runenv]
PATH=+(path)c:/msys64/mingw64/bin/

@RudolfRendier
Copy link
Author

I believe the settings for MSYS Makefiles is incorrect here:

CONAN_CMAKE_GENERATOR=MSYS Makefiles
tools.cmake.cmaketoolchain:generator=MSYS Makefiles

Although I'm using msys2 with a mingw32-compiler; I don't think the msys2-shell is used by conan.
The build is executed using a regular command prompt, and thus the default; MinGW Makefiles is the correct option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant