Commit d63d9b9918

mlugg <mlugg@mlugg.co.uk>
2024-08-17 11:18:54
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 parent 04b1354
Changed files (1)
src/main.zig
@@ -3257,9 +3257,12 @@ fn buildOutputType(
         else => false,
     };
 
+    const incremental = opt_incremental orelse false;
+
     const disable_lld_caching = !output_to_cache;
 
     const cache_mode: Compilation.CacheMode = b: {
+        if (incremental) break :b .incremental;
         if (disable_lld_caching) break :b .incremental;
         if (!create_module.resolved_options.have_zcu) break :b .whole;
 
@@ -3272,8 +3275,6 @@ fn buildOutputType(
         break :b .incremental;
     };
 
-    const incremental = opt_incremental orelse false;
-
     process.raiseFileDescriptorLimit();
 
     var file_system_inputs: std.ArrayListUnmanaged(u8) = .{};