aboutsummaryrefslogtreecommitdiff
path: root/lib/libcxx/src/thread.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-10 16:17:02 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-10 16:17:02 -0700
commitf7d600675c548b4e45b24f8e10ebdd892a6b8dba (patch)
treebc2a7e0edb42edb304c5dc47f6206d1a78c245d6 /lib/libcxx/src/thread.cpp
parent26399b5249cbc8774e50856fed6d2336e396cb69 (diff)
downloadzig-f7d600675c548b4e45b24f8e10ebdd892a6b8dba.tar.gz
zig-f7d600675c548b4e45b24f8e10ebdd892a6b8dba.zip
CLI: improved local cache directory logic
Previously, when choosing the local cache directory, if there was no root source file, an explicitly chosen path, or other clues, zig would choose cwd + zig-cache/ as the local cache directory. This can be problematic if Zig is invoked with the CWD set to a read-only directory, or a directory unrelated to the actual source files being compiled. In the real world, we see this when using `zig cc` with CGo, which for some reason changes the current working directory to the read-only go standard library path before running the C compiler. This commit conservatively chooses to use the global cache directory as the local cache directory when there is no other reasonable choice, and no longer will rely on the cwd path to choose a local cache directory. As a reminder, the --cache-dir CLI flag and ZIG_LOCAL_CACHE_DIR environment variable are available for overriding the decision. For the zig build system, it will always choose the directory that build.zig is + zig-cache/. Closes #7342
Diffstat (limited to 'lib/libcxx/src/thread.cpp')
0 files changed, 0 insertions, 0 deletions