cc-wrapper: Use MacOS compatible mktemp command

The commit 6f2b3ba027 introduced a
`mktemp` invokation that uses the `--tmpdir` flag, which is not
available on MacOS.

This changes the invokation to a portable one based on the following
StackOverflow answer https://stackoverflow.com/a/31397073/841562 .
This commit is contained in:
Andreas Herrmann 2023-10-02 15:08:04 +02:00
parent 96a8a16dac
commit 13a4690d0d

View file

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