diff options
| author | Ryan Liptak <squeek502@hotmail.com> | 2024-03-03 19:39:15 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-03-04 05:36:01 -0800 |
| commit | 469643940c9cdce90fbd44e437592dbb608f2443 (patch) | |
| tree | c8e95a8c8fedd578262c938d072d9ac345b2f925 /src | |
| parent | 90c1a2c41aafb1e35e075fb7d0bdcf04c00db913 (diff) | |
| download | zig-469643940c9cdce90fbd44e437592dbb608f2443.tar.gz zig-469643940c9cdce90fbd44e437592dbb608f2443.zip | |
Use the global cache dir for the manifests of generated mingw `.lib`s
Fixes a mismatch where the manifests would be written to the local cache dir, but the .def/.lib files themselves would be written to the global cache dir. This meant that if you cleared your global cache, your local cache would still think that the .lib files existed in the cache and it'd lead to 'No such file or directory' errors at linktime.
This mismatch was introduced in the stage1 -> stage2 transition of this code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mingw.zig | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mingw.zig b/src/mingw.zig index 2efc0fe44c..29a5d02188 100644 --- a/src/mingw.zig +++ b/src/mingw.zig @@ -178,13 +178,15 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { const target = comp.getTarget(); + // Use the global cache directory. var cache: Cache = .{ .gpa = comp.gpa, - .manifest_dir = comp.cache_parent.manifest_dir, + .manifest_dir = try comp.global_cache_directory.handle.makeOpenPath("h", .{}), }; - for (comp.cache_parent.prefixes()) |prefix| { - cache.addPrefix(prefix); - } + cache.addPrefix(.{ .path = null, .handle = std.fs.cwd() }); + cache.addPrefix(comp.zig_lib_directory); + cache.addPrefix(comp.global_cache_directory); + defer cache.manifest_dir.close(); cache.hash.addBytes(build_options.version); cache.hash.addOptionalBytes(comp.zig_lib_directory.path); |
