mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
wrapRustcWith: allow --sysroot to be overridden
It turns out that unlike a normal Unix program, if the --sysroot
option is given more than once, rustc will error rather than using the
last value given. Therefore, we need to ensure we only add our
default --sysroot argument if one hasn't been given explicitly on the
wrapper's command line.
This fixes cross compilation of rustc.
Closes: https://github.com/NixOS/nixpkgs/issues/271736
Fixes: 8b51cdd3be
("rustc: add a compiler wrapper")
This commit is contained in:
parent
1f30be411f
commit
ca8a6d8c19
@ -1,6 +1,19 @@
|
||||
#!@shell@
|
||||
|
||||
extraBefore=(@sysroot@)
|
||||
defaultSysroot=(@sysroot@)
|
||||
|
||||
for arg; do
|
||||
case "$arg" in
|
||||
--sysroot)
|
||||
defaultSysroot=()
|
||||
;;
|
||||
--)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
extraBefore=("${defaultSysroot[@]}")
|
||||
extraAfter=($NIX_RUSTFLAGS)
|
||||
|
||||
# Optionally print debug info.
|
||||
|
Loading…
Reference in New Issue
Block a user