From d63d9b99185c080c6ed7a6be3dc43c897f2aeadc Mon Sep 17 00:00:00 2001 From: mlugg Date: Sat, 17 Aug 2024 10:18:54 +0100 Subject: [PATCH] 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. --- src/main.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index 62c721f1575a585b7a69272693ac03fe444c4b54..3429500bf8157624e2acf30a460f2858559c4b13 100644 --- a/src/main.zig +++ b/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) = .{}; -- 2.54.0