From 536a810b98678b774544e86d43380b3f5c511209 Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Mon, 27 May 2024 07:47:06 -0600 Subject: [PATCH] Update to Zig master --- build.zig | 6 ++---- build/test_runner.zig | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build.zig b/build.zig index 7a6fb51..e9b8e4f 100644 --- a/build.zig +++ b/build.zig @@ -6,7 +6,7 @@ const os = builtin.os.tag; fn discover_brew_prefix(b: *std.Build, library_name: []const u8) ![]const u8 { assert(os == .macos); - const result = try std.ChildProcess.run(.{ + const result = try std.process.Child.run(.{ .allocator = b.allocator, .argv = &.{ "brew", "--prefix", library_name }, }); @@ -47,7 +47,6 @@ pub fn build(b: *std.Build) !void { .root_source_file = b.path("build/fetcher.zig"), .target = native_target, .optimize = .Debug, - .single_threaded = true, }); var target_query = b.standardTargetOptionsQueryOnly(switch (@import("builtin").os.tag) { @@ -452,7 +451,7 @@ pub fn build(b: *std.Build) !void { compiler.addLibraryPath(.{ .cwd_relative = "/lib/x86_64-linux-gnu" }); compiler.addLibraryPath(.{ .cwd_relative = "/usr/lib/llvm-18/lib" }); } else { - const result = try std.ChildProcess.run(.{ + const result = try std.process.Child.run(.{ .allocator = b.allocator, .argv = &.{ "c++", "--version", @@ -592,7 +591,6 @@ pub fn build(b: *std.Build) !void { .root_source_file = b.path("build/test_runner.zig"), .target = native_target, .optimize = optimization, - .single_threaded = true, }); b.default_step.dependOn(&test_runner.step); diff --git a/build/test_runner.zig b/build/test_runner.zig index 734fa3f..84a6bf0 100644 --- a/build/test_runner.zig +++ b/build/test_runner.zig @@ -57,7 +57,7 @@ fn runStandalone(allocator: Allocator, args: struct { const source_file_path = try std.mem.concat(allocator, u8, &.{ args.directory_path, "/", test_name, "/main.nat" }); const argv: []const []const u8 = &.{ args.compiler_path, if (args.is_test) "test" else "exe", "-main_source_file", source_file_path }; // if (std.mem.eql(u8, args.compiler_path, "nat/compiler_lightly_optimize_for_speed")) @breakpoint(); - const compile_run = try std.ChildProcess.run(.{ + const compile_run = try std.process.Child.run(.{ .allocator = allocator, // TODO: delete -main_source_file? .argv = argv, @@ -87,7 +87,7 @@ fn runStandalone(allocator: Allocator, args: struct { if (compilation_success and !args.self_hosted) { const test_path = try std.mem.concat(allocator, u8, &.{ "nat/", test_name }); - const test_run = try std.ChildProcess.run(.{ + const test_run = try std.process.Child.run(.{ .allocator = allocator, .argv = &.{test_path}, .max_output_bytes = std.math.maxInt(u64),