From 13a4690d0d9f140eeb2d253184b5271d3010469e Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 2 Oct 2023 15:08:04 +0200 Subject: [PATCH] cc-wrapper: Use MacOS compatible mktemp command The commit 6f2b3ba027f0d74614ba1b21f15ea45b0beb0385 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 . --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index 6c43f8cbfa6d..b8d170df01b7 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -246,7 +246,7 @@ 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 cc-params.XXXXXX) + responseFile=$(mktemp "${TMPDIR:-/tmp}/cc-params.XXXXXX") trap 'rm -f -- "$responseFile"' EXIT printf "%q\n" \ ${extraBefore+"${extraBefore[@]}"} \