mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
[bun install] some things install
This commit is contained in:
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
@@ -314,6 +314,18 @@
|
||||
"cwd": "${workspaceFolder}/integration/snippets",
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "Install",
|
||||
"program": "bun-debug",
|
||||
"args": ["install"],
|
||||
"cwd": "/tmp/wow-such-npm",
|
||||
"env": {
|
||||
"GOMAXPROCS": "1"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
|
||||
@@ -546,7 +546,7 @@ struct Semver {
|
||||
uint32 major;
|
||||
uint32 minor;
|
||||
uint32 patch;
|
||||
qualifier SemverQualifier;
|
||||
SemverQualifier qualifier;
|
||||
}
|
||||
|
||||
enum NPMPackageDataKind {
|
||||
|
||||
@@ -664,7 +664,9 @@ pub const Command = struct {
|
||||
return;
|
||||
},
|
||||
.InstallCommand => {
|
||||
try InstallCommand.exec(allocator);
|
||||
const ctx = try Command.Context.create(allocator, log, .BuildCommand);
|
||||
|
||||
try InstallCommand.exec(ctx);
|
||||
return;
|
||||
},
|
||||
.GetCompletionsCommand => {
|
||||
|
||||
@@ -58,6 +58,7 @@ pub const Output = struct {
|
||||
}
|
||||
|
||||
pub fn configureThread() void {
|
||||
if (source_set) return;
|
||||
std.debug.assert(stdout_stream_set);
|
||||
source = Source.init(stdout_stream, stderr_stream);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1060,7 +1060,7 @@ pub const E = struct {
|
||||
|
||||
pub inline fn toU64(self: Number) u64 {
|
||||
@setRuntimeSafety(false);
|
||||
return @floatToInt(u64, @maximum(@floor(self.value), 0));
|
||||
return @floatToInt(u64, @maximum(@trunc(self.value), 0));
|
||||
}
|
||||
|
||||
pub fn jsonStringify(self: *const Number, opts: anytype, o: anytype) !void {
|
||||
|
||||
@@ -540,7 +540,7 @@ pub const Archive = struct {
|
||||
var archive = stream.archive;
|
||||
var count: u32 = 0;
|
||||
|
||||
const dir: std.fs.Dir = brk: {
|
||||
var dir: std.fs.Dir = brk: {
|
||||
const cwd = std.fs.cwd();
|
||||
cwd.makePath(
|
||||
root,
|
||||
|
||||
16
src/s2n.zig
16
src/s2n.zig
@@ -9,11 +9,17 @@ pub inline fn s2nassert(value: c_int) void {
|
||||
std.debug.assert(value == 0);
|
||||
}
|
||||
|
||||
var booted_any: bool = false;
|
||||
pub fn boot(allcoator: *std.mem.Allocator) void {
|
||||
if (!booted_any) {
|
||||
s2nassert(s2n_disable_atexit());
|
||||
s2nassert(s2n_init());
|
||||
Allocator.allocator = allcoator;
|
||||
CacheStore.instance = CacheStore{ .allocator = allcoator, .map = @TypeOf(CacheStore.instance.map).init(allcoator) };
|
||||
}
|
||||
booted_any = true;
|
||||
if (booted) return;
|
||||
booted = true;
|
||||
Allocator.allocator = allcoator;
|
||||
CacheStore.instance = CacheStore{ .allocator = allcoator, .map = @TypeOf(CacheStore.instance.map).init(allcoator) };
|
||||
|
||||
// Important for any website using Cloudflare.
|
||||
// Do to our modifications in the library, this must be called _first_
|
||||
@@ -43,8 +49,6 @@ pub fn boot(allcoator: *std.mem.Allocator) void {
|
||||
// Also, the implementation
|
||||
// s2nassert(s2n_mem_set_callbacks(Allocator.initCallback, Allocator.deinitCallback, Allocator.mallocCallback, Allocator.freeCallback));
|
||||
|
||||
s2nassert(s2n_disable_atexit());
|
||||
s2nassert(s2n_init());
|
||||
global_s2n_config = s2n_fetch_default_config();
|
||||
// s2nassert(s2n_config_set_verify_host_callback(global_s2n_config, verify_host_callback, null));
|
||||
// s2nassert(s2n_config_set_check_stapled_ocsp_response(global_s2n_config, 0));
|
||||
@@ -546,8 +550,8 @@ pub const s2n_offered_psk_list = struct_s2n_offered_psk_list;
|
||||
pub const s2n_async_pkey_op = struct_s2n_async_pkey_op;
|
||||
pub const s2n_offered_early_data = struct_s2n_offered_early_data;
|
||||
|
||||
var booted = false;
|
||||
pub var global_s2n_config: *s2n_config = undefined;
|
||||
threadlocal var booted = false;
|
||||
pub threadlocal var global_s2n_config: *s2n_config = undefined;
|
||||
const unexpectedErrno = std.os.unexpectedErrno;
|
||||
const S2NError = error{ Closed, WouldBlock, Alert, Protocol, Internal, Usage };
|
||||
pub inline fn s2nErrorNo(rc: c_int) S2NError!std.os.system.E {
|
||||
|
||||
@@ -257,8 +257,8 @@ pub inline fn endsWith(self: string, str: string) bool {
|
||||
return str.len == 0 or @call(.{ .modifier = .always_inline }, std.mem.endsWith, .{ u8, self, str });
|
||||
}
|
||||
|
||||
pub inline fn endsWithComptime(self: string, comptime str: antype) bool {
|
||||
return self.len >= str.len and strings.eqlComptimeIgnoreLen(self[self.len - str.len .. self.len], comptime str);
|
||||
pub inline fn endsWithComptime(self: string, comptime str: anytype) bool {
|
||||
return self.len >= str.len and eqlComptimeIgnoreLen(self[self.len - str.len .. self.len], comptime str);
|
||||
}
|
||||
|
||||
pub inline fn startsWithChar(self: string, char: u8) bool {
|
||||
|
||||
Reference in New Issue
Block a user