chore: upgrade zig to 0.12.0-dev.1828+225fe6ddb (#7671)

* chore: upgrade zig to 0.12.0-dev.1828+225fe6ddb

* open as iterable

* fix building identifier cache

* fix windows build

* fix linux build

* fix linux build
This commit is contained in:
dave caruso
2023-12-16 00:14:15 -08:00
committed by GitHub
parent 925a94ffe6
commit 369e3022e4
179 changed files with 3681 additions and 3688 deletions

View File

@@ -294,7 +294,7 @@ pub const RunCommand = struct {
) !bool {
const shell_bin = findShell(env.map.get("PATH") orelse "", cwd) orelse return error.MissingShell;
var script = original_script;
const script = original_script;
var copy_script = try std.ArrayList(u8).initCapacity(allocator, script.len);
// We're going to do this slowly.
@@ -315,7 +315,7 @@ pub const RunCommand = struct {
bun.copy(u8, combined_script_buf, script);
var remaining_script_buf = combined_script_buf[script.len..];
for (passthrough) |part| {
var p = part;
const p = part;
remaining_script_buf[0] = ' ';
bun.copy(u8, remaining_script_buf[1..], p);
remaining_script_buf = remaining_script_buf[p.len + 1 ..];
@@ -473,7 +473,7 @@ pub const RunCommand = struct {
}
pub fn ls(ctx: Command.Context) !void {
var args = ctx.args;
const args = ctx.args;
var this_bundler = try bundler.Bundler.init(ctx.allocator, ctx.log, args, null);
this_bundler.options.env.behavior = Api.DotEnvBehavior.load_all;
@@ -558,7 +558,7 @@ pub const RunCommand = struct {
env: ?*DotEnv.Loader,
log_errors: bool,
) !*DirInfo {
var args = ctx.args;
const args = ctx.args;
this_bundler.* = try bundler.Bundler.init(ctx.allocator, ctx.log, args, env);
this_bundler.options.env.behavior = Api.DotEnvBehavior.load_all;
this_bundler.env.quiet = true;
@@ -674,7 +674,7 @@ pub const RunCommand = struct {
}
}
var PATH = this_bundler.env.map.get("PATH") orelse "";
const PATH = this_bundler.env.map.get("PATH") orelse "";
if (ORIGINAL_PATH) |original_path| {
original_path.* = PATH;
}
@@ -752,7 +752,7 @@ pub const RunCommand = struct {
}
}
var args = ctx.args;
const args = ctx.args;
var this_bundler = bundler.Bundler.init(ctx.allocator, ctx.log, args, null) catch return shell_out;
this_bundler.options.env.behavior = Api.DotEnvBehavior.load_all;
@@ -768,7 +768,7 @@ pub const RunCommand = struct {
}
this_bundler.configureLinker();
var root_dir_info = (this_bundler.resolver.readDirInfo(this_bundler.fs.top_level_dir) catch null) orelse return shell_out;
const root_dir_info = (this_bundler.resolver.readDirInfo(this_bundler.fs.top_level_dir) catch null) orelse return shell_out;
{
this_bundler.env.loadProcess();
@@ -820,7 +820,7 @@ pub const RunCommand = struct {
const base = value.base();
bun.copy(u8, path_buf[dir_slice.len..], base);
path_buf[dir_slice.len + base.len] = 0;
var slice = path_buf[0 .. dir_slice.len + base.len :0];
const slice = path_buf[0 .. dir_slice.len + base.len :0];
if (Environment.isWindows) {
@panic("TODO");
}
@@ -888,7 +888,7 @@ pub const RunCommand = struct {
continue :loop;
}
var entry_item = results.getOrPutAssumeCapacity(key);
const entry_item = results.getOrPutAssumeCapacity(key);
if (filter == Filter.script_and_descriptions and max_description_len > 0) {
var description = scripts.get(key).?;
@@ -938,7 +938,7 @@ pub const RunCommand = struct {
}
}
var all_keys = results.keys();
const all_keys = results.keys();
strings.sortAsc(all_keys);
shell_out.commands = all_keys;
@@ -1086,7 +1086,7 @@ pub const RunCommand = struct {
);
if (file_path.len == 0) break :possibly_open_with_bun_js;
path_buf2[file_path.len] = 0;
var file_pathZ = path_buf2[0..file_path.len :0];
const file_pathZ = path_buf2[0..file_path.len :0];
break :brk bun.openFileZ(file_pathZ, .{ .mode = .read_only });
}
};
@@ -1129,7 +1129,7 @@ pub const RunCommand = struct {
}
Global.configureAllocator(.{ .long_running = true });
var out_path = ctx.allocator.dupe(u8, file_path) catch unreachable;
const out_path = ctx.allocator.dupe(u8, file_path) catch unreachable;
if (must_normalize) {
if (comptime Environment.isWindows) {
std.mem.replaceScalar(u8, out_path, std.fs.path.sep_windows, std.fs.path.sep_posix);
@@ -1161,7 +1161,7 @@ pub const RunCommand = struct {
var ORIGINAL_PATH: string = "";
var this_bundler: bundler.Bundler = undefined;
var root_dir_info = try configureEnvForRun(ctx, &this_bundler, null, log_errors);
const root_dir_info = try configureEnvForRun(ctx, &this_bundler, null, log_errors);
try configurePathForRun(ctx, root_dir_info, &this_bundler, &ORIGINAL_PATH, root_dir_info.abs_path, force_using_bun);
this_bundler.env.map.put("npm_lifecycle_event", script_name_to_search) catch unreachable;
if (root_dir_info.enclosing_package_json) |package_json| {