From b352b2c61baa12014c10807cc9faf6fa830ba4fd Mon Sep 17 00:00:00 2001 From: "Andrew V. Jones" Date: Tue, 16 Mar 2021 05:36:03 -0700 Subject: [PATCH] Add support for correctly reading the 'TMPDIR' environment variable (#1408) Summary: Infer's [`install-sh`](https://github.com/facebook/infer/blob/master/install-sh) knows to "correctly" read from the `TMPDIR` environment variable: - https://github.com/facebook/infer/blob/master/install-sh#L327 However, this was not supported by `clang/setup.sh`. I haven't overlooked the existence of `CLANG_TMP_DIR`, but I had (initially) set `TMPDIR` hoping Infer's build system would honour it (it didn't) -- consequently, I thought it would be useful for future users if Infer honoured this. Signed-off-by: Andrew V. Jones Pull Request resolved: https://github.com/facebook/infer/pull/1408 Reviewed By: skcho Differential Revision: D27079207 Pulled By: jvillard fbshipit-source-id: d4d4e9374 --- facebook-clang-plugins/clang/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facebook-clang-plugins/clang/setup.sh b/facebook-clang-plugins/clang/setup.sh index a7c695802..6573f1927 100755 --- a/facebook-clang-plugins/clang/setup.sh +++ b/facebook-clang-plugins/clang/setup.sh @@ -222,7 +222,7 @@ popd if [ -n "$CLANG_TMP_DIR" ]; then TMP=$CLANG_TMP_DIR else - TMP=`mktemp -d /tmp/clang-setup.XXXXXX` + TMP=`mktemp -d ${TMPDIR-/tmp}/clang-setup.XXXXXX` fi pushd "$TMP"