mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03: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 changed files with 14 additions and 1 deletions
|
@ -1,6 +1,19 @@
|
||||||
#!@shell@
|
#!@shell@
|
||||||
|
|
||||||
extraBefore=(@sysroot@)
|
defaultSysroot=(@sysroot@)
|
||||||
|
|
||||||
|
for arg; do
|
||||||
|
case "$arg" in
|
||||||
|
--sysroot)
|
||||||
|
defaultSysroot=()
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
extraBefore=("${defaultSysroot[@]}")
|
||||||
extraAfter=($NIX_RUSTFLAGS)
|
extraAfter=($NIX_RUSTFLAGS)
|
||||||
|
|
||||||
# Optionally print debug info.
|
# Optionally print debug info.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue