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

[bug] Autotoolstoolchain will fail to generate in FFMPEG due to forced --host=aarch64-apple-darwin parameter #12431

Closed
sorny92 opened this issue Oct 31, 2022 · 2 comments · Fixed by #12884
Assignees
Milestone

Comments

@sorny92
Copy link

sorny92 commented Oct 31, 2022

Environment Details (include every applicable attribute)

  • Operating System+version: Macos
  • Arch: armv8
  • Compiler+version: apple-clang 12
  • Conan version: 1.53.0
  • Python version:

Steps to reproduce (Include if Applicable)

This PR: conan-io/conan-center-index#13235
And this PR: conan-io/conan-center-index#13664
Both are trying the same thing.

When it's cross building for armv8 Autotoolstoolchain will add --host=aarch64-apple-darwin argument no matter what you do. This makes ffmpeg build to fail because this parameter is not supported.
Probably the same will happen with the argument --build=x86_64-apple-darwin

Logs (Executed commands with output) (Include/Attach if Applicable)

ffmpeg/5.0: Calling build()
ffmpeg/5.0: Calling:
 > "/Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/./configure" '--disable-shared' '--enable-static' '--prefix=/' '--bindir=${prefix}/bin' '--libdir=${prefix}/lib' '--incdir=${prefix}/include' '--pkg-config-flags=--static' '--disable-doc' '--enable-cross-compile' '--enable-asm' '--enable-pic' '--enable-avdevice' '--enable-avcodec' '--enable-avformat' '--enable-swresample' '--enable-swscale' '--enable-postproc' '--enable-avfilter' '--enable-bzlib' '--enable-zlib' '--enable-lzma' '--enable-iconv' '--enable-libopenjpeg' '--enable-libopenh264' '--enable-libvorbis' '--enable-libopus' '--disable-libzmq' '--disable-sdl2' '--enable-libx264' '--enable-libx265' '--enable-libvpx' '--enable-libmp3lame' '--enable-libfdk-aac' '--enable-libwebp' '--enable-openssl' '--disable-alsa' '--disable-libpulse' '--disable-vaapi' '--disable-vdpau' '--disable-libxcb' '--disable-libxcb-shm' '--disable-libxcb-shape' '--disable-libxcb-xfixes' '--enable-appkit' '--enable-avfoundation' '--enable-coreimage' '--enable-audiotoolbox' '--enable-videotoolbox' '--disable-securetransport' '--disable-cuda' '--disable-cuvid' '--enable-nonfree' '--enable-gpl' '--disable-vulkan' '--install-name-dir=@rpath' '--arch=armv8' '--target-os=Macos' '--disable-outdev=audiotoolbox' '--host=aarch64-apple-darwin' '--build=x86_64-apple-darwin' 

