Skip to content

Commit df27ce0

Browse files
Merge pull request #260 from lightpanda-io/zig0.13
upgrade to zig 0.13
2 parents 65c4b47 + 6da2954 commit df27ce0

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

.github/actions/install/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
zig:
66
description: 'Zig version to install'
77
required: false
8-
default: '0.12.1'
8+
default: '0.13.0'
99
arch:
1010
description: 'CPU arch used to select the v8 lib'
1111
required: false
@@ -17,7 +17,7 @@ inputs:
1717
zig-v8:
1818
description: 'zig v8 version to install'
1919
required: false
20-
default: 'v0.1.5'
20+
default: 'v0.1.6'
2121
v8:
2222
description: 'v8 version to install'
2323
required: false

.github/workflows/zig-fmt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: zig-fmt
22

33
env:
4-
ZIG_VERSION: 0.12.1
4+
ZIG_VERSION: 0.13.0
55

66
on:
77
pull_request:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
zig-cache
2+
/.zig-cache/
23
zig-out
34
/vendor/netsurf/build/
45
/vendor/netsurf/lib/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ We do not provide yet binary versions of Lightpanda, you have to compile it from
7676

7777
### Prerequisites
7878

79-
Lightpanda is written with [Zig](https://ziglang.org/) `0.12.1`. You have to
79+
Lightpanda is written with [Zig](https://ziglang.org/) `0.13.0`. You have to
8080
install it with the right version in order to build the project.
8181

8282
Lightpanda also depends on

src/async/Client.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub const Connection = struct {
278278
if (conn.read_end != conn.read_start) return;
279279

280280
var iovecs = [1]std.posix.iovec{
281-
.{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len },
281+
.{ .base = &conn.read_buf, .len = conn.read_buf.len },
282282
};
283283
const nread = try conn.readvDirect(&iovecs);
284284
if (nread == 0) return error.EndOfStream;
@@ -314,8 +314,8 @@ pub const Connection = struct {
314314
}
315315

316316
var iovecs = [2]std.posix.iovec{
317-
.{ .iov_base = buffer.ptr, .iov_len = buffer.len },
318-
.{ .iov_base = &conn.read_buf, .iov_len = conn.read_buf.len },
317+
.{ .base = buffer.ptr, .len = buffer.len },
318+
.{ .base = &conn.read_buf, .len = conn.read_buf.len },
319319
};
320320
const nread = try conn.readvDirect(&iovecs);
321321

@@ -1560,7 +1560,7 @@ pub const RequestOptions = struct {
15601560
};
15611561

15621562
fn validateUri(uri: Uri, arena: Allocator) !struct { Connection.Protocol, Uri } {
1563-
const protocol_map = std.ComptimeStringMap(Connection.Protocol, .{
1563+
const protocol_map = std.StaticStringMap(Connection.Protocol).initComptime(.{
15641564
.{ "http", .plain },
15651565
.{ "ws", .plain },
15661566
.{ "https", .tls },

src/async/stream.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub const Stream = struct {
107107
/// See equivalent function: `std.fs.File.writev`.
108108
pub fn writev(self: Stream, iovecs: []const posix.iovec_const) WriteError!usize {
109109
if (iovecs.len == 0) return 0;
110-
const first_buffer = iovecs[0].iov_base[0..iovecs[0].iov_len];
110+
const first_buffer = iovecs[0].base[0..iovecs[0].len];
111111
return try self.write(first_buffer);
112112
}
113113

@@ -121,13 +121,13 @@ pub const Stream = struct {
121121
var i: usize = 0;
122122
while (true) {
123123
var amt = try self.writev(iovecs[i..]);
124-
while (amt >= iovecs[i].iov_len) {
125-
amt -= iovecs[i].iov_len;
124+
while (amt >= iovecs[i].len) {
125+
amt -= iovecs[i].len;
126126
i += 1;
127127
if (i >= iovecs.len) return;
128128
}
129-
iovecs[i].iov_base += amt;
130-
iovecs[i].iov_len -= amt;
129+
iovecs[i].base += amt;
130+
iovecs[i].len -= amt;
131131
}
132132
}
133133
};

src/main_wpt.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fn runSafe(
288288
argv.appendAssumeCapacity(tc);
289289
defer _ = argv.pop();
290290

291-
const run = try std.ChildProcess.run(.{
291+
const run = try std.process.Child.run(.{
292292
.allocator = alloc,
293293
.argv = argv.items,
294294
.max_output_bytes = 1024 * 1024,

0 commit comments

Comments
 (0)