| ... | @@ -3693,13 +3693,15 @@ pub fn cImport(comp: *Compilation, c_src: []const u8) !CImportResult { | ... | @@ -3693,13 +3693,15 @@ pub fn cImport(comp: *Compilation, c_src: []const u8) !CImportResult { |
| 3693 | break :digest digest; | 3693 | break :digest digest; |
| 3694 | } else man.final(); | 3694 | } else man.final(); |
| 3695 | | 3695 | |
| 3696 | // Write the updated manifest. This is a no-op if the manifest is not dirty. Note that it is | 3696 | if (man.have_exclusive_lock) { |
| 3697 | // possible we had a hit and the manifest is dirty, for example if the file mtime changed but | 3697 | // Write the updated manifest. This is a no-op if the manifest is not dirty. Note that it is |
| 3698 | // the contents were the same, we hit the cache but the manifest is dirty and we need to update | 3698 | // possible we had a hit and the manifest is dirty, for example if the file mtime changed but |
| 3699 | // it to prevent doing a full file content comparison the next time around. | 3699 | // the contents were the same, we hit the cache but the manifest is dirty and we need to update |
| 3700 | man.writeManifest() catch |err| { | 3700 | // it to prevent doing a full file content comparison the next time around. |
| 3701 | log.warn("failed to write cache manifest for C import: {s}", .{@errorName(err)}); | 3701 | man.writeManifest() catch |err| { |
| 3702 | }; | 3702 | log.warn("failed to write cache manifest for C import: {s}", .{@errorName(err)}); |
| | 3703 | }; |
| | 3704 | } |
| 3703 | | 3705 | |
| 3704 | const out_zig_path = try comp.local_cache_directory.join(comp.gpa, &[_][]const u8{ | 3706 | const out_zig_path = try comp.local_cache_directory.join(comp.gpa, &[_][]const u8{ |
| 3705 | "o", &digest, cimport_zig_basename, | 3707 | "o", &digest, cimport_zig_basename, |
| ... | @@ -4160,13 +4162,15 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P | ... | @@ -4160,13 +4162,15 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P |
| 4160 | break :blk digest; | 4162 | break :blk digest; |
| 4161 | }; | 4163 | }; |
| 4162 | | 4164 | |
| 4163 | // Write the updated manifest. This is a no-op if the manifest is not dirty. Note that it is | 4165 | if (man.have_exclusive_lock) { |
| 4164 | // possible we had a hit and the manifest is dirty, for example if the file mtime changed but | 4166 | // Write the updated manifest. This is a no-op if the manifest is not dirty. Note that it is |
| 4165 | // the contents were the same, we hit the cache but the manifest is dirty and we need to update | 4167 | // possible we had a hit and the manifest is dirty, for example if the file mtime changed but |
| 4166 | // it to prevent doing a full file content comparison the next time around. | 4168 | // the contents were the same, we hit the cache but the manifest is dirty and we need to update |
| 4167 | man.writeManifest() catch |err| { | 4169 | // it to prevent doing a full file content comparison the next time around. |
| 4168 | log.warn("failed to write cache manifest when compiling '{s}': {s}", .{ c_object.src.src_path, @errorName(err) }); | 4170 | man.writeManifest() catch |err| { |
| 4169 | }; | 4171 | log.warn("failed to write cache manifest when compiling '{s}': {s}", .{ c_object.src.src_path, @errorName(err) }); |
| | 4172 | }; |
| | 4173 | } |
| 4170 | | 4174 | |
| 4171 | const o_basename = try std.fmt.allocPrint(arena, "{s}{s}", .{ o_basename_noext, o_ext }); | 4175 | const o_basename = try std.fmt.allocPrint(arena, "{s}{s}", .{ o_basename_noext, o_ext }); |
| 4172 | | 4176 | |