depot/third_party/nixpkgs/pkgs/build-support/rust/rustc-wrapper/rustc-wrapper.sh
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

29 lines
635 B
Bash

#!@shell@
defaultSysroot=(@sysroot@)
for arg; do
case "$arg" in
--sysroot)
defaultSysroot=()
;;
--)
break
;;
esac
done
extraBefore=("${defaultSysroot[@]}")
extraAfter=($NIX_RUSTFLAGS)
# Optionally print debug info.
if (( "${NIX_DEBUG:-0}" >= 1 )); then
echo "extra flags before to @prog@:" >&2
printf " %q\n" "${extraBefore[@]}" >&2
echo "original flags to @prog@:" >&2
printf " %q\n" "$@" >&2
echo "extra flags after to @prog@:" >&2
printf " %q\n" "${extraAfter[@]}" >&2
fi
exec @prog@ "${extraBefore[@]}" "$@" "${extraAfter[@]}"