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