Skip to content

Commit

Permalink
Merge branch 'main' into jarred/proto
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner authored Oct 8, 2024
2 parents 3a319f5 + 0d5eb73 commit b11c368
Show file tree
Hide file tree
Showing 187 changed files with 9,589 additions and 2,395 deletions.
56 changes: 28 additions & 28 deletions .buildkite/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steps:
group: ":darwin: aarch64"
steps:
- key: "darwin-aarch64-build-deps"
label: ":darwin: aarch64 - build-deps"
label: "build-deps"
agents:
queue: "build-darwin"
os: "darwin"
Expand All @@ -22,7 +22,7 @@ steps:
- "bun run build:ci --target dependencies"

- key: "darwin-aarch64-build-cpp"
label: ":darwin: aarch64 - build-cpp"
label: "build-cpp"
agents:
queue: "build-darwin"
os: "darwin"
Expand All @@ -33,14 +33,14 @@ steps:
- "bun run build:ci --target bun"

- key: "darwin-aarch64-build-zig"
label: ":darwin: aarch64 - build-zig"
label: "build-zig"
agents:
queue: "build-zig"
command:
- "bun run build:ci --target bun-zig --toolchain darwin-aarch64"

- key: "darwin-aarch64-build-bun"
label: ":darwin: aarch64 - build-bun"
label: "build-bun"
agents:
queue: "build-darwin"
os: "darwin"
Expand Down Expand Up @@ -115,7 +115,7 @@ steps:
group: ":darwin: x64"
steps:
- key: "darwin-x64-build-deps"
label: ":darwin: x64 - build-deps"
label: "build-deps"
agents:
queue: "build-darwin"
os: "darwin"
Expand All @@ -124,7 +124,7 @@ steps:
- "bun run build:ci --target dependencies"

- key: "darwin-x64-build-cpp"
label: ":darwin: x64 - build-cpp"
label: "build-cpp"
agents:
queue: "build-darwin"
os: "darwin"
Expand All @@ -135,14 +135,14 @@ steps:
- "bun run build:ci --target bun"

- key: "darwin-x64-build-zig"
label: ":darwin: x64 - build-zig"
label: "build-zig"
agents:
queue: "build-zig"
command:
- "bun run build:ci --target bun-zig --toolchain darwin-x64"

- key: "darwin-x64-build-bun"
label: ":darwin: x64 - build-bun"
label: "build-bun"
agents:
queue: "build-darwin"
os: "darwin"
Expand Down Expand Up @@ -217,7 +217,7 @@ steps:
group: ":linux: x64"
steps:
- key: "linux-x64-build-deps"
label: ":linux: x64 - build-deps"
label: "build-deps"
agents:
queue: "build-linux"
os: "linux"
Expand All @@ -226,7 +226,7 @@ steps:
- "bun run build:ci --target dependencies"

- key: "linux-x64-build-cpp"
label: ":linux: x64 - build-cpp"
label: "build-cpp"
agents:
queue: "build-linux"
os: "linux"
Expand All @@ -237,14 +237,14 @@ steps:
- "bun run build:ci --target bun"

- key: "linux-x64-build-zig"
label: ":linux: x64 - build-zig"
label: "build-zig"
agents:
queue: "build-zig"
command:
- "bun run build:ci --target bun-zig --toolchain linux-x64"

- key: "linux-x64-build-bun"
label: ":linux: x64 - build-bun"
label: "build-bun"
agents:
queue: "build-linux"
os: "linux"
Expand Down Expand Up @@ -350,7 +350,7 @@ steps:
group: ":linux: x64-baseline"
steps:
- key: "linux-x64-baseline-build-deps"
label: ":linux: x64-baseline - build-deps"
label: "build-deps"
agents:
queue: "build-linux"
os: "linux"
Expand All @@ -361,7 +361,7 @@ steps:
- "bun run build:ci --target dependencies"

- key: "linux-x64-baseline-build-cpp"
label: ":linux: x64-baseline - build-cpp"
label: "build-cpp"
agents:
queue: "build-linux"
os: "linux"
Expand All @@ -373,7 +373,7 @@ steps:
- "bun run build:ci --target bun"

- key: "linux-x64-baseline-build-zig"
label: ":linux: x64-baseline - build-zig"
label: "build-zig"
agents:
queue: "build-zig"
env:
Expand All @@ -382,7 +382,7 @@ steps:
- "bun run build:ci --target bun-zig --toolchain linux-x64-baseline"

