Commit Graph

47 Commits

Author SHA1 Message Date
Dylan Conway
5590cd7d47 D16 VMs, pin Node 24.3.0, vs-shell for tests, ARM64 installers
- Use D16 VMs (16 vCPU) for all Windows CI runners
- Pin Node.js to 24.3.0 (ABI 137) for duckdb prebuilt + test compat
- Wrap test runner in vs-shell.ps1 so node-gyp has cl.exe
- Revert ccache persistent config (VMs are ephemeral)
- Restore Uninstall-Windows-Defender (reboot clears pending state)
- Add Windows ARM64 to install.ps1, install.sh, bun-release
- Set parallelism to 2 for Windows tests
- Clarify Packer vs CI runner VM sizes in comments

[build images]
2026-02-13 14:08:40 -08:00
Dylan Conway
b4908e7415 Fix Unix tools PATH: use Machine scope, add git usr/bin
- Cygwin: fix path to root/bin, use Machine scope (survives Sysprep)
- Git: add usr/bin to Machine PATH (ships cat, head, tail, echo, etc.)

Previously cygwin used User scope PATH which was wiped by Sysprep,
and the path was wrong (missing root/ prefix).

[build images]
2026-02-13 11:29:39 -08:00
Dylan Conway
f21e99a8dc Copy bun to System32 so it survives Sysprep
bun.sh/install.ps1 installs to user profile PATH which is lost
after Sysprep generalizes the image. Copy to C:\Windows\System32
like we do for ARM64.

[build images]
2026-02-13 09:07:48 -08:00
Dylan Conway
1f1118940a Fix nssm fallback: check if installed instead of try/catch
Install-Scoop-Package uses SilentlyContinue which never throws,
so the catch block (blob storage mirror) was unreachable. Now we
check if nssm is actually on PATH after the scoop attempt.

[build images]
2026-02-13 01:13:01 -08:00
Dylan Conway
8e9aeb7ad4 Don't uninstall Windows Defender feature — reboot blocks Sysprep
Uninstall-WindowsFeature -Name Windows-Defender returns
ExitCode=SuccessRestartRequired, and the pending reboot prevents
Sysprep from transitioning to IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE.
Disable-Windows-Defender already disables real-time monitoring.

[build images]
2026-02-13 00:38:12 -08:00
Dylan Conway
f1539f843e Route LLVM install through Install-Scoop-Package for error suppression
[build images]
2026-02-12 22:35:19 -08:00
Dylan Conway
aa098cfa6b Suppress scoop post_install errors for ALL packages
Move error suppression from Install-7zip to Install-Scoop-Package so
all scoop installs are resilient to non-fatal post_install errors
(7zip 7zr.exe locked, llvm-arm64 missing Uninstall.exe, etc).

[build images]
2026-02-12 22:22:24 -08:00
Dylan Conway
8f37779b8f Fix 7zip ARM64: suppress post_install error with SilentlyContinue
The Remove-Item error on 7zr.exe happens on ARM64 regardless of user
context (packer user, not just SYSTEM). Temporarily set ErrorActionPreference
to SilentlyContinue and convert all output streams to strings so the
error doesn't propagate to PowerShell's exit code.

[build images]
2026-02-12 22:11:27 -08:00
Dylan Conway
04528baa4a Revert manual 7zip install — Packer WinRM doesn't have the SYSTEM error
The ARM64 Remove-Item error only happens under Azure Run Command
SYSTEM context. With Packer's WinRM, scoop runs as the packer user
and the post_install cleanup works fine.

[build images]
2026-02-12 22:06:20 -08:00
Dylan Conway
cd3734895d Fix Packer integration: version, CI flag, gallery setup, build RG
- Packer 1.15.0 (1.12.0 had plugin checksum issues)
- bootstrap.ps1 reads CI from env var (Packer sets environment_vars)
- machine.mjs creates gallery image definition before Packer build
- Build RG is BUN-CI-EASTUS2 (eastus2 quota), gallery stays in BUN-CI
- ARM64 bun installed from blob storage

