cargoSetupHook: fix setting crt-static

As is retrospectively obvious from the fact that it was looking at
pkgsTargetTarget, this should have been in the section for the target,
not the host.  This fixes e.g. pkgsStatic.xq for 64-bit RISC-V.

(For platforms other than 64-bit RISC-V this being wrong was masked by
the musl Rust targets being static by default.)
This commit is contained in:
Alyssa Ross
2025-05-13 19:00:42 +02:00
parent b372f5a5d3
commit 112d13c5c7
+3 -3
View File
@@ -109,13 +109,13 @@
lib.optionalString (stdenv.hostPlatform.config != stdenv.targetPlatform.config) ''
[target."${stdenv.targetPlatform.rust.rustcTarget}"]
"linker" = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc"
"rustflags" = [ "-C", "target-feature=${
if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-"
}crt-static" ]
''
+ ''
[target."${stdenv.hostPlatform.rust.rustcTarget}"]
"linker" = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
"rustflags" = [ "-C", "target-feature=${
if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-"
}crt-static" ]
'';
};
passthru.tests =