You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 in rust.envVars.setEnv which sets environment variables for cargo invocations in the following order:
CC_AARCH64_APPLE_DARWIN: "Static" host CC
CXX_AARCH64_APPLE_DARWIN: "Static" host CXX
CC_AARCH64_APPLE_DARWIN: Regular build CC <- Incorrect!
Here gsn92... (pkgsStatic.stdenv.cc) should be used instead of 700a0...-clang-wrapper-16.0.6 (stdenv.cc) for hostPlatform builds. This causes Rust packages like rtrtr to fail linking:
$ nix-build -A pkgsStatic.rtrtr
...
warning: `rtrtr` (lib) generated 1 warning
error: linking with `/nix/store/700a0ayy1s1h7zg9dqiqy0xvmhfr26l6-clang-wrapper-16.0.6/bin/cc` failed: exit status: 1
|
= note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" (...) "/nix/store/700a0ayy1s1h7zg9dqiqy0xvmhfr26l6-clang-wrapper-16.0.6/bin/cc" (...)
= note: ld: library not found for -liconv
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
(libiconv-static is present)
Ref: #346043 which enabled building almost-static packages on macOS/Darwin 🎊
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: