Correct CC/CXX variables are clobbered for almost-static Rust package builds on Darwin #356783
Labels
0.kind: bug
Something is broken
6.topic: darwin
Running or building packages on Darwin
6.topic: static
Describe the bug
The "static" variant of a Darwin platform has the same
cargoShortTarget
as its regular, non-static counterpart (e.g.,aarch64-apple-darwin
). This causes an issue inrust.envVars.setEnv
which sets environment variables forcargo
invocations in the following order:CC_AARCH64_APPLE_DARWIN
: "Static" host CCCXX_AARCH64_APPLE_DARWIN
: "Static" host CXXCC_AARCH64_APPLE_DARWIN
: Regular build CC <- Incorrect!CXX_AARCH64_APPLE_DARWIN
: Regular build CXX <- Incorrect!As a result, the correct host CC/CXX variables are clobbered:
Here
gsn92...
(pkgsStatic.stdenv.cc
) should be used instead of700a0...-clang-wrapper-16.0.6
(stdenv.cc
) for hostPlatform builds. This causes Rust packages likertrtr
to fail linking:(
libiconv-static
is present)Ref: #346043 which enabled building almost-static packages on macOS/Darwin 🎊
Steps To Reproduce
Steps to reproduce the behavior:
nix-build -A pkgsStatic.rtrtr
on aarch64-darwinExpected behavior
Screenshots
Additional context
Metadata
Notify maintainers
Darwin people:
@reckenrode
@emilazy
@toonn
Rust people:
@figsoda
@Mic92
@winterqt
Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: