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

aws-sdk-cpp: fix cross compilation #61519

Merged
merged 1 commit into from May 22, 2019

Conversation

erictapen
Copy link
Member

@erictapen erictapen commented May 14, 2019

Motivation for this change

Fix cross compilation of nix: nix build nixpkgs.pkgsCross.aarch64-multiplatform.nix

...
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Updating version info to 1.7.90
-- Custom memory management disabled
-- Performing Test CURL_HAS_H2
CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
   CURL_HAS_H2_EXITCODE (advanced)
   CURL_HAS_H2_EXITCODE__TRYRUN_OUTPUT (advanced)
For details see /build/source/build/TryRunResults.cmake
-- Performing Test CURL_HAS_H2 - Failed
-- Configuring incomplete, errors occurred!
See also "/build/source/build/CMakeFiles/CMakeOutput.log".
See also "/build/source/build/CMakeFiles/CMakeError.log".
builder for '/nix/store/wagq7k2fbgkl32alzfh5f4ysgpvsi4jw-aws-sdk-cpp-1.7.90-aarch64-unknown-linux-gnu.drv' failed with exit code 1
cannot build derivation '/nix/store/lkbs04l8a4489pykvfrjj0r4vc8y2k2i-nix-2.2.2-aarch64-unknown-linux-gnu.drv': 1 dependencies couldn't be built
error: build of '/nix/store/lkbs04l8a4489pykvfrjj0r4vc8y2k2i-nix-2.2.2-aarch64-unknown-linux-gnu.drv' failed

I think the problem was introduced in aws/aws-sdk-cpp@f024f1d.

Things done

Provided the expected result of a CMake try_run call. I'm really unsure about wether this is supposed to be 0 or 1. The exit code of the test should be 0 and the docs say that the variable should be set to the exit code, but it might be better if someone double checked wether this really translates to -DCURL_HAS_H2=0.

I did not run the build result, as I have no access to aarch64 hardware atm.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

aws-sdk-cpp tries to run code at build time using check_c_source_runs
[0] and therefore needs to be told about the expected exit code [1].

[0] https://cmake.org/cmake/help/latest/module/CheckCSourceRuns.html
[1] https://cmake.org/cmake/help/latest/command/try_run.html#behavior-when-cross-compiling
@erictapen
Copy link
Member Author

@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.nix

@erictapen
Copy link
Member Author

@GrahamcOfBorg build aws-sdk-cpp

@matthewbauer
Copy link
Member

matthewbauer commented May 18, 2019

@erictapen looks good to me if pkgsCross.aarch64-multiplatform.nix builds. Can't build it right now though

@lukateras lukateras merged commit 4dd5c93 into NixOS:master May 22, 2019
@lukateras
Copy link
Member

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

3 participants