zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit d63d9b99185c080c6ed7a6be3dc43c897f2aeadc (tree)
parent 04b13547e13e3410b911fdbb06cbb27b5051cfbf
Author: mlugg <mlugg@mlugg.co.uk>
Date:   Sat, 17 Aug 2024 10:18:54 +0100

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.

Diffstat:
Msrc/main.zig | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 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) = .{};