-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Impossible to use clang to build rust packages #303796
Comments
Is this still a problem? Have you tried |
It is still a problem. It is pretty clear where the problem is, namely, |
Ok, how have you tried setting the CC? Have you tried overriding rustc's stdenv to |
If you read the source code of |
I am reading the source code which is why I have been asking if you have tried changing the stdenv. |
Yes, I tried to pass a different stdenv as argument to |
|
I don't know, but using |
Yeah, these are two of the best (probably only) options. I suggest |
The Rust build infrastructure should be fixed, though. |
@emilazy True, |
Rust and Some of my early attempts to work around it involved turning |
Can we just say that use
setEnv
to force set environment variables before the cargo command is a bad idea?nixpkgs/pkgs/build-support/rust/lib/default.nix
Line 57 in ac6c93e
nixpkgs/pkgs/build-support/rust/hooks/cargo-build-hook.sh
Line 33 in ac6c93e
It forces
HOST_CC
to be set togcc
even whenstdenv
is switched to llvm, for example the code below would still rungcc
when building native packages because of theHOST_CC
setting, which would lead to linking failures:Note that this problem does not exist with Nixpkgs 23.05. It only becomes a problem after the
setEnv
approach is adopted in 23.11 and newer.In general, we want environment variables to be configurable. But this
setEnv
thing is just very difficult to override. Would appreciate suggestions on how to overrideHOST_CC
, or getting rid ofsetEnv
completely. Thanks!The text was updated successfully, but these errors were encountered: