Skip to content

Commit

Permalink
Use the global cache dir for the manifests of generated mingw .libs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
squeek502 committed Mar 4, 2024
1 parent 147beec commit fc0a5f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mingw.zig
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ 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);
Expand Down

0 comments on commit fc0a5f5

Please sign in to comment.