about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh')
-rw-r--r--nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh b/nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
index a62e35b8736f..2082f3126a53 100644
--- a/nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
+++ b/nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
@@ -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.