Skip to content

Commit 1559b03

Browse files
Merge pull request #26 from lightpanda-io/zig0.13
upgrade to zig 0.13
2 parents cd33e26 + f9d3167 commit 1559b03

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/zig-out/
77
/vendor
88
/libc_v8.a
9+
/.zig-cache/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This dockerfile is used to build v8.
2-
ARG ZIG_DOCKER_VERSION=0.12.1
2+
ARG ZIG_DOCKER_VERSION=0.13.0
33
FROM ghcr.io/lightpanda-io/zig:${ZIG_DOCKER_VERSION} as build
44

55
ARG OS=linux

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Static libs are built and released with [Github Actions](https://github.com/fuba
2424
\* Time is measured on standard Github instances.
2525

2626
## System Requirements
27-
- Zig compiler (0.12.1). You can get that [here](https://ziglang.org/download/).
27+
- Zig compiler (0.13.0). You can get that [here](https://ziglang.org/download/).
2828
- Python 3 (2.7 seems to work as well)
2929
- For native macOS builds:
3030
- XCode (You won't need this when using zig's c++ toolchain!)<br/>

build.zig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ const MakePathStep = struct {
439439
return new;
440440
}
441441

442-
fn make(step: *Step, prog_node: *std.Progress.Node) anyerror!void {
442+
fn make(step: *Step, prog_node: std.Progress.Node) anyerror!void {
443443
_ = prog_node;
444444
const self: *Self = @fieldParentPtr("step", step);
445445
try std.fs.cwd().makePath(self.b.pathFromRoot(self.path));
@@ -470,7 +470,7 @@ const CopyFileStep = struct {
470470
return new;
471471
}
472472

473-
fn make(step: *Step, prog_node: *std.Progress.Node) anyerror!void {
473+
fn make(step: *Step, prog_node: std.Progress.Node) anyerror!void {
474474
_ = prog_node;
475475
const self: *Self = @fieldParentPtr("step", step);
476476
try std.fs.copyFileAbsolute(self.src_path, self.dst_path, .{});
@@ -489,7 +489,7 @@ fn linkV8(b: *std.Build, step: *std.Build.Step.Compile, use_zig_tc: bool) void {
489489
mode_str,
490490
lib,
491491
}) catch unreachable;
492-
step.addAssemblyFile(.{ .path = lib_path });
492+
step.addAssemblyFile(b.path(lib_path));
493493
if (builtin.os.tag == .linux) {
494494
if (use_zig_tc) {
495495
// TODO: This should be linked already when we built v8.
@@ -515,12 +515,12 @@ fn linkV8(b: *std.Build, step: *std.Build.Step.Compile, use_zig_tc: bool) void {
515515

516516
fn createTest(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, use_zig_tc: bool) *std.Build.Step.Compile {
517517
const step = b.addTest(.{
518-
.root_source_file = .{ .path = "./src/test.zig" },
518+
.root_source_file = b.path("./src/test.zig"),
519519
.target = target,
520520
.optimize = mode,
521521
.link_libc = true,
522522
});
523-
step.addIncludePath(.{ .path = "./src" });
523+
step.addIncludePath(b.path("./src"));
524524
linkV8(b, step, use_zig_tc);
525525
return step;
526526
}
@@ -624,7 +624,7 @@ pub const GetV8SourceStep = struct {
624624
try step.handleChildProcUnsupported(cwd, args.items);
625625
try Step.handleVerbose(step.owner, cwd, args.items);
626626

627-
const result = std.ChildProcess.run(.{
627+
const result = std.process.Child.run(.{
628628
.cwd = cwd,
629629
.allocator = arena,
630630
.argv = args.items,
@@ -641,7 +641,7 @@ pub const GetV8SourceStep = struct {
641641
}
642642
}
643643

644-
fn make(step: *Step, prog_node: *std.Progress.Node) anyerror!void {
644+
fn make(step: *Step, prog_node: std.Progress.Node) anyerror!void {
645645
_ = prog_node;
646646
const self: *Self = @fieldParentPtr("step", step);
647647

@@ -661,7 +661,7 @@ pub const GetV8SourceStep = struct {
661661

662662
// Get DEPS in json.
663663
const argv = &.{ "python3", "tools/parse_deps.py", "v8/DEPS" };
664-
const result = std.ChildProcess.run(.{
664+
const result = std.process.Child.run(.{
665665
.allocator = step.owner.allocator,
666666
.argv = argv,
667667
}) catch |err| return step.fail("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
@@ -744,12 +744,12 @@ fn createCompileStep(b: *std.Build, path: []const u8, target: std.Build.Resolved
744744

745745
const step = b.addExecutable(.{
746746
.name = name,
747-
.root_source_file = .{ .path = path },
747+
.root_source_file = b.path(path),
748748
.optimize = mode,
749749
.target = target,
750750
.link_libc = true,
751751
});
752-
step.addIncludePath(.{ .path = "src" });
752+
step.addIncludePath(b.path("src"));
753753

754754
if (mode == .ReleaseSafe) {
755755
step.root_module.strip = true;

0 commit comments

Comments
 (0)