[build images]
2026-02-12 21:48:29 -08:00
Dylan Conway
34c893a3ed Install native ARM64 bun from blob storage on ARM64 machines 2026-02-12 21:43:22 -08:00
Dylan Conway
288b247f11 Re-launch bootstrap as native ARM64 PowerShell
Azure Run Command uses x64-emulated PowerShell on ARM64 VMs, which
causes all tools to think they're on x64. Use Sysnative path to
re-launch bootstrap as native ARM64 so PROCESSOR_ARCHITECTURE,
package installs, cmake, and everything else sees the real arch.

[build images]
2026-02-12 20:01:34 -08:00
Dylan Conway
da3246fd6b Fix ARM64 detection: use registry instead of env var
Azure Run Command runs x64-emulated PowerShell on ARM64 VMs, so
$env:PROCESSOR_ARCHITECTURE reports AMD64. The registry value at
HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
always reports the real architecture.

[build images]
2026-02-12 19:46:42 -08:00
Dylan Conway
85607af74f Debug: log PROCESSOR_ARCHITECTURE value
[build images]
2026-02-12 19:38:34 -08:00
Dylan Conway
4d3425702f Fix ARM64 detection: use PROCESSOR_ARCHITECTURE env var
RuntimeInformation.OSArchitecture doesn't exist in PowerShell 5.1
(which Azure Run Command uses), so IsARM64 was always false. This
caused ALL ARM64-specific code paths to be skipped.

[build images]
2026-02-12 19:29:50 -08:00
Dylan Conway
be321246fb Install 7zip manually on ARM64 to avoid Scoop post_install error
Scoop's 7zip ARM64 post_install script has an unfixable Remove-Item
error. Install 7zip directly from 7-zip.org instead.

[build images]
2026-02-12 19:19:12 -08:00
Dylan Conway
0620e2dba3 Fix 7zip ARM64: stringify error output to prevent re-throw
PowerShell 2>&1 | Out-Host passes ErrorRecord objects which re-trigger
ErrorActionPreference=Stop. Convert to strings first.

[build images]
2026-02-12 19:18:09 -08:00
Dylan Conway
4ec90d886b Fix bootstrap: run scoop in-process, isolate only 7zip ARM64
Child process scoop installs break PATH/shims. Only use child process
for 7zip on ARM64 (post_install error). Everything else runs in-process.
nssm falls back to blob storage mirror when nssm.cc is down.

[build images]
2026-02-12 17:56:47 -08:00
Dylan Conway
7a0c9047be Fix bootstrap: VS 3010 exit code, mingw command name
- VS installer exit code 3010 (reboot required) is not a real error
- mingw command is gcc, not mingw
- Use powershell -Command for scoop install isolation

[build images]
2026-02-12 17:44:23 -08:00
Dylan Conway
632b5bb2e8 Make cygwin install non-fatal
Cygwin mirror can be unreachable from Azure VMs. Don't block
the entire bootstrap if cygwin fails to install.

[build images]
2026-02-12 17:17:32 -08:00
Dylan Conway
0cefa2c753 Run scoop install in child process to isolate errors
Scoop's 7zip post_install throws a terminating error on ARM64 that
propagates regardless of ErrorActionPreference. Running scoop in a
child PowerShell process isolates the error completely.

[build images]
2026-02-12 17:08:23 -08:00
Dylan Conway
24e3598d2b Also pre-delete 7zr.exe before 7zip install
[build images]
2026-02-12 17:08:09 -08:00
Dylan Conway
4f0546f919 Fix 7zip ARM64: install before git + suppress scoop errors
7zip is a Scoop dependency of git. On ARM64 SYSTEM, 7zip's post_install
fails trying to delete 7zr.exe from TEMP. Fix by:
1. Moving Install-7zip before Install-Git so it's already installed
2. Using SilentlyContinue in Install-Scoop-Package then verifying

[build images]
2026-02-12 17:04:50 -08:00
Dylan Conway
928fc7888b Fix 7zip: use SilentlyContinue for scoop install
The Remove-Item error in Scoop's 7zip post_install is a terminating
error that propagates through try/catch. Use SilentlyContinue to
suppress it, then verify 7z is actually installed.

