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

[package] gn/cci.20210429: Cross compiling not producing correct binary #25587

Open
Alan5142 opened this issue Oct 10, 2024 · 0 comments · May be fixed by #25590
Open

[package] gn/cci.20210429: Cross compiling not producing correct binary #25587

Alan5142 opened this issue Oct 10, 2024 · 0 comments · May be fixed by #25590
Labels
bug Something isn't working

Comments

@Alan5142
Copy link

Description

The gn package is ignoring cross-compilation, this causes an issue when compiling crashpad/cci.20220219 as it depends on this package.
The binaries provided by conan-center contain only binaries for AArch64, even if the desired arch is x86_64. An issue in the gn package causes this as it is ignoring cross-compilation.

I tried it on a macOS machine with Apple silicon, and it works
If I run this on a macOS machine with Intel, it fails with Bad CPU execution.

if I build the package locally, I can only produce x86_64 binaries if I set the build profile arch to x86_64, the host profile arch is ignored.

Package and Environment Details

  • Package Name/Version: gn/cci.20210429
  • Operating System+version: macOS 13, macOS 15
  • Compiler+version: Apple Clang 15
  • Conan version: conan 2.8.0
  • Python version: Python 3.12.6

Conan profile

Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
tools.apple:sdk_path=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk

Build profile:
[settings]
arch=armv8
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=15
os=Macos
tools.apple:sdk_path=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk

Steps to reproduce

Try to build the package gn/cci.20240611 on a macOS machine. Try with multiple permutations of host and build profile (this is on a macOS machine with Apple silicon).

conan build . --version cci.20210429 -pr:h x64 -pr:b default > produces an AArch64 binary
conan build . --version cci.20210429 -pr:h default -pr:b default > produces an AArch64 binary
conan build . --version cci.20210429 -pr:h default -pr:b x64 > produces a x86_64 binary
conan build . --version cci.20210429 -pr:h x64 -pr:b x64 > produces a x86_64 binaryApple

Logs

The attached logs correspond to a macOS with intel (Bad CPU exec).

Click to expand log
* Installing Conan: conan install . --output-folder=autobuild --build=missing --deployer=direct_deploy -v 

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=14
os=Macos
[conf]
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=14
os=Macos
[conf]
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config


======== Computing dependency graph ========
openssl/3.3.2: Not found in local cache, looking in remotes...
openssl/3.3.2: Checking remote: conancenter
openssl/3.3.2: Downloaded recipe revision 9f9f130d58e7c13e76bb8a559f0a6a8b
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
abseil/20240116.2: Not found in local cache, looking in remotes...
abseil/20240116.2: Checking remote: conancenter
abseil/20240116.2: Downloaded recipe revision 54f81a20ccd26a6558e18d57059847e2
libzip/1.11.1: Not found in local cache, looking in remotes...
libzip/1.11.1: Checking remote: conancenter
libzip/1.11.1: Downloaded recipe revision d2d3a370c9d16fd78bad6b84e189da14
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
xz_utils/5.4.5: Not found in local cache, looking in remotes...
xz_utils/5.4.5: Checking remote: conancenter
xz_utils/5.4.5: Downloaded recipe revision b885d1d79c9d30cff3803f7f551dbe66
zstd/1.5.5: Not found in local cache, looking in remotes...
zstd/1.5.5: Checking remote: conancenter
zstd/1.5.5: Downloaded recipe revision 1f239731dc45147c7fc2f54bfbde73df
protobuf/5.27.0: Not found in local cache, looking in remotes...
protobuf/5.27.0: Checking remote: conancenter
protobuf/5.27.0: Downloaded recipe revision ccce9aa25886556c6d66c77b2be4d806
crashpad/cci.20220219: Not found in local cache, looking in remotes...
crashpad/cci.20220219: Checking remote: conancenter
crashpad/cci.20220219: Downloaded recipe revision 952df026f66cca2dfe6eca4d6daf4c20
ninja/1.10.2: Not found in local cache, looking in remotes...
ninja/1.10.2: Checking remote: conancenter
ninja/1.10.2: Downloaded recipe revision e57e57c06536f91f14a0aac59baa8b0b
gn/cci.20210429: Not found in local cache, looking in remotes...
gn/cci.20210429: Checking remote: conancenter
gn/cci.20210429: Downloaded recipe revision 066e7db8b18cfad93df06371eeb10e7b
ninja/1.11.1: Not found in local cache, looking in remotes...
ninja/1.11.1: Checking remote: conancenter
ninja/1.11.1: Downloaded recipe revision 184939c044ea197cc4d0c37714f0f13b
cmake/3.22.6: Not found in local cache, looking in remotes...
cmake/3.22.6: Checking remote: conancenter
cmake/3.22.6: Downloaded recipe revision 32cced101c6df0fab43e8d00bd2483eb
Graph root
    conanfile.py: /Volumes/Stuff/Alto/Roland/SideCar/Source/conanfile.py
