mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
std.Build.Step.Run: account for new environment variable
Introduces `disable_zig_progress` which prevents the build runner from assigning the child process a progress node. This is needed for the empty_env test which requires the environment to be completely empty.
This commit is contained in:
parent
0937992a14
commit
a5e4fe5487
@ -23,6 +23,11 @@ cwd: ?Build.LazyPath,
|
|||||||
/// Override this field to modify the environment, or use setEnvironmentVariable
|
/// Override this field to modify the environment, or use setEnvironmentVariable
|
||||||
env_map: ?*EnvMap,
|
env_map: ?*EnvMap,
|
||||||
|
|
||||||
|
/// When `true` prevents `ZIG_PROGRESS` environment variable from being passed
|
||||||
|
/// to the child process, which otherwise would be used for the child to send
|
||||||
|
/// progress updates to the parent.
|
||||||
|
disable_zig_progress: bool,
|
||||||
|
|
||||||
/// Configures whether the Run step is considered to have side-effects, and also
|
/// Configures whether the Run step is considered to have side-effects, and also
|
||||||
/// whether the Run step will inherit stdio streams, forwarding them to the
|
/// whether the Run step will inherit stdio streams, forwarding them to the
|
||||||
/// parent process, in which case will require a global lock to prevent other
|
/// parent process, in which case will require a global lock to prevent other
|
||||||
@ -152,6 +157,7 @@ pub fn create(owner: *std.Build, name: []const u8) *Run {
|
|||||||
.argv = .{},
|
.argv = .{},
|
||||||
.cwd = null,
|
.cwd = null,
|
||||||
.env_map = null,
|
.env_map = null,
|
||||||
|
.disable_zig_progress = false,
|
||||||
.stdio = .infer_from_args,
|
.stdio = .infer_from_args,
|
||||||
.stdin = .none,
|
.stdin = .none,
|
||||||
.extra_file_dependencies = &.{},
|
.extra_file_dependencies = &.{},
|
||||||
@ -1235,7 +1241,7 @@ fn spawnChildAndCollect(
|
|||||||
child.stdin_behavior = .Pipe;
|
child.stdin_behavior = .Pipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (run.stdio != .zig_test) {
|
if (run.stdio != .zig_test and !run.disable_zig_progress) {
|
||||||
child.progress_node = prog_node;
|
child.progress_node = prog_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
|
|
||||||
const run = b.addRunArtifact(main);
|
const run = b.addRunArtifact(main);
|
||||||
run.clearEnvironment();
|
run.clearEnvironment();
|
||||||
|
run.disable_zig_progress = true;
|
||||||
|
|
||||||
test_step.dependOn(&run.step);
|
test_step.dependOn(&run.step);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user