| ... | ... | @@ -266,12 +266,16 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 266 | 266 | |
| 267 | 267 | if (try man.hit()) { |
| 268 | 268 | const digest = man.final(); |
| 269 | const sub_path = try std.fs.path.join(gpa, &.{ "o", &digest, final_lib_basename }); |
| 270 | errdefer gpa.free(sub_path); |
| 269 | 271 | |
| 272 | comp.mutex.lock(); |
| 273 | defer comp.mutex.unlock(); |
| 270 | 274 | try comp.crt_files.ensureUnusedCapacity(gpa, 1); |
| 271 | 275 | comp.crt_files.putAssumeCapacityNoClobber(final_lib_basename, .{ |
| 272 | 276 | .full_object_path = .{ |
| 273 | 277 | .root_dir = comp.global_cache_directory, |
| 274 | | .sub_path = try std.fs.path.join(gpa, &.{ "o", &digest, final_lib_basename }), |
| 278 | .sub_path = sub_path, |
| 275 | 279 | }, |
| 276 | 280 | .lock = man.toOwnedLock(), |
| 277 | 281 | }); |
| ... | ... | @@ -360,6 +364,8 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void { |
| 360 | 364 | log.warn("failed to write cache manifest for DLL import {s}.lib: {s}", .{ lib_name, @errorName(err) }); |
| 361 | 365 | }; |
| 362 | 366 | |
| 367 | comp.mutex.lock(); |
| 368 | defer comp.mutex.unlock(); |
| 363 | 369 | try comp.crt_files.putNoClobber(gpa, final_lib_basename, .{ |
| 364 | 370 | .full_object_path = .{ |
| 365 | 371 | .root_dir = comp.global_cache_directory, |