Requirements
    abseil/20240116.2#54f81a20ccd26a6558e18d57059847e2 - Downloaded (conancenter)
    bzip2/1.0.8#d00dac990f08d991998d624be81a9526 - Downloaded (conancenter)
    crashpad/cci.20220219#952df026f66cca2dfe6eca4d6daf4c20 - Downloaded (conancenter)
    libzip/1.11.1#d2d3a370c9d16fd78bad6b84e189da14 - Downloaded (conancenter)
    openssl/3.3.2#9f9f130d58e7c13e76bb8a559f0a6a8b - Downloaded (conancenter)
    protobuf/5.27.0#ccce9aa25886556c6d66c77b2be4d806 - Downloaded (conancenter)
    xz_utils/5.4.5#b885d1d79c9d30cff3803f7f551dbe66 - Downloaded (conancenter)
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Downloaded (conancenter)
    zstd/1.5.5#1f239731dc45147c7fc2f54bfbde73df - Downloaded (conancenter)
Build requirements
    cmake/3.22.6#32cced101c6df0fab43e8d00bd2483eb - Downloaded (conancenter)
    gn/cci.20210429#066e7db8b18cfad93df06371eeb10e7b - Downloaded (conancenter)
    ninja/1.10.2#e57e57c06536f91f14a0aac59baa8b0b - Downloaded (conancenter)
    ninja/1.11.1#184939c044ea197cc4d0c37714f0f13b - Downloaded (conancenter)
Resolved version ranges
    zlib/[>=1.2.11 <2]: zlib/1.3.1

======== Computing necessary packages ========
abseil/20240116.2: Main binary package '3a30e794f52cc541a8eef1d48bd278ebdcc60c18' missing
abseil/20240116.2: Checking 7 compatible configurations
abseil/20240116.2: Compatible configurations not found in cache, checking servers
abseil/20240116.2: '262d398523e3cf043e4616699660b816c5d41105': compiler.cppstd=14
abseil/20240116.2: 'b4e820decaeb7eddc651326f74049178049a1f87': compiler.cppstd=gnu14
abseil/20240116.2: '3381de3bce3b26e2939b85d2b8118bf754612317': compiler.cppstd=17
abseil/20240116.2: 'e0302b1d775964cf9e2179ccdd5ae18a3c5221e9': compiler.cppstd=20
abseil/20240116.2: 'e8d65307cf4c168f44955528b8d19efbbeea5861': compiler.cppstd=gnu20
abseil/20240116.2: '66390b50b5c7a56076540f67c0da4bf9308623d0': compiler.cppstd=23
abseil/20240116.2: 'e2508499090766731d585fc5f7b05356f0d6de26': compiler.cppstd=gnu23
protobuf/5.27.0: Main binary package '75fbf588d39da3d22d5fec49ed3424d7d573ce49' missing
protobuf/5.27.0: Checking 7 compatible configurations
protobuf/5.27.0: Compatible configurations not found in cache, checking servers
protobuf/5.27.0: '71a696e53eec21724d96de244f213a4832be3214': compiler.cppstd=14
protobuf/5.27.0: '91f3d9bc1a72d31a6d97ad57ec84abfff855170b': compiler.cppstd=gnu14
protobuf/5.27.0: '8b60df65ed2a2c74b8e588e2eed16672214e9890': compiler.cppstd=17
protobuf/5.27.0: '844b894aa221bb9e5fb4359e52b8f6cb6ea82937': compiler.cppstd=20
protobuf/5.27.0: 'bb6bcb4d43a2e76e99bbdbc5f86e7111de40111a': compiler.cppstd=gnu20
protobuf/5.27.0: 'dafe5d7e0976674e58303869642ee74f1106a03d': compiler.cppstd=23
protobuf/5.27.0: '74d1a28cf8cd47ec50cd1a513cbcafd444c384a1': compiler.cppstd=gnu23
crashpad/cci.20220219: Main binary package '02e34ffa407083a0edf19e0bb71f3c5d27b9d715' missing
crashpad/cci.20220219: Checking 7 compatible configurations
crashpad/cci.20220219: Compatible configurations not found in cache, checking servers
crashpad/cci.20220219: 'e4cd96a79e2b39b41d2e2e51572aa26260c51a23': compiler.cppstd=14
crashpad/cci.20220219: '073149ab5eaae694d74ea8448f59be432af0dd2e': compiler.cppstd=gnu14
crashpad/cci.20220219: '21d7d63d84266c705f68a510e2acd24fea586d1b': compiler.cppstd=17
crashpad/cci.20220219: '75776ded6adc288a037b9624fd16226af7bbbc19': compiler.cppstd=20
crashpad/cci.20220219: 'e2d172f5bd45f77f46304920d5d7189c2cf564df': compiler.cppstd=gnu20
crashpad/cci.20220219: 'fe88991857d01a610b110679edff3905cf5b7853': compiler.cppstd=23
crashpad/cci.20220219: '8ceffd6f24e3692d3a0d294dcf7b8a5edaec3f3b': compiler.cppstd=gnu23
Requirements
    abseil/20240116.2#54f81a20ccd26a6558e18d57059847e2:3a30e794f52cc541a8eef1d48bd278ebdcc60c18 - Build
    bzip2/1.0.8#d00dac990f08d991998d624be81a9526:9218a6b41fbd01efbed3596d0d11aa6a43d7b4fb - Build
    crashpad/cci.20220219#952df026f66cca2dfe6eca4d6daf4c20:02e34ffa407083a0edf19e0bb71f3c5d27b9d715 - Build
    libzip/1.11.1#d2d3a370c9d16fd78bad6b84e189da14:f57480848f586373ff66d623ca657a518ca6520d - Build
    openssl/3.3.2#9f9f130d58e7c13e76bb8a559f0a6a8b:c86f2285509404e2b5d086361f197b5af66ce9c6 - Build
    protobuf/5.27.0#ccce9aa25886556c6d66c77b2be4d806:75fbf588d39da3d22d5fec49ed3424d7d573ce49 - Build
    xz_utils/5.4.5#b885d1d79c9d30cff3803f7f551dbe66:6fe7fa69f760aee504e0be85c12b2327c716f9e7 - Build
    zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:6fe7fa69f760aee504e0be85c12b2327c716f9e7 - Build
    zstd/1.5.5#1f239731dc45147c7fc2f54bfbde73df:0a362bffe291c530fce785c47657a3faa4f9b230 - Build
