blob: e720d3f21adb52ba23cd2104606a4ca7a3c152f2 [file] [log] [blame]
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alexander Khabarov <alexander.khabarov@arm.com>
Date: Tue, 24 Oct 2023 12:29:50 +0000
Subject: [PATCH] Use `TEST_TMPDIR` on Unix when it is set
Other directories (`TMPDIR`, `TMP`, `TEMP`, etc) might not be
available, so use Bazel's `TEST_TMPDIR` when it is set.
---
llvm/lib/Support/Unix/Path.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index e2aece49c..52ef00e4d 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -1427,7 +1427,7 @@ bool cache_directory(SmallVectorImpl<char> &result) {
static const char *getEnvTempDir() {
// Check whether the temporary directory is specified by an environment
// variable.
- const char *EnvironmentVariables[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
+ const char *EnvironmentVariables[] = {"TEST_TMPDIR", "TMPDIR", "TMP", "TEMP", "TEMPDIR"};
for (const char *Env : EnvironmentVariables) {
if (const char *Dir = std::getenv(Env))
return Dir;