authorgravatar for hb@hash.aihaze <hb@hash.ai> 2020-07-15 22:37:04-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-07-15 22:37:04-04:00
log82562b205f9d99c27c4d5224311734e141bf2fda
tree809850807d9c3ac439f3b5e1a5d652f538198dd0
parent6b103324d2d935260138584877dbe1593790b953
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

On darwin, only add the self exe to the cache hash for compiler id (#5880)

Now that Big Sur does not have system libraries on the filesystem, zig can no longer read them and add them to the cache hash for the compiler id. This changes it so that only the first library path returned by os_self_exe_shared_libs is added to the cache hash under Darwin. I looked into methods on getting the system version to keep parity with older versions, but @fengb reported that this works on Catalina (a version behind Big Sur) Signed-off-by: Haze Booth <isnt@haze.cool>

1 files changed, 8 insertions(+), 0 deletions(-)

src/compiler.cpp+8
......@@ -38,11 +38,19 @@ Error get_compiler_id(Buf **result) {
3838 ZigList<Buf *> lib_paths = {};
3939 if ((err = os_self_exe_shared_libs(lib_paths)))
4040 return err;
41 #if defined(ZIG_OS_DARWIN)
42 // only add the self exe path on mac os
43 Buf *lib_path = lib_paths.at(0);
44 if ((err = cache_add_file(ch, lib_path)))
45 return err;
46 #else
4147 for (size_t i = 0; i < lib_paths.length; i += 1) {
4248 Buf *lib_path = lib_paths.at(i);
4349 if ((err = cache_add_file(ch, lib_path)))
4450 return err;
4551 }
52 #endif
53
4654 if ((err = cache_final(ch, &saved_compiler_id)))
4755 return err;
4856