----Running------
> . "/Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/build-release/conan/conanbuild.sh" && "/Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/./configure" '--disable-shared' '--enable-static' '--prefix=/' '--bindir=${prefix}/bin' '--libdir=${prefix}/lib' '--incdir=${prefix}/include' '--pkg-config-flags=--static' '--disable-doc' '--enable-cross-compile' '--enable-asm' '--enable-pic' '--enable-avdevice' '--enable-avcodec' '--enable-avformat' '--enable-swresample' '--enable-swscale' '--enable-postproc' '--enable-avfilter' '--enable-bzlib' '--enable-zlib' '--enable-lzma' '--enable-iconv' '--enable-libopenjpeg' '--enable-libopenh264' '--enable-libvorbis' '--enable-libopus' '--disable-libzmq' '--disable-sdl2' '--enable-libx264' '--enable-libx265' '--enable-libvpx' '--enable-libmp3lame' '--enable-libfdk-aac' '--enable-libwebp' '--enable-openssl' '--disable-alsa' '--disable-libpulse' '--disable-vaapi' '--disable-vdpau' '--disable-libxcb' '--disable-libxcb-shm' '--disable-libxcb-shape' '--disable-libxcb-xfixes' '--enable-appkit' '--enable-avfoundation' '--enable-coreimage' '--enable-audiotoolbox' '--enable-videotoolbox' '--disable-securetransport' '--disable-cuda' '--disable-cuvid' '--enable-nonfree' '--enable-gpl' '--disable-vulkan' '--install-name-dir=@rpath' '--arch=armv8' '--target-os=Macos' '--disable-outdev=audiotoolbox' '--host=aarch64-apple-darwin' '--build=x86_64-apple-darwin' 
-----------------
Capturing current environment in /Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/build-release/conan/deactivate_conanbuildenv-release-armv8.sh
Configuring environment variables
Capturing current environment in /Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/build-release/conan/deactivate_conanautotoolstoolchain.sh
Configuring environment variables
Capturing current environment in /Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/build-release/conan/deactivate_conanautotoolsdeps.sh
Configuring environment variables
Unknown option "--host=aarch64-apple-darwin".
See /Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/./configure --help for available options.
ffmpeg/5.0: 
ffmpeg/5.0: ERROR: Package '4d481ca703341d8b58965ab34913028d8e8af176' build failed
ffmpeg/5.0: WARN: Build folder /Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/build-release
ERROR: ffmpeg/5.0: Error in build() method, line 565
	autotools.configure()
	ConanException: Error 1 while executing "/Users/jenkins/w/prod/BuildSingleReference@2/.conan/data/ffmpeg/5.0/_/_/build/4d481ca703341d8b58965ab34913028d8e8af176/./configure" '--disable-shared' '--enable-static' '--prefix=/' '--bindir=${prefix}/bin' '--libdir=${prefix}/lib' '--incdir=${prefix}/include' '--pkg-config-flags=--static' '--disable-doc' '--enable-cross-compile' '--enable-asm' '--enable-pic' '--enable-avdevice' '--enable-avcodec' '--enable-avformat' '--enable-swresample' '--enable-swscale' '--enable-postproc' '--enable-avfilter' '--enable-bzlib' '--enable-zlib' '--enable-lzma' '--enable-iconv' '--enable-libopenjpeg' '--enable-libopenh264' '--enable-libvorbis' '--enable-libopus' '--disable-libzmq' '--disable-sdl2' '--enable-libx264' '--enable-libx265' '--enable-libvpx' '--enable-libmp3lame' '--enable-libfdk-aac' '--enable-libwebp' '--enable-openssl' '--disable-alsa' '--disable-libpulse' '--disable-vaapi' '--disable-vdpau' '--disable-libxcb' '--disable-libxcb-shm' '--disable-libxcb-shape' '--disable-libxcb-xfixes' '--enable-appkit' '--enable-avfoundation' '--enable-coreimage' '--enable-audiotoolbox' '--enable-videotoolbox' '--disable-securetransport' '--disable-cuda' '--disable-cuvid' '--enable-nonfree' '--enable-gpl' '--disable-vulkan' '--install-name-dir=@rpath' '--arch=armv8' '--target-os=Macos' '--disable-outdev=audiotoolbox' '--host=aarch64-apple-darwin' '--build=x86_64-apple-darwin' 

Suggestion

This parameters are introduced by this code in autotoolstoolchain.py:

        for flag, var in (("host", self._host), ("build", self._build), ("target", self._target)):
            if var and flag not in user_args_str:
                configure_args.append('--{}={}'.format(flag, var))

It would be helpful if this was either generated before calling generate() method or allow a way to configure this.

@memsharded
Copy link
Member

Hi @sorny92

Thanks for your report.
It would be great if we can reduce this to something a bit more minimal, so it can be managed in our test suite.
We have the conan new hello/0.1 -m=autotools_lib template, does this behavior still happens with this template?
If it happens, is the AutotoolsToolchain wrong, or it is just something related to the specifics of the library that needs customization?

@sorny92
Copy link
Author

sorny92 commented Nov 1, 2022

Hi @memsharded,
AFAIK it's specific needs for ffmpeg itself.
As you can see in ffmpeg's configure file:

  --host-cc=HOSTCC         use host C compiler HOSTCC
  --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
  --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  --host-ld=HOSTLD         use host linker HOSTLD
  --host-ldflags=HLDFLAGS  use HLDFLAGS when linking for host
  --host-extralibs=HLIBS   use libs HLIBS when linking for host
  --host-os=OS             compiler host OS [$target_os]

There's no --host option so once AutotoolsToolchain calls generate the arguments host and build will be addes making FFmpeg fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment