Merge pull request #199 from birth-software/update-to-master

Update to Zig master
This commit is contained in:
David 2024-05-27 07:51:32 -06:00 committed by GitHub
commit 5cbbebe29a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View File

@ -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);

View File

@ -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),