-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
rustc: be extremely principled about cross builds #356769
base: staging
Are you sure you want to change the base?
Conversation
First impressions: This looks significantly more correct. I’m still sceptical of the weird |
There were a lot of collapsed assumptions about the cross build process in this derivation, especially with the overloaded meanings of useLLVM. This diff splits useLLVM into a value for each of the build, host, and target platforms. We also specify more target-specific configure flags, including passing through the llvm-config-native binary which is built in some cross configurations. This also allows us to clean up some hacky NIX_LDFLAGS code. This commit was tested with the following build configurations: * x86_64-freebsd -> x86_64-freebsd -> x86_64-freebsd * x86_64-freebsd -> x86_64-freebsd -> x86_64-linux * x86_64-freebsd -> x86_64-linux -> x86_64-linux * x86_64-freebsd -> x86_64-freebsd -> aarch64-linux * x86_64-freebsd -> aarch64-linux -> aarch64-linux * x86_64-linux -> x86_64-linux -> x86_64-linux * x86_64-linux -> x86_64-linux -> aarch64-linux * x86_64-linux -> aarch64-linux -> aarch64-linux * x86_64-linux -> x86_64-linux -> x86_64-freebsd * x86_64-linux -> x86_64-freebsd -> x86_64-freebsd
This looks nice, just make sure rust things build in pkgsLLVM. |
else if withBundledLLVM then | ||
"in-tree" | ||
else | ||
"system" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated three times — maybe a function?
] | ||
else | ||
[ | ||
"${setHost}.llvm-config=${llvmShared.dev}/bin/llvm-config-native" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should always create llvm-config-native, even in non-cross builds… This is fine for now though!
I'll address these review comments in a sec but more importantly Ross' comments reveal that this seems to have broken pkgsLLVM.rustc... the error messages are quite confusing but I'll get to the bottom of it. |
There were a lot of collapsed assumptions about the cross build process in this derivation, especially with the overloaded meanings of useLLVM. This diff splits useLLVM into a value for each of the build, host, and target platforms. We also specify more target-specific configure flags, including passing through the llvm-config-native binary which is built in some cross configurations. This also allows us to clean up some hacky NIX_LDFLAGS code.
This commit was tested with the following build configurations:
Please note that darwin is completely absent from this list. I don't have any apple machines!
This PR has several dependencies. I've submitted them all as separate PRs, but some of them target staging and others master. If you'd like to test this branch, please build rhelmot:freebsd-staging-test.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.