Build requirements
    cmake/3.22.6#32cced101c6df0fab43e8d00bd2483eb:9e5323c65b94ae38c3c733fe12637776db0119a5#7b5af65c2e837696ee8227674734cedf - Download (conancenter)
    gn/cci.20210429#066e7db8b18cfad93df06371eeb10e7b:9ac8640923e5284645f8852ef8ba335654f4020e#d7380330e7802e7119832ff1b820cbb6 - Download (conancenter)
    ninja/1.10.2#e57e57c06536f91f14a0aac59baa8b0b:9ac8640923e5284645f8852ef8ba335654f4020e#b039396a037dce50095b67fc7cc3ed0a - Download (conancenter)
    ninja/1.11.1#184939c044ea197cc4d0c37714f0f13b:9ac8640923e5284645f8852ef8ba335654f4020e#0943503a21a3beb1238c0805dacc4d28 - Skip

======== Installing packages ========

-------- Downloading 3 packages --------
cmake/3.22.6: Retrieving package 9e5323c65b94ae38c3c733fe12637776db0119a5 from remote 'conancenter' 
cmake/3.22.6: Downloading 69.7MB conan_package.tgz
cmake/3.22.6: Decompressing 69.7MB conan_package.tgz
cmake/3.22.6: Package installed 9e5323c65b94ae38c3c733fe12637776db0119a5
cmake/3.22.6: Downloaded package revision 7b5af65c2e837696ee8227674734cedf
ninja/1.10.2: Retrieving package 9ac8640923e5284645f8852ef8ba335654f4020e from remote 'conancenter' 
ninja/1.10.2: Package installed 9ac8640923e5284645f8852ef8ba335654f4020e
ninja/1.10.2: Downloaded package revision b039396a037dce50095b67fc7cc3ed0a
gn/cci.20210429: Retrieving package 9ac8640923e5284645f8852ef8ba335654f4020e from remote 'conancenter' 
gn/cci.20210429: Package installed 9ac8640923e5284645f8852ef8ba335654f4020e
gn/cci.20210429: Downloaded package revision d7380330e7802e7119832ff1b820cbb6
abseil/20240116.2: Sources downloaded from 'conancenter'
abseil/20240116.2: Calling source() in /Users/moises/.conan2/p/abseif9624c6245899/s/src
abseil/20240116.2: Unzipping 20240116.2.tar.gz to .

... // A lot of compilation lines of OpenSSL

