mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
Add process.Child.Cwd, use it for cwd and remove cwd_dir field
The user must now explicitly choose between inheriting the current CWD, passing a path for the CWD, or passing a Dir for the CWD.
This commit is contained in:
+6
-6
@@ -199,7 +199,7 @@ fn printOutput(
|
||||
if (expected_outcome == .build_fail) {
|
||||
const result = try process.run(arena, io, .{
|
||||
.argv = build_args.items,
|
||||
.cwd = tmp_dir_path,
|
||||
.cwd = .{ .path = tmp_dir_path },
|
||||
.environ_map = environ_map,
|
||||
});
|
||||
switch (result.term) {
|
||||
@@ -255,7 +255,7 @@ fn printOutput(
|
||||
const result = try process.run(arena, io, .{
|
||||
.argv = run_args,
|
||||
.environ_map = environ_map,
|
||||
.cwd = tmp_dir_path,
|
||||
.cwd = .{ .path = tmp_dir_path },
|
||||
});
|
||||
switch (result.term) {
|
||||
.exited => |exit_code| {
|
||||
@@ -373,7 +373,7 @@ fn printOutput(
|
||||
const result = try process.run(arena, io, .{
|
||||
.argv = test_args.items,
|
||||
.environ_map = environ_map,
|
||||
.cwd = tmp_dir_path,
|
||||
.cwd = .{ .path = tmp_dir_path },
|
||||
});
|
||||
switch (result.term) {
|
||||
.exited => |exit_code| {
|
||||
@@ -428,7 +428,7 @@ fn printOutput(
|
||||
const result = try process.run(arena, io, .{
|
||||
.argv = test_args.items,
|
||||
.environ_map = environ_map,
|
||||
.cwd = tmp_dir_path,
|
||||
.cwd = .{ .path = tmp_dir_path },
|
||||
});
|
||||
switch (result.term) {
|
||||
.exited => |exit_code| {
|
||||
@@ -503,7 +503,7 @@ fn printOutput(
|
||||
const result = try process.run(arena, io, .{
|
||||
.argv = build_args.items,
|
||||
.environ_map = environ_map,
|
||||
.cwd = tmp_dir_path,
|
||||
.cwd = .{ .path = tmp_dir_path },
|
||||
});
|
||||
switch (result.term) {
|
||||
.exited => |exit_code| {
|
||||
@@ -1126,7 +1126,7 @@ fn run(
|
||||
const result = try process.run(allocator, io, .{
|
||||
.argv = args,
|
||||
.environ_map = environ_map,
|
||||
.cwd = cwd,
|
||||
.cwd = .{ .path = cwd },
|
||||
});
|
||||
switch (result.term) {
|
||||
.exited => |exit_code| {
|
||||
|
||||
@@ -202,8 +202,7 @@ pub fn main(init: std.process.Init) !void {
|
||||
.stdout = .pipe,
|
||||
.stderr = .pipe,
|
||||
.progress_node = zig_prog_node,
|
||||
.cwd_dir = tmp_dir,
|
||||
.cwd = tmp_dir_path,
|
||||
.cwd = .{ .path = tmp_dir_path },
|
||||
});
|
||||
defer child.kill(io);
|
||||
|
||||
@@ -533,8 +532,7 @@ const Eval = struct {
|
||||
|
||||
const result = std.process.run(eval.arena, io, .{
|
||||
.argv = argv,
|
||||
.cwd_dir = eval.tmp_dir,
|
||||
.cwd = eval.tmp_dir_path,
|
||||
.cwd = .{ .path = eval.tmp_dir_path },
|
||||
}) catch |err| {
|
||||
if (is_foreign) {
|
||||
// Chances are the foreign executor isn't available. Skip this evaluation.
|
||||
@@ -626,8 +624,7 @@ const Eval = struct {
|
||||
|
||||
const result = std.process.run(eval.arena, eval.io, .{
|
||||
.argv = eval.cc_child_args.items,
|
||||
.cwd_dir = eval.tmp_dir,
|
||||
.cwd = eval.tmp_dir_path,
|
||||
.cwd = .{ .path = eval.tmp_dir_path },
|
||||
.progress_node = child_prog_node,
|
||||
}) catch |err| {
|
||||
eval.fatal("failed to spawn zig cc for '{s}': {t}", .{ c_path, err });
|
||||
|
||||
Reference in New Issue
Block a user