- key: "linux-x64-baseline-build-bun"
label: ":linux: x64-baseline - build-bun"
label: "build-bun"
agents:
queue: "build-linux"
os: "linux"
Expand Down Expand Up @@ -489,7 +489,7 @@ steps:
group: ":linux: aarch64"
steps:
- key: "linux-aarch64-build-deps"
label: ":linux: aarch64 - build-deps"
label: "build-deps"
agents:
queue: "build-linux"
os: "linux"
Expand All @@ -498,7 +498,7 @@ steps:
- "bun run build:ci --target dependencies"

- key: "linux-aarch64-build-cpp"
label: ":linux: aarch64 - build-cpp"
label: "build-cpp"
agents:
queue: "build-linux"
os: "linux"
Expand All @@ -509,14 +509,14 @@ steps:
- "bun run build:ci --target bun"

- key: "linux-aarch64-build-zig"
label: ":linux: aarch64 - build-zig"
label: "build-zig"
agents:
queue: "build-zig"
command:
- "bun run build:ci --target bun-zig --toolchain linux-aarch64"

- key: "linux-aarch64-build-bun"
label: ":linux: aarch64 - build-bun"
label: "build-bun"
agents:
queue: "build-linux"
os: "linux"
Expand Down Expand Up @@ -622,7 +622,7 @@ steps:
group: ":windows: x64"
steps:
- key: "windows-x64-build-deps"
label: ":windows: x64 - build-deps"
label: "build-deps"
agents:
queue: "build-windows"
os: "windows"
Expand All @@ -635,7 +635,7 @@ steps:
- "bun run build:ci --target dependencies"

- key: "windows-x64-build-cpp"
label: ":windows: x64 - build-cpp"
label: "build-cpp"
agents:
queue: "build-windows"
os: "windows"
Expand All @@ -650,14 +650,14 @@ steps:
- "bun run build:ci --target bun"

- key: "windows-x64-build-zig"
label: ":windows: x64 - build-zig"
label: "build-zig"
agents:
queue: "build-zig"
command:
- "bun run build:ci --target bun-zig --toolchain windows-x64"

- key: "windows-x64-build-bun"
label: ":windows: x64 - build-bun"
label: "build-bun"
agents:
queue: "build-windows"
os: "windows"
Expand Down Expand Up @@ -705,7 +705,7 @@ steps:
group: ":windows: x64-baseline"
steps:
- key: "windows-x64-baseline-build-deps"
label: ":windows: x64-baseline - build-deps"
label: "build-deps"
agents:
queue: "build-windows"
os: "windows"
Expand All @@ -720,7 +720,7 @@ steps:
- "bun run build:ci --target dependencies"

- key: "windows-x64-baseline-build-cpp"
label: ":windows: x64-baseline - build-cpp"
label: "build-cpp"
agents:
queue: "build-windows"
os: "windows"
Expand All @@ -736,7 +736,7 @@ steps:
- "bun run build:ci --target bun"

- key: "windows-x64-baseline-build-zig"
label: ":windows: x64-baseline - build-zig"
label: "build-zig"
agents:
queue: "build-zig"
env:
Expand All @@ -745,7 +745,7 @@ steps:
- "bun run build:ci --target bun-zig --toolchain windows-x64-baseline"

- key: "windows-x64-baseline-build-bun"
label: ":windows: x64-baseline - build-bun"
label: "build-bun"
agents:
queue: "build-windows"
os: "windows"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ env.LLVM_VERSION_MAJOR }} all
- name: Clang Format
env:
ENABLE_CCACHE: OFF
LLVM_VERSION: ${{ env.LLVM_VERSION }}
run: |
bun run clang-format:diff
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ env.LLVM_VERSION_MAJOR }} all
- name: Clang Tidy
env:
ENABLE_CCACHE: OFF
LLVM_VERSION: ${{ env.LLVM_VERSION }}
run: |
bun run clang-tidy:diff
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/prettier-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ jobs:
run: |
bun install
- name: Prettier Format
env:
ENABLE_CCACHE: OFF
LLVM_VERSION: "ignore"
run: |
bun run prettier:diff
- name: Commit
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/zig-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Zig Format
env:
ENABLE_CCACHE: OFF
LLVM_VERSION: "ignore"
run: |
bun run zig-format:diff
- name: Commit
Expand Down
2 changes: 2 additions & 0 deletions .vscode/launch.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ include(BuildBun)

# --- Analysis ---

optionx(ENABLE_ANALYSIS BOOL "If analysis targets should be enabled" DEFAULT OFF)

if(ENABLE_ANALYSIS)
include(RunClangFormat)
include(RunClangTidy)
Expand Down
34 changes: 14 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ x.y.z_debug

