mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Use the global cache dir for the manifests of generated mingw .libs
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.
This commit is contained in:
parent
90c1a2c41a
commit
469643940c
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user