Merge pull request #317755 from thehabbos007/master

BuildRustCrate: proc macros must be built for build's platform
This commit is contained in:
Ilan Joselevich
2024-06-20 17:04:57 +03:00
committed by GitHub
@@ -49,6 +49,8 @@ let
filename =
if lib.any (x: x == "lib" || x == "rlib") dep.crateType
then "${dep.metadata}.rlib"
# Adjust lib filename for crates of type proc-macro. Proc macros are compiled/run on the build platform architecture.
else if (lib.attrByPath [ "procMacro" ] false dep) then "${dep.metadata}${stdenv.buildPlatform.extensions.library}"
else "${dep.metadata}${stdenv.hostPlatform.extensions.library}";
in
" --extern ${opts}${name}=${dep.lib}/lib/lib${extern}-${filename}"