[build images]
2026-02-12 16:54:38 -08:00
Dylan Conway
1980c8e12a Fix 7zip install: use try/catch for post_install cleanup error
[build images]
2026-02-12 16:43:56 -08:00
Dylan Conway
4056e5927f Fix bootstrap failures on Azure VMs
- 7zip: tolerate post_install cleanup error (access denied on TEMP)
- Rust: set CARGO_HOME/RUSTUP_HOME before rustup-init to avoid
  SYSTEM profile path issue (Move-Item failure)
- nssm: fall back to blob storage mirror when nssm.cc returns 503
2026-02-12 16:12:20 -08:00
Dylan Conway
ecd6d8ea68 [build images] 2026-02-12 11:38:12 -08:00
Dylan Conway
4aafb2a29f [build images] 2026-02-11 21:56:09 -08:00
Dylan Conway
4bfd1562b8 fix: install ARM64 Node.js on Windows ARM64
Chocolatey nodejs installs x64, causing esbuild postinstall scripts to
misdetect the platform and look for @esbuild/win32-x64 instead of
win32-arm64.
2026-02-04 22:15:48 -08:00
Dylan Conway
fd07535f4e fix: install ARM64 native cmake and LLVM on Windows ARM64
On ARM64 Windows, Chocolatey installs x64 cmake and LLVM. x64 cmake
reads PROCESSOR_ARCHITECTURE=AMD64 (overridden by OS for x64 processes),
causing CMAKE_SYSTEM_PROCESSOR=AMD64 and -march=haswell to be passed to
ARM64 clang-cl.

