diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 54aab09a..b6bbf8c5 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -5,7 +5,7 @@ inputs: zig: description: 'Zig version to install' required: false - default: '0.12.1' + default: '0.13.0' arch: description: 'CPU arch used to select the v8 lib' required: false @@ -17,7 +17,7 @@ inputs: zig-v8: description: 'zig v8 version to install' required: false - default: 'v0.1.5' + default: 'v0.1.6' v8: description: 'v8 version to install' required: false diff --git a/.github/workflows/zig-fmt.yml b/.github/workflows/zig-fmt.yml index 0d5eb319..a425f988 100644 --- a/.github/workflows/zig-fmt.yml +++ b/.github/workflows/zig-fmt.yml @@ -1,7 +1,7 @@ name: zig-fmt env: - ZIG_VERSION: 0.12.1 + ZIG_VERSION: 0.13.0 on: pull_request: diff --git a/.gitignore b/.gitignore index 227e0211..91d299d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ zig-cache +/.zig-cache/ zig-out /vendor/netsurf/build/ /vendor/netsurf/lib/ diff --git a/README.md b/README.md index 6997fa2e..07214af2 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ We do not provide yet binary versions of Lightpanda, you have to compile it from ### Prerequisites -Lightpanda is written with [Zig](https://ziglang.org/) `0.12.1`. You have to +Lightpanda is written with [Zig](https://ziglang.org/) `0.13.0`. You have to install it with the right version in order to build the project. Lightpanda also depends on diff --git a/src/async/Client.zig b/src/async/Client.zig index d4af4018..b6fe6f04 100644 --- a/src/async/Client.zig +++ b/src/async/Client.zig @@ -278,7 +278,7 @@ pub const Connection = struct { if (conn.read_end != conn.read_start) return; var iovecs = [1]std.posix.iovec{ - .{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len }, + .{ .base = &conn.read_buf, .len = conn.read_buf.len }, }; const nread = try conn.readvDirect(&iovecs); if (nread == 0) return error.EndOfStream; @@ -314,8 +314,8 @@ pub const Connection = struct { } var iovecs = [2]std.posix.iovec{ - .{ .iov_base = buffer.ptr, .iov_len = buffer.len }, - .{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len }, + .{ .base = buffer.ptr, .len = buffer.len }, + .{ .base = &conn.read_buf, .len = conn.read_buf.len }, }; const nread = try conn.readvDirect(&iovecs); @@ -1560,7 +1560,7 @@ pub const RequestOptions = struct { }; fn validateUri(uri: Uri, arena: Allocator) !struct { Connection.Protocol, Uri } { - const protocol_map = std.ComptimeStringMap(Connection.Protocol, .{ + const protocol_map = std.StaticStringMap(Connection.Protocol).initComptime(.{ .{ "http", .plain }, .{ "ws", .plain }, .{ "https", .tls }, diff --git a/src/async/stream.zig b/src/async/stream.zig index 9ef73d01..85b6cbb2 100644 --- a/src/async/stream.zig +++ b/src/async/stream.zig @@ -107,7 +107,7 @@ pub const Stream = struct { /// See equivalent function: `std.fs.File.writev`. pub fn writev(self: Stream, iovecs: []const posix.iovec_const) WriteError!usize { if (iovecs.len == 0) return 0; - const first_buffer = iovecs[0].iov_base[0..iovecs[0].iov_len]; + const first_buffer = iovecs[0].base[0..iovecs[0].len]; return try self.write(first_buffer); } @@ -121,13 +121,13 @@ pub const Stream = struct { var i: usize = 0; while (true) { var amt = try self.writev(iovecs[i..]); - while (amt >= iovecs[i].iov_len) { - amt -= iovecs[i].iov_len; + while (amt >= iovecs[i].len) { + amt -= iovecs[i].len; i += 1; if (i >= iovecs.len) return; } - iovecs[i].iov_base += amt; - iovecs[i].iov_len -= amt; + iovecs[i].base += amt; + iovecs[i].len -= amt; } } }; diff --git a/src/main_wpt.zig b/src/main_wpt.zig index c8790254..7a774fcc 100644 --- a/src/main_wpt.zig +++ b/src/main_wpt.zig @@ -288,7 +288,7 @@ fn runSafe( argv.appendAssumeCapacity(tc); defer _ = argv.pop(); - const run = try std.ChildProcess.run(.{ + const run = try std.process.Child.run(.{ .allocator = alloc, .argv = argv.items, .max_output_bytes = 1024 * 1024, diff --git a/vendor/zig-js-runtime b/vendor/zig-js-runtime index e7fd4b1e..ade128f8 160000 --- a/vendor/zig-js-runtime +++ b/vendor/zig-js-runtime @@ -1 +1 @@ -Subproject commit e7fd4b1e04de56a3da3ef1169c321ad1b7e72a2e +Subproject commit ade128f8b6f1cdf7457efe9fc622448d1901afa7