protobuf/5.27.0: package(): Packaged 1 '.0' file: protoc-27.0.0
protobuf/5.27.0: package(): Packaged 2 files: protoc, LICENSE
protobuf/5.27.0: package(): Packaged 238 '.h' files
protobuf/5.27.0: package(): Packaged 14 '.proto' files
protobuf/5.27.0: package(): Packaged 2 '.inc' files: port_undef.inc, port_def.inc
protobuf/5.27.0: package(): Packaged 4 '.a' files: libutf8_range.a, libprotobuf.a, libprotoc.a, libutf8_validity.a
protobuf/5.27.0: package(): Packaged 4 '.cmake' files: protobuf-module.cmake, protobuf-generate.cmake, protobuf-conan-protoc-target.cmake, protobuf-options.cmake
protobuf/5.27.0: Created package revision 70f87a710ed894bf8b17dc3ded842e57
protobuf/5.27.0: Package '75fbf588d39da3d22d5fec49ed3424d7d573ce49' created
protobuf/5.27.0: Full package reference: protobuf/5.27.0#ccce9aa25886556c6d66c77b2be4d806:75fbf588d39da3d22d5fec49ed3424d7d573ce49#70f87a710ed894bf8b17dc3ded842e57
protobuf/5.27.0: Package folder /Users/moises/.conan2/p/b/protob85a3457edea0/p
crashpad/cci.20220219: Sources downloaded from 'conancenter'
crashpad/cci.20220219: Calling source() in /Users/moises/.conan2/p/crash30029e2281d3c/s
crashpad/cci.20220219: Unzipping e9937cb36cd12f24d73a07c4b91168cf1885b5db.tar.gz to /Users/moises/.conan2/p/crash30029e2281d3c/s
crashpad/cci.20220219: Unzipping 822fada4a9972e3e2f36a981da770539025beb0a.tar.gz to /Users/moises/.conan2/p/crash30029e2281d3c/s/third_party/mini_chromium/mini_chromium

-------- Installing package crashpad/cci.20220219 (11 of 12) --------
crashpad/cci.20220219: Building from source
crashpad/cci.20220219: Package crashpad/cci.20220219:02e34ffa407083a0edf19e0bb71f3c5d27b9d715
crashpad/cci.20220219: Copying sources to build folder
crashpad/cci.20220219: Building your package in /Users/moises/.conan2/p/b/crash031333b9dea40/b
crashpad/cci.20220219: Calling generate()
crashpad/cci.20220219: Generators folder: /Users/moises/.conan2/p/b/crash031333b9dea40/b
crashpad/cci.20220219: Generating aggregated env files
crashpad/cci.20220219: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
crashpad/cci.20220219: Calling build()
crashpad/cci.20220219: Apply patch (file): patches/cci.20220219-0001-fix-openssl-link-order.patch
crashpad/cci.20220219: Apply patch (file): patches/cci.20220219-0002-remove-fPIC-Werror-LTO.patch
crashpad/cci.20220219: Apply patch (file): patches/cci.20220219-0003-compilers-from-env.patch
crashpad/cci.20220219: Apply patch (file): patches/cci.20220219-0004-use-conan-linux-syscall-support-package.patch
crashpad/cci.20220219: Apply patch (file): patches/cci.20220219-0005-allow-all-archs.patch
crashpad/cci.20220219: Apply patch (file): patches/cci.20220219-0006-mini_chromium-win_helper-py3.patch
crashpad/cci.20220219: Apply patch (file): patches/cci.20210507-0007-use-system-zlib.patch
crashpad/cci.20220219: Apply patch (file): patches/cci.20220219-0007-static-lib-tool_support.patch
crashpad/cci.20220219: RUN: gn gen out/Default --args="host_os=\"mac\" host_cpu=\"x64\" is_debug=false crashpad_http_transport_impl=\"\" crashpad_use_boringssl_for_http_transport_socket=false extra_cflags=\"-DNDEBUG -I/Users/moises/.conan2/p/b/zlib7c5901f14fd57/p/include -fPIC\" extra_cflags_c=\"\" extra_cflags_cc=\"-stdlib=libc++ -std=gnu++17 -m64 -fPIC -O3\" extra_ldflags=\"-m64 -L/Users/moises/.conan2/p/b/zlib7c5901f14fd57/p/lib -lz\""
/bin/sh: /Users/moises/.conan2/p/gna9dc9414de245/p/bin/gn: Bad CPU type in executable

crashpad/cci.20220219: ERROR: 
Package '02e34ffa407083a0edf19e0bb71f3c5d27b9d715' build failed
crashpad/cci.20220219: WARN: Build folder /Users/moises/.conan2/p/b/crash031333b9dea40/b
ERROR: crashpad/cci.20220219: Error in build() method, line 180
	self.run("gn gen out/Default --args=\"{}\"".format(" ".join(gn_args)))
	ConanException: Error 126 while executing
@Alan5142 Alan5142 added the bug Something isn't working label Oct 10, 2024
@Alan5142 Alan5142 linked a pull request Oct 10, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant