about summary refs log tree commit diff
path: root/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh')
-rw-r--r--pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh b/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
new file mode 100644
index 000000000000..866a6912e090
--- /dev/null
+++ b/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
@@ -0,0 +1,11 @@
+#!@shell@
+
+# Optionally print debug info.
+if (( "${NIX_DEBUG:-0}" >= 1 )); then
+    echo "original flags to @prog@:" >&2
+    printf "  %q\n" "$@" >&2
+    echo "extra flags after to @prog@:" >&2
+    printf "  %q\n" $NIX_RUSTFLAGS >&2
+fi
+
+exec @prog@ "$@" $NIX_RUSTFLAGS