upgrade zig to v0.11.0-dev.3737+9eb008717 (#3374)

* progress

* finish `@memset/@memcpy` update

* Update build.zig

* change `@enumToInt` to `@intFromEnum` and friends

* update zig versions

* it was 1

* add link to issue

* add `compileError` reminder

* fix merge

* format

* upgrade to llvm 16

* Revert "upgrade to llvm 16"

This reverts commit cc930ceb1c.

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Dylan Conway
2023-06-21 23:38:18 -07:00
committed by GitHub
parent bfb322d618
commit 5fa13625a1
152 changed files with 1772 additions and 1584 deletions

View File

@@ -107,7 +107,7 @@ pub const NodeModuleBundle = struct {
// This catches any issues with the sorting order, which would cause all sorts of weird bugs
// This also allows us to simply extend the length of the previous slice to the new length
// Saving us an allocation
if (@ptrToInt(prev_package_ids_for_name.ptr) != @ptrToInt(entry.value_ptr.ptr)) {
if (@intFromPtr(prev_package_ids_for_name.ptr) != @intFromPtr(entry.value_ptr.ptr)) {
Output.prettyErrorln(
\\<r><red>Fatal<r>: incorrect package sorting order detected in .bun file.\n
\\This is a bug! Please create an issue.\n
@@ -225,7 +225,7 @@ pub const NodeModuleBundle = struct {
const lhs_name = context.moduleName(&lhs);
const rhs_name = context.moduleName(&rhs);
const traversal_length = std.math.min(lhs_name.len, rhs_name.len);
const traversal_length = @min(lhs_name.len, rhs_name.len);
for (lhs_name[0..traversal_length], 0..) |char, i| {
switch (std.math.order(char, rhs_name[i])) {
@@ -283,7 +283,7 @@ pub const NodeModuleBundle = struct {
const lhs_name = context.moduleName(&lhs);
const rhs_name = context.moduleName(&rhs);
const traversal_length = std.math.min(lhs_name.len, rhs_name.len);
const traversal_length = @min(lhs_name.len, rhs_name.len);
for (lhs_name[0..traversal_length], 0..) |char, i| {
switch (std.math.order(char, rhs_name[i])) {
@@ -431,16 +431,16 @@ pub const NodeModuleBundle = struct {
switch (size) {
0...1024 * 1024 => {
switch (level) {
.bad => Output.pretty("<red>{d: " ++ align_char ++ "6.2} KB</r>", .{@intToFloat(f64, size) / 1024.0}),
.neutral => Output.pretty("{d: " ++ align_char ++ "6.2} KB</r>", .{@intToFloat(f64, size) / 1024.0}),
.good => Output.pretty("<green>{d: " ++ align_char ++ "6.2} KB</r>", .{@intToFloat(f64, size) / 1024.0}),
.bad => Output.pretty("<red>{d: " ++ align_char ++ "6.2} KB</r>", .{@floatFromInt(f64, size) / 1024.0}),
.neutral => Output.pretty("{d: " ++ align_char ++ "6.2} KB</r>", .{@floatFromInt(f64, size) / 1024.0}),
.good => Output.pretty("<green>{d: " ++ align_char ++ "6.2} KB</r>", .{@floatFromInt(f64, size) / 1024.0}),
}
},
else => {
switch (level) {
.bad => Output.pretty("<red>{d: " ++ align_char ++ "6.2} MB</r>", .{@intToFloat(f64, size) / (1024 * 1024.0)}),
.neutral => Output.pretty("{d: " ++ align_char ++ "6.2} MB</r>", .{@intToFloat(f64, size) / (1024 * 1024.0)}),
.good => Output.pretty("<green>{d: " ++ align_char ++ "6.2} MB</r>", .{@intToFloat(f64, size) / (1024 * 1024.0)}),
.bad => Output.pretty("<red>{d: " ++ align_char ++ "6.2} MB</r>", .{@floatFromInt(f64, size) / (1024 * 1024.0)}),
.neutral => Output.pretty("{d: " ++ align_char ++ "6.2} MB</r>", .{@floatFromInt(f64, size) / (1024 * 1024.0)}),
.good => Output.pretty("<green>{d: " ++ align_char ++ "6.2} MB</r>", .{@floatFromInt(f64, size) / (1024 * 1024.0)}),
}
},
}
@@ -459,7 +459,7 @@ pub const NodeModuleBundle = struct {
var read_amount: i64 = 99999;
while (remain > 0 and read_amount > 0) {
read_amount = @intCast(i64, in.read(&buf) catch 0);
remain -= @intCast(i64, try out.write(buf[0..@intCast(usize, std.math.min(read_amount, remain))]));
remain -= @intCast(i64, try out.write(buf[0..@intCast(usize, @min(read_amount, remain))]));
}
}
};