Skip to content

Commit

Permalink
Add BUN_DEBUG flag to control where debug logs go (#9019)
Browse files Browse the repository at this point in the history
* Add `BUN_DEBUG` flag to control where debug logs go

* Update all the actions

* Configure temp

* use spawn instead of rm

* Use CLOSE_RANGE_CLOEXEC

* Make some tests more reproducible

* Update hot.test.ts

* Detect file descriptor leaks and wait for stdout

* Update runner.node.mjs

* Update preload.ts

---------

Co-authored-by: Jarred Sumner <[email protected]>
  • Loading branch information
Jarred-Sumner and Jarred-Sumner authored Feb 21, 2024
1 parent a0be3cb commit 6184542
Show file tree
Hide file tree
Showing 20 changed files with 526 additions and 322 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/bun-linux-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,30 @@ jobs:
runner: linux-arm64
build_machine_arch: aarch64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: false
ref: ${{github.sha}}
clean: true
- run: |
bash ./scripts/update-submodules.sh
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/release
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
mkdir -p /tmp/.buildx-cache-${{matrix.tag}}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: false
Expand Down Expand Up @@ -113,11 +113,11 @@ jobs:
zip -r bun-${{matrix.tag}}-profile.zip bun-${{matrix.tag}}-profile
zip -r bun-${{matrix.tag}}.zip bun-${{matrix.tag}}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: bun-${{matrix.tag}}-profile
path: ${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: bun-${{matrix.tag}}
path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/bun-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ jobs:
submodules: recursive
ref: ${{github.sha}}
clean: true
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true
- name: Run
run: |
rm -rf ${{runner.temp}}/release
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: |
mkdir -p /tmp/.buildx-cache-${{matrix.tag}}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: false
Expand Down Expand Up @@ -154,19 +154,19 @@ jobs:
zip -r bun-${{matrix.tag}}-profile.zip bun-${{matrix.tag}}-profile
zip -r bun-${{matrix.tag}}.zip bun-${{matrix.tag}}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: bun-${{matrix.tag}}-profile
path: ${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: bun-${{matrix.tag}}
path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: bun-obj-${{matrix.tag}}
path: ${{runner.temp}}/release/bun-obj
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.tag}}-dependencies
path: ${{runner.temp}}/release/bun-dependencies
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
clean: true
- id: download
name: Download
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bun-${{matrix.tag}}
path: ${{runner.temp}}/release
Expand Down Expand Up @@ -275,6 +275,7 @@ jobs:
name: Test (node runner)
env:
SMTP_SENDGRID_SENDER: ${{ secrets.SMTP_SENDGRID_SENDER }}
TMPDIR: ${{runner.temp}}
TLS_MONGODB_DATABASE_URL: ${{ secrets.TLS_MONGODB_DATABASE_URL }}
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
# if: ${{github.event.inputs.use_bun == 'false'}}
Expand All @@ -283,7 +284,7 @@ jobs:
ulimit -c
node packages/bun-internal-test/src/runner.node.mjs || true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: steps.test.outputs.failing_tests != ''
with:
name: cores
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/bun-mac-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ jobs:
# run: git submodule update --init --recursive --depth=1 --progress --force

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compile Zig Object
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
if: runner.arch == 'X64'
with:
context: .
Expand All @@ -84,7 +84,7 @@ jobs:
outputs: type=local,dest=${{runner.temp}}/release

- name: Upload Zig Object
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tag }}
path: ${{runner.temp}}/release/bun-zig.o
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:

- name: Cache submodule dependencies
id: cache-deps-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: ${{runner.temp}}/bun-deps
key: bun-deps-${{ matrix.tag }}-${{ steps.submodule-versions.outputs.sha }}
Expand All @@ -159,13 +159,13 @@ jobs:
- name: Cache submodule dependencies
if: ${{ !steps.cache-deps-restore.outputs.cache-hit }}
id: cache-deps-save
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: ${{runner.temp}}/bun-deps
key: ${{ steps.cache-deps-restore.outputs.cache-primary-key }}