- Add ARM64 detection to bootstrap.ps1
- Install cmake ARM64 MSI directly from GitHub on ARM64
- Install LLVM ARM64 (woa64) installer directly from GitHub on ARM64
- Skip nasm (x86 assembler) and mingw on ARM64
- Warn about bun ARM64 not being available via Chocolatey
2026-02-04 20:54:22 -08:00
Dylan Conway
5b69da3111 update 2026-02-04 20:30:00 -08:00
Dylan Conway
41de7a3bfb [publish images] Upgrade LLVM toolchain from 19.1.7 to 21.1.8 (#26667)
## Summary
- Update LLVM version references across build scripts, Dockerfiles, CI,
Nix configs, and documentation
- Fix LLVM 21 `-Wcharacter-conversion` errors in WebKit bindings:
- `EncodingTables.h`: pragma for intentional char32_t/char16_t
comparisons
- `TextCodecCJK.cpp`: widen `gb18030AsymmetricEncode` param to char32_t
- `URLPatternParser`: widen `isValidNameCodepoint` param to char32_t,
cast for `startsWith`
- Fix `__libcpp_verbose_abort` noexcept mismatch (LLVM 21 uses
`_NOEXCEPT`)
- Fix dangling pointer in `BunJSCModule.h` (`toCString` temporary
lifetime)
- Remove `useMathSumPreciseMethod` (removed upstream in JSC)

**Before merging:** Merge https://github.com/oven-sh/WebKit/pull/153
first, then update `WEBKIT_VERSION` in `cmake/tools/SetupWebKit.cmake`
to point to the merged commit.

## Test plan
- [ ] Build bun debug on macOS with LLVM 21
- [ ] Build bun on Linux (glibc)
- [ ] Build bun on Linux (musl)
- [ ] Build bun on Windows
- [ ] Run test suite

Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-02 23:12:21 -08:00
robobun
81b4a40fbd [publish images] Remove sccache, use ccache only (#25682)
## Summary
- Remove sccache support entirely, use ccache only
- Missing ccache no longer fails the build (just skips caching)
- Remove S3 distributed cache support

## Changes
- Remove `cmake/tools/SetupSccache.cmake` and S3 distributed cache
support
- Simplify `CMakeLists.txt` to only use ccache
- Update `SetupCcache.cmake` to not fail when ccache is missing
- Replace sccache with ccache in bootstrap scripts (sh, ps1)
- Update `.buildkite/Dockerfile` to install ccache instead of sccache
- Update `flake.nix` and `shell.nix` to use ccache
- Update documentation (CONTRIBUTING.md, contributing.mdx,
building-windows.mdx)
- Remove `scripts/build-cache/` directory (was only for sccache S3
access)

## Test plan
- [x] Build completes successfully with `bun bd`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-12-26 20:24:27 -08:00
Marko Vejnovic
3a810da66c build(ENG-21466): Fix sccache not caching across builds (#24423) 2025-11-07 14:33:26 -08:00
Marko Vejnovic
782f684b2e build(ENG-21330): Replace ccache with sccache (#24200) 2025-11-05 14:30:56 -08:00
Meghan Denny
a2b262ed69 ci: update bun version to 1.3.1 (#24053) [publish images] 2025-10-25 15:53:02 -07:00
190n
97a530d832 [publish images] [BAPI-2103] use gdb and bun.report code to print stack traces upon crash in CI (#21143)
### What does this PR do?

Closes #13012

On Linux, when any Bun process spawned by `runner.node.mjs` crashes, we
run GDB in batch mode to print a backtrace from the core file.

And on all platforms, we run a mini `bun.report` server which collects
crashes reported by any Bun process executed during the tests, and after
each test `runner.node.mjs` fetches and prints any new crashes from the
server.

<details>
<summary>example 1</summary>

```
#0  crash_handler.crash () at crash_handler.zig:1513
#1  0x0000000002cf4020 in crash_handler.crashHandler (reason=..., error_return_trace=0x0, begin_addr=...) at crash_handler.zig:479
#2  0x0000000002cefe25 in crash_handler.handleSegfaultPosix (sig=<optimized out>, info=<optimized out>) at crash_handler.zig:800
#3  0x00000000045a1124 in WTF::jscSignalHandler (sig=11, info=0x7ffe044e30b0, ucontext=0x0) at vendor/WebKit/Source/WTF/wtf/threads/Signals.cpp:548
#4  <signal handler called>
#5  JSC::JSCell::type (this=0x0) at vendor/WebKit/Source/JavaScriptCore/runtime/JSCellInlines.h:137
#6  JSC::JSObject::getOwnNonIndexPropertySlot (this=0x150bc914fe18, vm=..., structure=0x150a0102de50, propertyName=..., slot=...) at vendor/WebKit/Source/JavaScriptCore/runtime/JSObject.h:1348
#7  JSC::JSObject::getPropertySlot<false> (this=0x150bc914fe18, globalObject=0x150b864e0088, propertyName=..., slot=...) at vendor/WebKit/Source/JavaScriptCore/runtime/JSObject.h:1433
#8  JSC::JSValue::getPropertySlot (this=0x7ffe044e4880, globalObject=0x150b864e0088, propertyName=..., slot=...) at vendor/WebKit/Source/JavaScriptCore/runtime/JSCJSValueInlines.h:1108
#9  JSC::JSValue::get (this=0x7ffe044e4880, globalObject=0x150b864e0088, propertyName=..., slot=...) at vendor/WebKit/Source/JavaScriptCore/runtime/JSCJSValueInlines.h:1065
#10 JSC::LLInt::performLLIntGetByID (bytecodeIndex=..., codeBlock=0x150b861e7740, globalObject=0x150b864e0088, baseValue=..., ident=..., metadata=...) at vendor/WebKit/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:878
#11 0x0000000004d7b055 in llint_slow_path_get_by_id (callFrame=0x7ffe044e4ab0, pc=0x150bc92ea0e7) at vendor/WebKit/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:946
#12 0x0000000003dd6042 in llint_op_get_by_id ()
#13 0x0000000000000000 in ?? ()
```

</details>

<details>
<summary>example 2</summary>

```
  #0  crash_handler.crash () at crash_handler.zig:1513
  #1  0x0000000002c5db80 in crash_handler.crashHandler (reason=..., error_return_trace=0x0, begin_addr=...) at crash_handler.zig:479
  #2  0x0000000002c59f60 in crash_handler.handleSegfaultPosix (sig=<optimized out>, info=<optimized out>) at crash_handler.zig:800
  #3  0x00000000042ecc88 in WTF::jscSignalHandler (sig=11, info=0xfffff60141b0, ucontext=0xfffff6014230) at vendor/WebKit/Source/WTF/wtf/threads/Signals.cpp:548
  #4  <signal handler called>
  #5  bun.js.api.FFIObject.Reader.u8 (globalObject=0x4000554e0088) at /var/lib/buildkite-agent/builds/ip-172-31-75-92/bun/bun/src/bun.js/api/FFIObject.zig:65
  #6  bun.js.jsc.host_fn.toJSHostCall__anon_1711576 (globalThis=0x4000554e0088, args=...) at /var/lib/buildkite-agent/builds/ip-172-31-75-92/bun/bun/src/bun.js/jsc/host_fn.zig:97
  #7  bun.js.jsc.host_fn.DOMCall("Reader"[0..6],bun.js.api.FFIObject.Reader,"u8"[0..2],.{ .reads = .{ ... }, .writes = .{ ... } }).slowpath (globalObject=0x4000554e0088, thisValue=70370172175040, arguments_ptr=0xfffff6015460, arguments_len=1) at /var/lib/buildkite-agent/builds/ip-172-31-75-92/bun/bun/src/bun.js/jsc/host_fn.zig:490
  #8  0x000040003419003c in ?? ()
  #9  0x0000400055173440 in ?? ()
```

</details>

I used GDB instead of LLDB (as the branch name suggests) because it
seems to produce more useful stack traces with musl libc.

- [x] on linux, use gdb to print from core dump of main bun process
crashed
- [x] on linux, use gdb to print from all new core dumps (so including
bun subprocesses spawned by the test that crashed)
- [x] on all platforms, use a mini bun.report server to print a
self-reported trace (depends on oven-sh/bun.report#15; for now our
package.json points to a commit on the branch of that repo)
- [x] fix trying to fetch stack traces too early on windows
- [x] use output groups so the traces show up alongside the log for the
specific test instead of having to find it in the logs from the entire
run
- [x] get oven-sh/bun.report#15 merged, and point to a bun.report commit
on the main branch instead of the PR branch in package.json

### How did you verify your code works?

Manually, and in CI with a crashing test.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-24 23:32:54 -07:00
Meghan Denny
a242c878c3 [publish images] ci: add ubuntu 25.04 (#20996)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2025-07-15 01:22:41 -07:00
190n
172aecb02e [publish images] Upgrade self-reported Node.js version from 22.6.0 to 24.3.0 (v2) (#20772)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-02 12:06:08 -07:00
Ben Grant
ea57037567 Revert "Upgrade self-reported Node.js version from 22.6.0 to 24.3.0 (#20659) [publish images]"
This reverts commit 80309e4d59. It breaks the Windows CI.
2025-07-02 09:40:32 -07:00
Jarred Sumner
80309e4d59 Upgrade self-reported Node.js version from 22.6.0 to 24.3.0 (#20659) [publish images]
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: pfgithub <6010774+pfgithub@users.noreply.github.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Ben Grant <ben@bun.sh>
2025-07-02 00:03:05 -07:00
Ashcon Partovi
da87890532 ci: Fix build image step with zig (#20023) 2025-05-29 16:07:35 -07:00
Meghan Denny
f2c8e63ae1 update to llvm 19 and c++ 23 (#18317)
Co-authored-by: nektro <5464072+nektro@users.noreply.github.com>
2025-03-20 21:44:19 -07:00
Ashcon Partovi
fa6ac405a4 ci: Add bootstrap.ps1 and automate Windows build images (#15606) 2024-12-05 15:16:37 -07:00
Meghan Denny
61cc9c3947 Revert "ci: Add bootstrap.ps1 and automate Windows build images" (#15591) 2024-12-04 17:07:35 -08:00
Ashcon Partovi
e904a181d8 ci: Add bootstrap.ps1 and automate Windows build images (#15466)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-12-04 17:33:00 -07:00
Ashcon Partovi
708ed00705 ci: Expand automated build images to Debian, Ubuntu, and Amazon Linux (#15250) 2024-11-19 19:31:15 -07:00