cc-wrapper: Hardcode path to mktemp and rm if possible

These commands are run after the path backup is restored

Co-authored-by: IlyaNiklyaev <ilya.niklyaev@gmail.com>
This commit is contained in:
Artturin 2024-10-18 20:50:27 +03:00
parent e056730f13
commit 985072e2ce
2 changed files with 4 additions and 2 deletions

View File

@ -251,8 +251,8 @@ if [[ -e @out@/nix-support/cc-wrapper-hook ]]; then
fi
if (( "${NIX_CC_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then
responseFile=$(mktemp "${TMPDIR:-/tmp}/cc-params.XXXXXX")
trap 'rm -f -- "$responseFile"' EXIT
responseFile=$(@mktemp@ "${TMPDIR:-/tmp}/cc-params.XXXXXX")
trap '@rm@ -f -- "$responseFile"' EXIT
printf "%q\n" \
${extraBefore+"${extraBefore[@]}"} \
${params+"${params[@]}"} \

View File

@ -741,6 +741,8 @@ stdenvNoCC.mkDerivation {
# TODO(@sternenseemann): rename env var via stdenv rebuild
shell = getBin runtimeShell + runtimeShell.shellPath or "";
gnugrep_bin = optionalString (!nativeTools) gnugrep;
rm = if nativeTools then "rm" else lib.getExe' coreutils "rm";
mktemp = if nativeTools then "mktemp" else lib.getExe' coreutils "mktemp";
# stdenv.cc.cc should not be null and we have nothing better for now.
# if the native impure bootstrap is gotten rid of this can become `inherit cc;` again.
cc = optionalString (!nativeTools) cc;