authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-17 10:18:54+01:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-08-17 18:50:10-04:00
logd63d9b99185c080c6ed7a6be3dc43c897f2aeadc
tree26230f76729b652fce6d4e19c3bcfbb206ee2428
parent04b13547e13e3410b911fdbb06cbb27b5051cfbf

compiler: use incremental cache mode with -fincremental

This results in correct reporting to the build system of file system inputs with `-fincremental --watch` on a `fno-emit-bin` build.

1 files changed, 3 insertions(+), 2 deletions(-)

src/main.zig+3-2
...@@ -3257,9 +3257,12 @@ fn buildOutputType(...@@ -3257,9 +3257,12 @@ fn buildOutputType(
3257 else => false,3257 else => false,
3258 };3258 };
32593259
3260 const incremental = opt_incremental orelse false;
3261
3260 const disable_lld_caching = !output_to_cache;3262 const disable_lld_caching = !output_to_cache;
32613263
3262 const cache_mode: Compilation.CacheMode = b: {3264 const cache_mode: Compilation.CacheMode = b: {
3265 if (incremental) break :b .incremental;
3263 if (disable_lld_caching) break :b .incremental;3266 if (disable_lld_caching) break :b .incremental;
3264 if (!create_module.resolved_options.have_zcu) break :b .whole;3267 if (!create_module.resolved_options.have_zcu) break :b .whole;
32653268
...@@ -3272,8 +3275,6 @@ fn buildOutputType(...@@ -3272,8 +3275,6 @@ fn buildOutputType(
3272 break :b .incremental;3275 break :b .incremental;
3273 };3276 };
32743277
3275 const incremental = opt_incremental orelse false;
3276
3277 process.raiseFileDescriptorLimit();3278 process.raiseFileDescriptorLimit();
32783279
3279 var file_system_inputs: std.ArrayListUnmanaged(u8) = .{};3280 var file_system_inputs: std.ArrayListUnmanaged(u8) = .{};