From f0354179a88d9c8274e571dc1e62a29e9c58376b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 4 Aug 2026 10:54:14 -0700 Subject: [PATCH] fetch: remove --global-cache-dir argument This must be set with an env var now, just like `zig build` because by the time we make it to the child process it is too late, the global cache directory has already been observed. closes #36144 --- lib/compiler/Maker.zig | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/compiler/Maker.zig b/lib/compiler/Maker.zig index ade19eeb33a672846fb80709ff26089cbb883fac..2339de5ff1e3612029d7be22480e212e0592f998 100644 --- a/lib/compiler/Maker.zig +++ b/lib/compiler/Maker.zig @@ -1439,7 +1439,6 @@ fn cmdFetch(gpa: Allocator, graph: *Graph, args: []const []const u8) !void { const color: Color = Color.settingFromEnvironment(environ_map); var opt_path_or_url: ?[]const u8 = null; - var override_global_cache_dir: ?[]const u8 = EnvVar.ZIG_GLOBAL_CACHE_DIR.get(environ_map); var override_local_cache_dir: ?[]const u8 = EnvVar.ZIG_LOCAL_CACHE_DIR.get(environ_map); var override_pkg_dir: ?[]const u8 = EnvVar.ZIG_LOCAL_PKG_DIR.get(environ_map); var debug_hash: bool = false; @@ -1455,8 +1454,6 @@ fn cmdFetch(gpa: Allocator, graph: *Graph, args: []const []const u8) !void { if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) { try Io.File.stdout().writeStreamingAll(io, usage_fetch); return process.cleanExit(io); - } else if (mem.eql(u8, arg, "--global-cache-dir")) { - override_global_cache_dir = nextArgOrFatal(args, &arg_i); } else if (mem.eql(u8, arg, "--cache-dir")) { override_local_cache_dir = nextArgOrFatal(args, &arg_i); } else if (mem.eql(u8, arg, "--pkg-dir")) { @@ -1736,7 +1733,6 @@ const usage_fetch = \\ \\Options: \\ -h, --help Print this help and exit - \\ --global-cache-dir [path] Override path to global Zig cache directory \\ --cache-dir [path] Override path to local cache directory \\ --pkg-dir [path] Override path to local package directory \\ --debug-hash Print verbose hash information to stdout -- 2.54.0