authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 13:54:20-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:36-07:00
logbd1b47733bc7565187d4a7c806afec03401bbf25
treef05a7476f335912ed62a92972136e2aae0cc5b4c
parent1aa65d094ec737a140d7ab60e1b2af62144edd6a

zig build: remove --build-runner CLI parameter

There is no concept of a "build runner" any more; it has been split in two: configurer and maker. Users of this feature will likely want to no longer override any logic, and instead consume the configuration file produced by configurer. If overriding one or the other of these is desired, the feature will need to be re-introduced (as --override-maker or --override-configurer).

3 files changed, 1 insertions(+), 12 deletions(-)

lib/compiler/Maker/ScannedConfig.zig-1
...@@ -342,7 +342,6 @@ pub fn printUsage(sc: *const ScannedConfig, graph: *Graph, w: *Writer) !void {...@@ -342,7 +342,6 @@ pub fn printUsage(sc: *const ScannedConfig, graph: *Graph, w: *Writer) !void {
342 \\ --cache-dir [path] Override path to local Zig cache directory342 \\ --cache-dir [path] Override path to local Zig cache directory
343 \\ --global-cache-dir [path] Override path to global Zig cache directory343 \\ --global-cache-dir [path] Override path to global Zig cache directory
344 \\ --zig-lib-dir [arg] Override path to Zig lib directory344 \\ --zig-lib-dir [arg] Override path to Zig lib directory
345 \\ --build-runner [file] Override path to build runner
346 \\ --seed [integer] For shuffling dependency traversal order (default: random)345 \\ --seed [integer] For shuffling dependency traversal order (default: random)
347 \\ --cache-poison[=mode] Override configuration caching behavior346 \\ --cache-poison[=mode] Override configuration caching behavior
348 \\ pure (default) Avoid false positive cache hits347 \\ pure (default) Avoid false positive cache hits
lib/std/zig.zig-1
...@@ -756,7 +756,6 @@ pub const EnvVar = enum {...@@ -756,7 +756,6 @@ pub const EnvVar = enum {
756 ZIG_LOCAL_PKG_DIR,756 ZIG_LOCAL_PKG_DIR,
757 ZIG_LIB_DIR,757 ZIG_LIB_DIR,
758 ZIG_LIBC,758 ZIG_LIBC,
759 ZIG_BUILD_RUNNER,
760 ZIG_BUILD_ERROR_STYLE,759 ZIG_BUILD_ERROR_STYLE,
761 ZIG_BUILD_MULTILINE_ERRORS,760 ZIG_BUILD_MULTILINE_ERRORS,
762 ZIG_VERBOSE_LINK,761 ZIG_VERBOSE_LINK,
src/main.zig+1-10
...@@ -4944,7 +4944,6 @@ fn cmdBuild(...@@ -4944,7 +4944,6 @@ fn cmdBuild(
4944 var override_global_cache_dir: ?[]const u8 = EnvVar.ZIG_GLOBAL_CACHE_DIR.get(environ_map);4944 var override_global_cache_dir: ?[]const u8 = EnvVar.ZIG_GLOBAL_CACHE_DIR.get(environ_map);
4945 var override_local_cache_dir: ?[]const u8 = EnvVar.ZIG_LOCAL_CACHE_DIR.get(environ_map);4945 var override_local_cache_dir: ?[]const u8 = EnvVar.ZIG_LOCAL_CACHE_DIR.get(environ_map);
4946 var override_pkg_dir: ?[]const u8 = EnvVar.ZIG_LOCAL_PKG_DIR.get(environ_map);4946 var override_pkg_dir: ?[]const u8 = EnvVar.ZIG_LOCAL_PKG_DIR.get(environ_map);
4947 var override_make_runner: ?[]const u8 = EnvVar.ZIG_BUILD_RUNNER.get(environ_map);
4948 var maker_optimize_mode: std.builtin.OptimizeMode = if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map))4947 var maker_optimize_mode: std.builtin.OptimizeMode = if (EnvVar.ZIG_DEBUG_CMD.isSet(environ_map))
4949 .Debug4948 .Debug
4950 else4949 else
...@@ -5074,11 +5073,6 @@ fn cmdBuild(...@@ -5074,11 +5073,6 @@ fn cmdBuild(
5074 i += 1;5073 i += 1;
5075 override_lib_dir = args[i];5074 override_lib_dir = args[i];
5076 continue;5075 continue;
5077 } else if (mem.eql(u8, arg, "--build-runner")) {
5078 if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg});
5079 i += 1;
5080 override_make_runner = args[i];
5081 continue;
5082 } else if (mem.eql(u8, arg, "--cache-dir")) {5076 } else if (mem.eql(u8, arg, "--cache-dir")) {
5083 if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg});5077 if (i + 1 >= args.len) fatal("expected argument after '{s}'", .{arg});
5084 i += 1;5078 i += 1;
...@@ -5365,10 +5359,7 @@ fn cmdBuild(...@@ -5365,10 +5359,7 @@ fn cmdBuild(
5365 // We want to release all the locks before executing the child process, so we make a nice5359 // We want to release all the locks before executing the child process, so we make a nice
5366 // big block here to ensure the cleanup gets run when we extract out our argv.5360 // big block here to ensure the cleanup gets run when we extract out our argv.
5367 {5361 {
5368 const main_mod_paths: Package.Module.CreateOptions.Paths = if (override_make_runner) |runner| .{5362 const main_mod_paths: Package.Module.CreateOptions.Paths = .{
5369 .root = try .fromUnresolved(arena, dirs, &.{fs.path.dirname(runner) orelse "."}),
5370 .root_src_path = fs.path.basename(runner),
5371 } else .{
5372 .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"),5363 .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"),
5373 .root_src_path = "configurer.zig",5364 .root_src_path = "configurer.zig",
5374 };5365 };