From abf895595189eb45df8c97f4029c58976815b450 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 14 Jul 2024 19:48:08 -0700 Subject: make zig compiler processes live across rebuilds Changes the `make` function signature to take an options struct, which additionally includes `watch: bool`. I intentionally am not exposing this information to configure phase logic. Also adds global zig cache to the compiler cache prefixes. Closes #20600 --- src/Compilation.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index a785351df5..83a7501ffa 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1363,6 +1363,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil cache.addPrefix(.{ .path = null, .handle = std.fs.cwd() }); cache.addPrefix(options.zig_lib_directory); cache.addPrefix(options.local_cache_directory); + cache.addPrefix(options.global_cache_directory); errdefer cache.manifest_dir.close(); // This is shared hasher state common to zig source and all C source files. @@ -2358,7 +2359,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { } } -fn appendFileSystemInput( +pub fn appendFileSystemInput( comp: *Compilation, file_system_inputs: *std.ArrayListUnmanaged(u8), root: Cache.Path, -- cgit v1.2.3