Skip to content

[WIP] ed: fix cross build#32489

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
orivej:ed
Jan 9, 2018
Merged

[WIP] ed: fix cross build#32489
Ericson2314 merged 1 commit intoNixOS:masterfrom
orivej:ed

Conversation

@orivej
Copy link
Contributor

@orivej orivej commented Dec 8, 2017

Motivation for this change

Fixes #32322 (comment)

@Ericson2314 Is it correct that there is no CC env var during the cross compilation? (I had to use CC_FOR_BUILD or BUILD_CC instead.)

Things done

Tested with nix-build pkgs/top-level/release-cross.nix -A rpi.ed.x86_64-linux.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@orivej orivej requested a review from Ericson2314 December 8, 2017 21:36
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Dec 8, 2017
@orivej
Copy link
Contributor Author

orivej commented Dec 8, 2017

Besides, CC_FOR_BUILD being armv6l-unknown-linux-gnueabihf-gcc seems wrong. CC_FOR_BUILD should be the native compiler, and CC should be the cross compiler.

@orivej orivej changed the title ed: fix cross build [WIP] ed: fix cross build Dec 8, 2017
@orivej
Copy link
Contributor Author

orivej commented Dec 8, 2017

See also #25212 (comment)

@Ericson2314
Copy link
Member

It should be CC. I'm going to chalk this up as things been broken until #26805 lands. The existing crossConfig logic I put in the setup hook is not correct.

@dtzWill
Copy link
Member

dtzWill commented Jan 9, 2018

Changing this to be "CC=$CC" works, since the variable is set now. Can you update your commit to do that instead? Once that's done, this is ready to go! 👍

(Ping! ed` blocks a lot of things, and the way this is implemented won't cause non-cross rebuilds... )

@Ericson2314 Ericson2314 self-assigned this Jan 9, 2018
@Ericson2314
Copy link
Member

Done!

@Ericson2314 Ericson2314 merged commit b850eb3 into NixOS:master Jan 9, 2018
@Ericson2314 Ericson2314 added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants