Skip to content

std: restructure child process namespace #20049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 104 additions & 104 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,100 +193,6 @@ set(ZIG_CPP_SOURCES
# Needed because we use cmake, not the zig build system, to build zig2.o.
set(ZIG_STAGE2_SOURCES
"${ZIG_CONFIG_ZIG_OUT}"
lib/std/array_hash_map.zig
lib/std/array_list.zig
lib/std/ascii.zig
lib/std/atomic.zig
lib/std/base64.zig
lib/std/BitStack.zig
lib/std/buf_map.zig
lib/std/Build.zig
lib/std/Build/Cache.zig
lib/std/Build/Cache/DepTokenizer.zig
lib/std/builtin.zig
lib/std/c.zig
lib/std/c/linux.zig
lib/std/child_process.zig
lib/std/coff.zig
lib/std/static_string_map.zig
lib/std/crypto.zig
lib/std/crypto/blake3.zig
lib/std/crypto/siphash.zig
lib/std/debug.zig
lib/std/dwarf.zig
lib/std/dwarf/AT.zig
lib/std/dwarf/ATE.zig
lib/std/dwarf/FORM.zig
lib/std/dwarf/LANG.zig
lib/std/dwarf/OP.zig
lib/std/dwarf/TAG.zig
lib/std/elf.zig
lib/std/fifo.zig
lib/std/fmt.zig
lib/std/fmt/format_float.zig
lib/std/fmt/parse_float.zig
lib/std/fs.zig
lib/std/fs/AtomicFile.zig
lib/std/fs/Dir.zig
lib/std/fs/File.zig
lib/std/fs/get_app_data_dir.zig
lib/std/fs/path.zig
lib/std/hash.zig
lib/std/hash/auto_hash.zig
lib/std/hash/wyhash.zig
lib/std/hash_map.zig
lib/std/heap.zig
lib/std/heap/arena_allocator.zig
lib/std/io.zig
lib/std/io/buffered_atomic_file.zig
lib/std/io/buffered_writer.zig
lib/std/io/change_detection_stream.zig
lib/std/io/counting_reader.zig
lib/std/io/counting_writer.zig
lib/std/io/find_byte_writer.zig
lib/std/io/fixed_buffer_stream.zig
lib/std/io/limited_reader.zig
lib/std/io/Reader.zig
lib/std/io/seekable_stream.zig
lib/std/io/Writer.zig
lib/std/json.zig
lib/std/json/stringify.zig
lib/std/leb128.zig
lib/std/linked_list.zig
lib/std/log.zig
lib/std/macho.zig
lib/std/math.zig
lib/std/math/big.zig
lib/std/math/big/int.zig
lib/std/math/float.zig
lib/std/math/frexp.zig
lib/std/math/isinf.zig
lib/std/math/isnan.zig
lib/std/math/log.zig
lib/std/math/log10.zig
lib/std/math/log2.zig
lib/std/math/signbit.zig
lib/std/math/sqrt.zig
lib/std/mem.zig
lib/std/mem/Allocator.zig
lib/std/meta.zig
lib/std/meta/trailer_flags.zig
lib/std/multi_array_list.zig
lib/std/os.zig
lib/std/os/linux.zig
lib/std/os/linux/x86_64.zig
lib/std/os/linux.zig
lib/std/os/linux/IoUring.zig
lib/std/os/linux/io_uring_sqe.zig
lib/std/os/linux/x86_64.zig
lib/std/os/windows.zig
lib/std/os/windows/ntstatus.zig
lib/std/os/windows/win32error.zig
lib/std/Progress.zig
lib/std/pdb.zig
lib/std/process.zig
lib/std/Random.zig
lib/std/sort.zig
lib/compiler_rt.zig
lib/compiler_rt/absv.zig
lib/compiler_rt/absvdi2.zig
Expand Down Expand Up @@ -363,7 +269,7 @@ set(ZIG_STAGE2_SOURCES
lib/compiler_rt/fixxfdi.zig
lib/compiler_rt/fixxfsi.zig
lib/compiler_rt/fixxfti.zig
lib/compiler_rt/int_from_float.zig
lib/compiler_rt/float_from_int.zig
lib/compiler_rt/floatdidf.zig
lib/compiler_rt/floatdihf.zig
lib/compiler_rt/floatdisf.zig
Expand Down Expand Up @@ -404,7 +310,7 @@ set(ZIG_STAGE2_SOURCES
lib/compiler_rt/getf2.zig
lib/compiler_rt/gexf2.zig
lib/compiler_rt/int.zig
lib/compiler_rt/float_from_int.zig
lib/compiler_rt/int_from_float.zig
lib/compiler_rt/log.zig
lib/compiler_rt/log10.zig
lib/compiler_rt/log2.zig
Expand All @@ -417,7 +323,11 @@ set(ZIG_STAGE2_SOURCES
lib/compiler_rt/multf3.zig
lib/compiler_rt/mulxf3.zig
lib/compiler_rt/negXi2.zig
lib/compiler_rt/negdf2.zig
lib/compiler_rt/negsf2.zig
lib/compiler_rt/negtf2.zig
lib/compiler_rt/negv.zig
lib/compiler_rt/negxf2.zig
lib/compiler_rt/os_version_check.zig
lib/compiler_rt/parity.zig
lib/compiler_rt/popcount.zig
Expand All @@ -430,15 +340,11 @@ set(ZIG_STAGE2_SOURCES
lib/compiler_rt/sincos.zig
lib/compiler_rt/sqrt.zig
lib/compiler_rt/stack_probe.zig
lib/compiler_rt/subdf3.zig
lib/compiler_rt/subo.zig
lib/compiler_rt/subsf3.zig
lib/compiler_rt/subdf3.zig
lib/compiler_rt/subtf3.zig
lib/compiler_rt/subxf3.zig
lib/compiler_rt/negsf2.zig
lib/compiler_rt/negdf2.zig
lib/compiler_rt/negtf2.zig
lib/compiler_rt/negxf2.zig
lib/compiler_rt/tan.zig
lib/compiler_rt/trig.zig
lib/compiler_rt/trunc.zig
Expand All @@ -461,8 +367,12 @@ set(ZIG_STAGE2_SOURCES
lib/compiler_rt/unorddf2.zig
lib/compiler_rt/unordsf2.zig
lib/compiler_rt/unordtf2.zig
lib/std/start.zig
lib/std/std.zig
lib/std/BitStack.zig
lib/std/Build.zig
lib/std/Build/Cache.zig
lib/std/Build/Cache/DepTokenizer.zig
lib/std/Progress.zig
lib/std/Random.zig
lib/std/Target.zig
lib/std/Target/Query.zig
lib/std/Target/aarch64.zig
Expand All @@ -476,8 +386,8 @@ set(ZIG_STAGE2_SOURCES
lib/std/Target/nvptx.zig
lib/std/Target/powerpc.zig
lib/std/Target/riscv.zig
lib/std/Target/sparc.zig
lib/std/Target/s390x.zig
lib/std/Target/sparc.zig
lib/std/Target/wasm.zig
lib/std/Target/x86.zig
lib/std/Thread.zig
Expand All @@ -486,6 +396,96 @@ set(ZIG_STAGE2_SOURCES
lib/std/Thread/Pool.zig
lib/std/Thread/ResetEvent.zig
lib/std/Thread/WaitGroup.zig
lib/std/array_hash_map.zig
lib/std/array_list.zig
lib/std/ascii.zig
lib/std/atomic.zig
lib/std/base64.zig
lib/std/buf_map.zig
lib/std/builtin.zig
lib/std/c.zig
lib/std/c/linux.zig
lib/std/coff.zig
lib/std/crypto.zig
lib/std/crypto/blake3.zig
lib/std/crypto/siphash.zig
lib/std/debug.zig
lib/std/dwarf.zig
lib/std/dwarf/AT.zig
lib/std/dwarf/ATE.zig
lib/std/dwarf/FORM.zig
lib/std/dwarf/LANG.zig
lib/std/dwarf/OP.zig
lib/std/dwarf/TAG.zig
lib/std/elf.zig
lib/std/fifo.zig
lib/std/fmt.zig
lib/std/fmt/format_float.zig
lib/std/fmt/parse_float.zig
lib/std/fs.zig
lib/std/fs/AtomicFile.zig
lib/std/fs/Dir.zig
lib/std/fs/File.zig
lib/std/fs/get_app_data_dir.zig
lib/std/fs/path.zig
lib/std/hash.zig
lib/std/hash/auto_hash.zig
lib/std/hash/wyhash.zig
lib/std/hash_map.zig
lib/std/heap.zig
lib/std/heap/arena_allocator.zig
lib/std/io.zig
lib/std/io/Reader.zig
lib/std/io/Writer.zig
lib/std/io/buffered_atomic_file.zig
lib/std/io/buffered_writer.zig
lib/std/io/change_detection_stream.zig
lib/std/io/counting_reader.zig
lib/std/io/counting_writer.zig
lib/std/io/find_byte_writer.zig
lib/std/io/fixed_buffer_stream.zig
lib/std/io/limited_reader.zig
lib/std/io/seekable_stream.zig
lib/std/json.zig
lib/std/json/stringify.zig
lib/std/leb128.zig
lib/std/linked_list.zig
lib/std/log.zig
lib/std/macho.zig
lib/std/math.zig
lib/std/math/big.zig
lib/std/math/big/int.zig
lib/std/math/float.zig
lib/std/math/frexp.zig
lib/std/math/isinf.zig
lib/std/math/isnan.zig
lib/std/math/log.zig
lib/std/math/log10.zig
lib/std/math/log2.zig
lib/std/math/signbit.zig
lib/std/math/sqrt.zig
lib/std/mem.zig
lib/std/mem/Allocator.zig
lib/std/meta.zig
lib/std/meta/trailer_flags.zig
lib/std/multi_array_list.zig
lib/std/os.zig
lib/std/os/linux.zig
lib/std/os/linux.zig
lib/std/os/linux/IoUring.zig
lib/std/os/linux/io_uring_sqe.zig
lib/std/os/linux/x86_64.zig
lib/std/os/linux/x86_64.zig
lib/std/os/windows.zig
lib/std/os/windows/ntstatus.zig
lib/std/os/windows/win32error.zig
lib/std/pdb.zig
lib/std/process.zig
lib/std/process/Child.zig
lib/std/sort.zig
lib/std/start.zig
lib/std/static_string_map.zig
lib/std/std.zig
lib/std/time.zig
lib/std/treap.zig
lib/std/unicode.zig
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/aro/aro/Driver.zig
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ pub fn invokeLinker(d: *Driver, tc: *Toolchain, comptime fast_exit: bool) !void
return d.fatal("unable to dump linker args: {s}", .{errorDescription(er)});
};
}
var child = std.ChildProcess.init(argv.items, d.comp.gpa);
var child = std.process.Child.init(argv.items, d.comp.gpa);
// TODO handle better
child.stdin_behavior = .Inherit;
child.stdout_behavior = .Inherit;
Expand Down
4 changes: 2 additions & 2 deletions lib/compiler/std-docs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ fn buildWasmBinary(
"--listen=-",
});

var child = std.ChildProcess.init(argv.items, gpa);
var child = std.process.Child.init(argv.items, gpa);
child.stdin_behavior = .Pipe;
child.stdout_behavior = .Pipe;
child.stderr_behavior = .Pipe;
Expand Down Expand Up @@ -437,7 +437,7 @@ fn openBrowserTabThread(gpa: Allocator, url: []const u8) !void {
.macos => "open",
else => "xdg-open",
};
var child = std.ChildProcess.init(&.{ main_exe, url }, gpa);
var child = std.process.Child.init(&.{ main_exe, url }, gpa);
child.stdin_behavior = .Ignore;
child.stdout_behavior = .Ignore;
child.stderr_behavior = .Ignore;
Expand Down
6 changes: 3 additions & 3 deletions lib/std/Build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub const RunError = error{
ExitCodeFailure,
ProcessTerminated,
ExecNotSupported,
} || std.ChildProcess.SpawnError;
} || std.process.Child.SpawnError;

pub const PkgConfigError = error{
PkgConfigCrashed,
Expand Down Expand Up @@ -1719,15 +1719,15 @@ pub fn runAllowFail(
b: *Build,
argv: []const []const u8,
out_code: *u8,
stderr_behavior: std.ChildProcess.StdIo,
stderr_behavior: std.process.Child.StdIo,
) RunError![]u8 {
assert(argv.len != 0);

if (!process.can_spawn)
return error.ExecNotSupported;

const max_output_size = 400 * 1024;
var child = std.ChildProcess.init(argv, b.allocator);
var child = std.process.Child.init(argv, b.allocator);
child.stdin_behavior = .Ignore;
child.stdout_behavior = .Pipe;
child.stderr_behavior = stderr_behavior;
Expand Down
6 changes: 3 additions & 3 deletions lib/std/Build/Step.zig
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ pub fn evalChildProcess(s: *Step, argv: []const []const u8) !void {
try handleChildProcUnsupported(s, null, argv);
try handleVerbose(s.owner, null, argv);

const result = std.ChildProcess.run(.{
const result = std.process.Child.run(.{
.allocator = arena,
.argv = argv,
}) catch |err| return s.fail("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
Expand Down Expand Up @@ -313,7 +313,7 @@ pub fn evalZigProcess(
try handleChildProcUnsupported(s, null, argv);
try handleVerbose(s.owner, null, argv);

var child = std.ChildProcess.init(argv, arena);
var child = std.process.Child.init(argv, arena);
child.env_map = &b.graph.env_map;
child.stdin_behavior = .Pipe;
child.stdout_behavior = .Pipe;
Expand Down Expand Up @@ -480,7 +480,7 @@ pub inline fn handleChildProcUnsupported(

pub fn handleChildProcessTerm(
s: *Step,
term: std.ChildProcess.Term,
term: std.process.Child.Term,
opt_cwd: ?[]const u8,
argv: []const []const u8,
) error{ MakeFailed, OutOfMemory }!void {
Expand Down
Loading