VSCode is the recommended IDE for working on Bun, as it has been configured. Once opening, you can run `Extensions: Show Recommended Extensions` to install the recommended extensions for Zig and C++. ZLS is automatically configured.

If you use a different editor, make sure that you tell ZLS to use the automatically installed Zig compiler, which is located at `./.cache/zig/zig.exe`. The filename is `zig.exe` so that it works as expected on Windows, but it still works on macOS/Linux (it just has a surprising file extension).
If you use a different editor, make sure that you tell ZLS to use the automatically installed Zig compiler, which is located at `./vendor/zig/zig.exe`. The filename is `zig.exe` so that it works as expected on Windows, but it still works on macOS/Linux (it just has a surprising file extension).

We recommend adding `./build` to your `$PATH` so that you can run `bun-debug` in your terminal:
We recommend adding `./build/debug` to your `$PATH` so that you can run `bun-debug` in your terminal:

```sh
$ bun-debug
Expand Down Expand Up @@ -164,7 +164,7 @@ To compile a release build of Bun, run:
$ bun run build:release
```

The binary will be located at `./build-release/bun` and `./build-release/bun-profile`.
The binary will be located at `./build/release/bun` and `./build/release/bun-profile`.

### Download release build from pull requests

Expand All @@ -173,8 +173,8 @@ To save you time spent building a release build locally, we provide a way to run
To run a release build from a pull request, you can use the `bun-pr` npm package:

```sh
bunx bun-pr pr-number
bunx bun-pr branch/branch-name
bunx bun-pr <pr-number>
bunx bun-pr <branch-name>
bunx bun-pr "https://github.com/oven-sh/bun/pull/1234566"
```

Expand Down Expand Up @@ -206,24 +206,18 @@ $ valgrind --fair-sched=try --track-origins=yes bun-debug <args>

## Building WebKit locally + Debug mode of JSC

{% callout %}

**TODO**: This is out of date. TLDR is pass `-DUSE_DEBUG_JSC=1` or `-DWEBKIT_DIR=...` to CMake. it will probably need more fiddling. ask @paperdave if you need this.

{% /callout %}

WebKit is not cloned by default (to save time and disk space). To clone and build WebKit locally, run:

```bash
# once you run this, `make submodule` can be used to automatically
# update WebKit and the other submodules
$ git submodule update --init --depth 1 --checkout src/bun.js/WebKit
# to make a jsc release build
$ make jsc
# JSC debug build does not work perfectly with Bun yet, this is actively being
# worked on and will eventually become the default.
$ make jsc-build-linux-compile-debug cpp
$ make jsc-build-mac-compile-debug cpp
# Clone WebKit into ./vendor/WebKit
$ git clone https://github.com/oven-sh/WebKit vendor/WebKit

# Make a debug build of JSC. This will output build artifacts in ./vendor/WebKit/WebKitBuild/Debug
# Optionally, you can use `make jsc` for a release build
$ make jsc-debug

# Build bun with the local JSC build
$ bun run build:local
```

Note that the WebKit folder, including build artifacts, is 8GB+ in size.
Expand Down
6 changes: 3 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const BunBuildOptions = struct {
/// instead of at compile time. This is disabled in release or if this flag
/// is set (to allow CI to build a portable executable). Affected files:
///
/// - src/kit/runtime.ts (bundled)
/// - src/bake/runtime.ts (bundled)
/// - src/bun.js/api/FFI.h
///
/// A similar technique is used in C++ code for JavaScript builtins
Expand Down Expand Up @@ -475,8 +475,8 @@ fn addInternalPackages(b: *Build, obj: *Compile, opts: *BunBuildOptions) void {
.{ .file = "ZigGeneratedClasses.zig", .import = "ZigGeneratedClasses" },
.{ .file = "ResolvedSourceTag.zig", .import = "ResolvedSourceTag" },
.{ .file = "ErrorCode.zig", .import = "ErrorCode" },
.{ .file = "kit.client.js", .import = "kit-codegen/kit.client.js", .enable = opts.shouldEmbedCode() },
.{ .file = "kit.server.js", .import = "kit-codegen/kit.server.js", .enable = opts.shouldEmbedCode() },
.{ .file = "bake.client.js", .import = "bake-codegen/bake.client.js", .enable = opts.shouldEmbedCode() },
.{ .file = "bake.server.js", .import = "bake-codegen/bake.server.js", .enable = opts.shouldEmbedCode() },
}) |entry| {
if (!@hasField(@TypeOf(entry), "enable") or entry.enable) {
const path = b.pathJoin(&.{ opts.generated_code_dir, entry.file });
Expand Down
Loading

0 comments on commit b11c368

Please sign in to comment.