Lots of stuff (#7027)

* Use debug mode by default

* Enable build with assertions enabled

* Update cli.zig

* Update bun-linux-build.yml

* Fixes

* Fix `ASSERT_ENABLED`

* try this

* Update Dockerfile

* mimalloc debug

* Update CMakeLists.txt

* `Bun.deepMatch` - fix assertion failures

cc @dylan-conway, looks like we need to use `putDirectMayBeIndex` and check for `isCell` more carefully.

* Object.create support in code generator and callbacks wrapper

* Remove unused file

* zig upgrade

* zls

* Fix various errors

* Support `BuiltinAccessor` in create_hash_table script

* Fix assertion failure in `process.mainModule`

* Fix assertion failure in `onerror`

* Fix assertion failure when creating a Worker

* Fix asssertion failure when loading lots of files in bun test

* Fix assertion failure when termating a `Worker`

* Add helper for converting BunString to a WTFString

* Fix assertion failure in notifyNeedTermination

* Add more debug logs in `bun test`

* Fix compiler warning in usockets

* Fix assertion failure with `Worker` termination (another)

* Fix assertion failure in `coerceToInt64`

* Fix assertion failure in `BroadcastChannel`

* Fix assertion failure in `Headers.prototype.getAll`

* Fixes #7067

* Add heap analyzer label for CommonJS modules

* Fix assertion failure in module.require && module.require.resolve

* Remove unused code

* Fix assertion failure in debugger

* Fix crash in debugger

* Fix assertion failures in bun:sqlite

* Bump zig

* Bump WebKit

* Fix assertion failure in JSPromise::reject && JSInternalPromise::reject

* Fix assertion failure in ReadableStream::cancel

* Fix assertion failure in AsyncContextFrame::create

* Fix assertion failure in bun:sqlite

* Fix assertion failure in mocks

* Fix assertion failure in ServerWebSocket.close

* Fix assertion failure in N-API with subclasses

* [napi] Make promises cheaper

* undo

* Don't check for exceptions in ObjectInitializationScope

* Add separate entry point for test runner that doesn't generate code

* Don't deref builtin code

* Fix preload test

* Fix assertion failure in memoryUsage()

* Fix preload test, part 2

* Ensure that the env map for a Worker is empty after it is used

* The pointer for the Arena allocator used in parsing should not change

* Terminate thread on exit

* Start to implement scriptExecutionStatus

* Update worker.test.ts

* Fix Dirent.name setter

* Update settings.json

* Fix assertion failure in node:http

* Use correct value for `JSFinalObject::maxInlineCapacity`

* JSFinalObject::maxInlineCapacity x2

* Don't strip when assertions are enabled

* Make `m_wasTerminated` atomic

* Preserve directives in the transpiler

cc @ctjlewis

* Workaround assertion failure in ServerWebSocket.sendBinary and ServerWebSocket.sendText

* windows

* Buffer lockfile serialization in-memory

* PR feedback

* PR feedback

* PR feedback

* Windows

* quotes

* Update CMakeLists.txt

* Update bun-linux-build.yml

* Update bun-linux-build.yml

* Move this code to BunString.cpp

* Update BunString.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2023-11-14 07:10:09 +01:00
committed by GitHub
parent 228bfbd24a
commit 7a4e0158d6
94 changed files with 1580 additions and 1214 deletions

View File

@@ -1,4 +1,4 @@
const recommended_zig_version = "0.12.0-dev.1297+a9e66ed73";
const recommended_zig_version = "0.12.0-dev.1571+03adafd80";
const zig_version = @import("builtin").zig_version;
const std = @import("std");
@@ -169,7 +169,7 @@ const fmt = struct {
};
var x64 = "x64";
var optimize: std.builtin.OptimizeMode = undefined;
var optimize: std.builtin.OptimizeMode = .Debug;
const Build = std.Build;
const CrossTarget = std.zig.CrossTarget;
@@ -219,7 +219,11 @@ pub fn build_(b: *Build) !void {
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
optimize = b.standardOptimizeOption(.{});
const generated_code_directory = b.option([]const u8, "generated-code", "Set the generated code directory") orelse "./build";
var generated_code_directory = b.option([]const u8, "generated-code", "Set the generated code directory") orelse "";
if (generated_code_directory.len == 0) {
generated_code_directory = b.pathFromRoot("build/codegen");
}
var output_dir_buf = std.mem.zeroes([4096]u8);
var bin_label = if (optimize == std.builtin.OptimizeMode.Debug) "packages/debug-bun-" else "packages/bun-";
@@ -403,11 +407,11 @@ pub fn build_(b: *Build) !void {
// Generated Code
// TODO: exit with a better error early if these files do not exist. it is an indication someone ran `zig build` directly without the code generators.
obj.addModule("generated/ZigGeneratedClasses.zig", b.createModule(.{
.source_file = .{ .path = b.fmt("{s}/ZigGeneratedClasses.zig", .{generated_code_directory}) },
obj.addModule("ZigGeneratedClasses", b.createModule(.{
.source_file = .{ .path = b.pathJoin(&.{ generated_code_directory, "ZigGeneratedClasses.zig" }) },
}));
obj.addModule("generated/ResolvedSourceTag.zig", b.createModule(.{
.source_file = .{ .path = b.fmt("{s}/ResolvedSourceTag.zig", .{generated_code_directory}) },
obj.addModule("ResolvedSourceTag", b.createModule(.{
.source_file = .{ .path = b.pathJoin(&.{ generated_code_directory, "ResolvedSourceTag.zig" }) },
}));
obj.linkLibC();
@@ -415,6 +419,7 @@ pub fn build_(b: *Build) !void {
obj.strip = false;
obj.omit_frame_pointer = optimize != .Debug;
obj.subsystem = .Console;
// Disable stack probing on x86 so we don't need to include compiler_rt
if (target.getCpuArch().isX86() or target.isWindows()) obj.disable_stack_probing = true;