authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-30 14:49:23-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:35-07:00
log1dc82c13280ae327faf9448dcaf69960f5f5cad4
tree48b9a04f41010713a44966272fa051eadcc6ff33
parent7819e4dea7d1bd75ee1bbb8d76bb8a8ee7672962

configurer: remove Cache


3 files changed, 6 insertions(+), 15 deletions(-)

BRANCH_TODO+6-2
...@@ -1,4 +1,3 @@...@@ -1,4 +1,3 @@
1* remove Cache from configurer
2* implement the build options1* implement the build options
3* finish migrating the rest of the build steps2* finish migrating the rest of the build steps
4* inspect b4ffb402c082605c4b324e88120306fc8fb3cf32 diff and apply changes as needed (merge conflict)3* inspect b4ffb402c082605c4b324e88120306fc8fb3cf32 diff and apply changes as needed (merge conflict)
...@@ -29,7 +28,8 @@...@@ -29,7 +28,8 @@
2928
30## Release Notes29## Release Notes
3130
32run args are all together now, not observable in configure phase whether run args are provided.31In the Run step, passthru args are all together now, not observable in
32configure phase whether run args are provided.
3333
34```zig34```zig
35if (b.args) |args| {35if (b.args) |args| {
...@@ -42,3 +42,7 @@ if (b.args) |args| {...@@ -42,3 +42,7 @@ if (b.args) |args| {
42```zig42```zig
43run_cmd.addPassthruArgs();43run_cmd.addPassthruArgs();
44```44```
45
46This removes a capability from build scripts since they can no longer observe
47those arguments. In exchange, it means that when changing those arguments,
48build scripts need not be rebuilt from source.
lib/compiler/configurer.zig-12
...@@ -73,12 +73,6 @@ pub fn main(init: process.Init.Minimal) !void {...@@ -73,12 +73,6 @@ pub fn main(init: process.Init.Minimal) !void {
73 var graph: std.Build.Graph = .{73 var graph: std.Build.Graph = .{
74 .io = io,74 .io = io,
75 .arena = arena,75 .arena = arena,
76 .cache = .{
77 .io = io,
78 .gpa = arena,
79 .manifest_dir = try local_cache_directory.handle.createDirPathOpen(io, "h", .{}),
80 .cwd = try process.currentPathAlloc(io, arena),
81 },
82 .zig_exe = zig_exe,76 .zig_exe = zig_exe,
83 .environ_map = try init.environ.createMap(arena),77 .environ_map = try init.environ.createMap(arena),
84 .global_cache_root = global_cache_directory,78 .global_cache_root = global_cache_directory,
...@@ -102,12 +96,6 @@ pub fn main(init: process.Init.Minimal) !void {...@@ -102,12 +96,6 @@ pub fn main(init: process.Init.Minimal) !void {
102 assert(try graph.wip_configuration.addString("") == .empty);96 assert(try graph.wip_configuration.addString("") == .empty);
103 assert(try graph.wip_configuration.addString("root") == .root);97 assert(try graph.wip_configuration.addString("root") == .root);
10498
105 graph.cache.addPrefix(.{ .path = null, .handle = cwd });
106 graph.cache.addPrefix(build_root_directory);
107 graph.cache.addPrefix(local_cache_directory);
108 graph.cache.addPrefix(global_cache_directory);
109 graph.cache.hash.addBytes(builtin.zig_version_string);
110
111 const builder = try std.Build.create(99 const builder = try std.Build.create(
112 &graph,100 &graph,
113 build_root_directory,101 build_root_directory,
lib/std/Build.zig-1
...@@ -83,7 +83,6 @@ pub const Graph = struct {...@@ -83,7 +83,6 @@ pub const Graph = struct {
83 arena: Allocator,83 arena: Allocator,
84 system_integration_options: std.StringArrayHashMapUnmanaged(SystemLibraryMode) = .empty,84 system_integration_options: std.StringArrayHashMapUnmanaged(SystemLibraryMode) = .empty,
85 system_package_mode: bool = false,85 system_package_mode: bool = false,
86 cache: Cache,
87 zig_exe: []const u8,86 zig_exe: []const u8,
88 environ_map: process.Environ.Map,87 environ_map: process.Environ.Map,
89 global_cache_root: Cache.Directory,88 global_cache_root: Cache.Directory,