- name: Upload submodule dependencies
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tag }}-deps
path: ${{runner.temp}}/bun-deps
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
bash compile-cpp-only.sh -v
- name: Upload C++
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj/bun-cpp-objects.a
Expand Down Expand Up @@ -285,19 +285,19 @@ jobs:
echo "${{ runner.temp }}/.bun/bin" >> $GITHUB_PATH
- name: Download C++
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj

- name: Download Zig Object
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.obj }}
path: ${{ runner.temp }}/release

- name: Downloaded submodule dependencies
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.tag }}-deps
path: ${{runner.temp}}/bun-deps
Expand Down Expand Up @@ -330,11 +330,11 @@ jobs:
zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile
zip -r ${{matrix.tag}}.zip ${{matrix.tag}}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.tag}}-profile
path: ${{runner.temp}}/link-build/${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/link-build/${{matrix.tag}}.zip
Expand Down Expand Up @@ -394,12 +394,12 @@ jobs:
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
- id: download
name: Download
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release
Expand All @@ -426,6 +426,7 @@ jobs:
name: Test (node runner)
env:
SMTP_SENDGRID_SENDER: ${{ secrets.SMTP_SENDGRID_SENDER }}
TMPDIR: ${{runner.temp}}
TLS_MONGODB_DATABASE_URL: ${{ secrets.TLS_MONGODB_DATABASE_URL }}
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
# if: ${{github.event.inputs.use_bun == 'false'}}
Expand Down
33 changes: 17 additions & 16 deletions .github/workflows/bun-mac-x64-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compile Zig Object
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: false
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
outputs: type=local,dest=${{runner.temp}}/release

- name: Upload Zig Object
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tag }}
path: ${{runner.temp}}/release/bun-zig.o
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:

- name: Cache submodule dependencies
id: cache-deps-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
path: ${{runner.temp}}/bun-deps
key: bun-deps-${{ matrix.tag }}-${{ steps.submodule-versions.outputs.sha }}
Expand All @@ -164,13 +164,13 @@ jobs:
- name: Cache submodule dependencies
if: ${{ !steps.cache-deps-restore.outputs.cache-hit }}
id: cache-deps-save
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
path: ${{runner.temp}}/bun-deps
key: ${{ steps.cache-deps-restore.outputs.cache-primary-key }}

- name: Upload submodule dependencies
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tag }}-deps
path: ${{runner.temp}}/bun-deps
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
bash compile-cpp-only.sh -v
- name: Upload C++
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj/bun-cpp-objects.a
Expand All @@ -262,7 +262,7 @@ jobs:
runner: macos-12-large
artifact: bun-obj-darwin-x64-baseline
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive --depth=1 --progress --force

Expand All @@ -286,19 +286,19 @@ jobs:
echo "${{ runner.temp }}/.bun/bin" >> $GITHUB_PATH
- name: Download C++
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.tag }}-cpp
path: ${{ runner.temp }}/bun-cpp-obj

- name: Download Zig Object
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.obj }}
path: ${{ runner.temp }}/release

- name: Downloaded submodule dependencies
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ matrix.tag }}-deps
path: ${{runner.temp}}/bun-deps
Expand Down Expand Up @@ -331,11 +331,11 @@ jobs:
zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile
zip -r ${{matrix.tag}}.zip ${{matrix.tag}}
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.tag}}-profile
path: ${{runner.temp}}/link-build/${{matrix.tag}}-profile.zip
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/link-build/${{matrix.tag}}.zip
Expand Down Expand Up @@ -396,12 +396,12 @@ jobs:
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
- id: download
name: Download
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{matrix.tag}}
path: ${{runner.temp}}/release
Expand All @@ -428,6 +428,7 @@ jobs:
name: Test (node runner)
env:
SMTP_SENDGRID_SENDER: ${{ secrets.SMTP_SENDGRID_SENDER }}
TMPDIR: ${{runner.temp}}
TLS_MONGODB_DATABASE_URL: ${{ secrets.TLS_MONGODB_DATABASE_URL }}
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
# if: ${{github.event.inputs.use_bun == 'false'}}
Expand Down
Loading

0 comments on commit 6184542

Please sign in to comment.