aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/zig-fmt.yml2
-rw-r--r--Dockerfile2
-rw-r--r--build.zig25
-rw-r--r--docs/project/development.md4
-rw-r--r--src/bun.js/api/bun/dns_resolver.zig18
-rw-r--r--src/bun.js/api/bun/x509.zig6
-rw-r--r--src/bun.js/test/expect.zig2
-rw-r--r--src/bun.js/webcore/streams.zig2
-rw-r--r--src/deps/c_ares.zig18
-rw-r--r--src/install/install.zig4
-rw-r--r--src/js_ast.zig2
-rw-r--r--src/js_printer.zig2
12 files changed, 45 insertions, 42 deletions
diff --git a/.github/workflows/zig-fmt.yml b/.github/workflows/zig-fmt.yml
index ebe77614f..ca0cc93ba 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.0-dev.163+6780a6bbf
+ ZIG_VERSION: 0.12.0-dev.888+130227491
on:
pull_request:
diff --git a/Dockerfile b/Dockerfile
index 13b31d921..3d7e9161c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,7 +12,7 @@ ARG TRIPLET=${ARCH}-linux-gnu
ARG BUILDARCH=amd64
ARG WEBKIT_TAG=2023-oct3-1
ARG ZIG_TAG=jul1
-ARG ZIG_VERSION="0.12.0-dev.163+6780a6bbf"
+ARG ZIG_VERSION="0.12.0-dev.888+130227491"
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
ARG ZIG_FOLDERNAME=zig-linux-${BUILD_MACHINE_ARCH}-${ZIG_VERSION}
diff --git a/build.zig b/build.zig
index 9b71fac98..85e4e94d4 100644
--- a/build.zig
+++ b/build.zig
@@ -1,3 +1,5 @@
+const required_zig_version = "0.12.0-dev.888+130227491";
+
const std = @import("std");
const pathRel = std.fs.path.relative;
const Wyhash = @import("./src/wyhash.zig").Wyhash;
@@ -145,7 +147,6 @@ pub fn build(b: *Build) !void {
};
}
-const required_zig_version = "0.12.0-dev.163+6780a6bbf";
pub fn build_(b: *Build) !void {
if (!std.mem.eql(u8, @import("builtin").zig_version_string, required_zig_version)) {
const colors = std.io.getStdErr().supportsAnsiEscapeCodes();
@@ -232,7 +233,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative(root_src),
.target = target,
.optimize = optimize,
- .main_pkg_path = .{ .cwd_relative = b.pathFromRoot(".") },
+ .main_mod_path = .{ .cwd_relative = b.pathFromRoot(".") },
});
b.reference_trace = 16;
@@ -346,7 +347,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/bindgen.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -363,7 +364,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("root_wasm.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer wasm_step.dependOn(&wasm.step);
wasm.strip = false;
@@ -382,7 +383,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/http_bench.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -396,7 +397,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/machbench.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -410,7 +411,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/fetch.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -424,7 +425,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/bench/string-handling.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -438,7 +439,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/sha.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -452,7 +453,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("src/sourcemap/vlq_bench.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -466,7 +467,7 @@ pub fn build_(b: *Build) !void {
.root_source_file = FileSource.relative("misctools/tgz.zig"),
.target = target,
.optimize = optimize,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
defer headers_step.dependOn(&headers_obj.step);
try configureObjectStep(b, headers_obj, headers_step, @TypeOf(target), target);
@@ -483,7 +484,7 @@ pub fn build_(b: *Build) !void {
var headers_obj: *CompileStep = b.addTest(.{
.root_source_file = FileSource.relative(test_file orelse "src/main.zig"),
.target = target,
- .main_pkg_path = obj.main_pkg_path,
+ .main_mod_path = obj.main_mod_path,
});
headers_obj.filter = test_filter;
if (test_bin_) |test_bin| {
diff --git a/docs/project/development.md b/docs/project/development.md
index f2d359209..4e0ae7825 100644
--- a/docs/project/development.md
+++ b/docs/project/development.md
@@ -130,11 +130,11 @@ Zig can be installed either with our npm package [`@oven/zig`](https://www.npmjs
```bash
$ bun install -g @oven/zig
-$ zigup 0.12.0-dev.163+6780a6bbf
+$ zigup 0.12.0-dev.888+130227491
```
{% callout %}
-We last updated Zig on **July 18th, 2023**
+We last updated Zig on **October 12th, 2023**
{% /callout %}
## First Build
diff --git a/src/bun.js/api/bun/dns_resolver.zig b/src/bun.js/api/bun/dns_resolver.zig
index eea516242..873cdcddc 100644
--- a/src/bun.js/api/bun/dns_resolver.zig
+++ b/src/bun.js/api/bun/dns_resolver.zig
@@ -860,7 +860,7 @@ pub const CAresNameInfo = struct {
return;
}
var name_info = result.?;
- const array = name_info.toJSReponse(this.globalThis.allocator(), this.globalThis);
+ const array = name_info.toJSResponse(this.globalThis.allocator(), this.globalThis);
this.onComplete(array);
return;
}
@@ -1250,7 +1250,7 @@ pub const CAresReverse = struct {
return;
}
var node = result.?;
- const array = node.toJSReponse(this.globalThis.allocator(), this.globalThis, "");
+ const array = node.toJSResponse(this.globalThis.allocator(), this.globalThis, "");
this.onComplete(array);
return;
}
@@ -1321,7 +1321,7 @@ pub fn CAresLookup(comptime cares_type: type, comptime type_name: []const u8) ty
return;
}
var node = result.?;
- const array = node.toJSReponse(this.globalThis.allocator(), this.globalThis, type_name);
+ const array = node.toJSResponse(this.globalThis.allocator(), this.globalThis, type_name);
this.onComplete(array);
return;
}
@@ -1536,7 +1536,7 @@ pub const DNSResolver = struct {
var pending: ?*CAresLookup(cares_type, lookup_name) = key.lookup.head.next;
var prev_global = key.lookup.head.globalThis;
- var array = addr.toJSReponse(this.vm.allocator, prev_global, lookup_name);
+ var array = addr.toJSResponse(this.vm.allocator, prev_global, lookup_name);
defer addr.deinit();
array.ensureStillAlive();
key.lookup.head.onComplete(array);
@@ -1547,7 +1547,7 @@ pub const DNSResolver = struct {
while (pending) |value| {
var new_global = value.globalThis;
if (prev_global != new_global) {
- array = addr.toJSReponse(this.vm.allocator, new_global, lookup_name);
+ array = addr.toJSResponse(this.vm.allocator, new_global, lookup_name);
prev_global = new_global;
}
pending = value.next;
@@ -1666,7 +1666,7 @@ pub const DNSResolver = struct {
// The callback need not and should not attempt to free the memory
// pointed to by hostent; the ares library will free it when the
// callback returns.
- var array = addr.toJSReponse(this.vm.allocator, prev_global, "");
+ var array = addr.toJSResponse(this.vm.allocator, prev_global, "");
array.ensureStillAlive();
key.lookup.head.onComplete(array);
bun.default_allocator.destroy(key.lookup);
@@ -1676,7 +1676,7 @@ pub const DNSResolver = struct {
while (pending) |value| {
var new_global = value.globalThis;
if (prev_global != new_global) {
- array = addr.toJSReponse(this.vm.allocator, new_global, "");
+ array = addr.toJSResponse(this.vm.allocator, new_global, "");
prev_global = new_global;
}
pending = value.next;
@@ -1707,7 +1707,7 @@ pub const DNSResolver = struct {
var pending: ?*CAresNameInfo = key.lookup.head.next;
var prev_global = key.lookup.head.globalThis;
- var array = name_info.toJSReponse(this.vm.allocator, prev_global);
+ var array = name_info.toJSResponse(this.vm.allocator, prev_global);
array.ensureStillAlive();
key.lookup.head.onComplete(array);
bun.default_allocator.destroy(key.lookup);
@@ -1717,7 +1717,7 @@ pub const DNSResolver = struct {
while (pending) |value| {
var new_global = value.globalThis;
if (prev_global != new_global) {
- array = name_info.toJSReponse(this.vm.allocator, new_global);
+ array = name_info.toJSResponse(this.vm.allocator, new_global);
prev_global = new_global;
}
pending = value.next;
diff --git a/src/bun.js/api/bun/x509.zig b/src/bun.js/api/bun/x509.zig
index 9c902b39c..a94d47c45 100644
--- a/src/bun.js/api/bun/x509.zig
+++ b/src/bun.js/api/bun/x509.zig
@@ -273,7 +273,8 @@ fn x509PrintGeneralName(out: *BoringSSL.BIO, name: *BoringSSL.GENERAL_NAME) bool
// instead always print its numeric representation.
var oline: [256]u8 = undefined;
_ = BoringSSL.OBJ_obj2txt(&oline, @sizeOf(@TypeOf(oline)), name.d.rid, 1);
- _ = BoringSSL.BIO_printf(out, "Registered ID:%s", &oline);
+ // Workaround for https://github.com/ziglang/zig/issues/16197
+ _ = BoringSSL.BIO_printf(out, "Registered ID:%s", @as([*]const u8, &oline));
} else if (name.name_type == .GEN_X400) {
_ = BoringSSL.BIO_printf(out, "X400Name:<unsupported>");
} else if (name.name_type == .GEN_EDIPARTY) {
@@ -301,7 +302,8 @@ fn x509InfoAccessPrint(out: *BoringSSL.BIO, ext: *BoringSSL.X509_EXTENSION) bool
}
var tmp: [80]u8 = undefined;
_ = BoringSSL.i2t_ASN1_OBJECT(&tmp, @sizeOf(@TypeOf(tmp)), desc.method);
- _ = BoringSSL.BIO_printf(out, "%s - ", &tmp);
+ // Workaround for https://github.com/ziglang/zig/issues/16197
+ _ = BoringSSL.BIO_printf(out, "%s - ", @as([*]const u8, &tmp));
if (!x509PrintGeneralName(out, desc.location)) {
return false;
diff --git a/src/bun.js/test/expect.zig b/src/bun.js/test/expect.zig
index ff58965f5..6a7671f84 100644
--- a/src/bun.js/test/expect.zig
+++ b/src/bun.js/test/expect.zig
@@ -1518,7 +1518,7 @@ pub const Expect = struct {
}
const expected_diff = std.math.pow(f64, 10, -precision) / 2;
- const actual_diff = std.math.fabs(received - expected);
+ const actual_diff = @abs(received - expected);
var pass = actual_diff < expected_diff;
const not = this.flags.not;
diff --git a/src/bun.js/webcore/streams.zig b/src/bun.js/webcore/streams.zig
index 1f95659e2..6c51daf94 100644
--- a/src/bun.js/webcore/streams.zig
+++ b/src/bun.js/webcore/streams.zig
@@ -3848,7 +3848,7 @@ pub const FIFO = struct {
pub fn getAvailableToReadOnLinux(this: *FIFO) u32 {
var len: c_int = 0;
- const rc: c_int = std.c.ioctl(this.fd, std.os.linux.T.FIONREAD, &len);
+ const rc: c_int = std.c.ioctl(this.fd, std.os.linux.T.FIONREAD, @as(*c_int, &len));
if (rc != 0) {
len = 0;
}
diff --git a/src/deps/c_ares.zig b/src/deps/c_ares.zig
index 14fcb79e8..5290ffcc8 100644
--- a/src/deps/c_ares.zig
+++ b/src/deps/c_ares.zig
@@ -181,7 +181,7 @@ pub const struct_hostent = extern struct {
h_length: c_int,
h_addr_list: [*c][*c]u8,
- pub fn toJSReponse(this: *struct_hostent, _: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime lookup_name: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_hostent, _: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime lookup_name: []const u8) JSC.JSValue {
// A cname lookup always returns a single record but we follow the common API here.
if (comptime strings.eqlComptime(lookup_name, "cname")) {
@@ -289,7 +289,7 @@ pub const struct_nameinfo = extern struct {
node: [*c]u8,
service: [*c]u8,
- pub fn toJSReponse(this: *struct_nameinfo, _: std.mem.Allocator, globalThis: *JSC.JSGlobalObject) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_nameinfo, _: std.mem.Allocator, globalThis: *JSC.JSGlobalObject) JSC.JSValue {
const array = JSC.JSValue.createEmptyArray(globalThis, 2); // [node, service]
if (this.node != null) {
@@ -326,7 +326,7 @@ pub const struct_nameinfo = extern struct {
function(this, Error.get(status), timeouts, null);
return;
}
- function(this, null, timeouts, .{ node, service });
+ function(this, null, timeouts, .{ .node = node, .service = service });
return;
}
}.handle;
@@ -733,7 +733,7 @@ pub const struct_ares_caa_reply = extern struct {
value: [*c]u8,
length: usize,
- pub fn toJSReponse(this: *struct_ares_caa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_caa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -811,7 +811,7 @@ pub const struct_ares_srv_reply = extern struct {
weight: c_ushort,
port: c_ushort,
- pub fn toJSReponse(this: *struct_ares_srv_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_srv_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -894,7 +894,7 @@ pub const struct_ares_mx_reply = extern struct {
host: [*c]u8,
priority: c_ushort,
- pub fn toJSReponse(this: *struct_ares_mx_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_mx_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -968,7 +968,7 @@ pub const struct_ares_txt_reply = extern struct {
txt: [*c]u8,
length: usize,
- pub fn toJSReponse(this: *struct_ares_txt_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_txt_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -1048,7 +1048,7 @@ pub const struct_ares_naptr_reply = extern struct {
order: c_ushort,
preference: c_ushort,
- pub fn toJSReponse(this: *struct_ares_naptr_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_naptr_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
@@ -1140,7 +1140,7 @@ pub const struct_ares_soa_reply = extern struct {
expire: c_uint,
minttl: c_uint,
- pub fn toJSReponse(this: *struct_ares_soa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
+ pub fn toJSResponse(this: *struct_ares_soa_reply, parent_allocator: std.mem.Allocator, globalThis: *JSC.JSGlobalObject, comptime _: []const u8) JSC.JSValue {
var stack = std.heap.stackFallback(2048, parent_allocator);
var arena = @import("root").bun.ArenaAllocator.init(stack.get());
defer arena.deinit();
diff --git a/src/install/install.zig b/src/install/install.zig
index 6bff738df..0c2f8d2e1 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -7884,7 +7884,7 @@ pub const PackageManager = struct {
manager.root_dependency_list = dep_lists[0];
try builder.allocate();
- var all_name_hashes = brk: {
+ const all_name_hashes: []PackageNameHash = brk: {
if (!manager.summary.overrides_changed) break :brk &.{};
const hashes_len = manager.lockfile.overrides.map.entries.len + lockfile.overrides.map.entries.len;
if (hashes_len == 0) break :brk &.{};
@@ -7927,7 +7927,7 @@ pub const PackageManager = struct {
}
}
- if (manager.summary.overrides_changed) {
+ if (manager.summary.overrides_changed and all_name_hashes.len > 0) {
for (manager.lockfile.buffers.dependencies.items, 0..) |*dependency, dependency_i| {
if (std.mem.indexOfScalar(PackageNameHash, all_name_hashes, dependency.name_hash)) |_| {
manager.lockfile.buffers.resolutions.items[dependency_i] = invalid_package_id;
diff --git a/src/js_ast.zig b/src/js_ast.zig
index 46c204e69..3b17240c0 100644
--- a/src/js_ast.zig
+++ b/src/js_ast.zig
@@ -1714,7 +1714,7 @@ pub const E = struct {
if (comptime !Environment.isWasm) {
if (value == @trunc(value) and (value < std.math.maxInt(i32) and value > std.math.minInt(i32))) {
const int_value = @as(i64, @intFromFloat(value));
- const abs = @as(u64, @intCast(std.math.absInt(int_value) catch return null));
+ const abs = @as(u64, @intCast(@abs(int_value)));
if (abs < double_digit.len) {
return if (int_value < 0)
neg_double_digit[abs]
diff --git a/src/js_printer.zig b/src/js_printer.zig
index 8202eac80..d81499a36 100644
--- a/src/js_printer.zig
+++ b/src/js_printer.zig
@@ -2672,7 +2672,7 @@ fn NewPrinter(
.e_number => |e| {
const value = e.value;
- const absValue = @fabs(value);
+ const absValue = @abs(value);
if (std.math.isNan(value)) {
p.printSpaceBeforeIdentifier();