Skip to content

ci: release pipeline for tagged fork builds - #8

Merged
steipete merged 13 commits into
mainfrom
claude/openclaw-release-pipeline
Sep 27, 2026
Merged

steipete merged 13 commits into
mainfrom
claude/openclaw-release-pipeline

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown

What does this PR do?

Adds a release pipeline for tagged commits of this fork's main. The workflow is .github/workflows/openclaw-release.yml. Its steps are commands of scripts/openclaw-release/release.ts and sign-macos.sh, so each step can also run on a Crabbox lease or a Mac. .github/OPENCLAW_RELEASE.md documents the pipeline, cadence and open decisions.

First release: openclaw-v1.4.3-20260925-9e3414b3f7-webkit-35e8970dfd builds main at 9e3414b3 against WebKit 35e8970d. It is a prerelease and not "latest". Its darwin assets are not Developer-ID signed (decision 1). It was published by run 36294392271, dispatched from this branch because main doesn't have the workflow yet.

  • Targets: darwin-arm64, darwin-x64, linux-x64 and linux-arm64 (glibc ≥ 2.17). All four are cross-compiled on upstream's own build image: Debian 13 arm64, the scripts/build/ci-images/spec.ts bootstrap that Buildkite bakes. They build with --profile=release --ci=on: ThinLTO, path remapping, and binary checks as errors. The pipeline runs the source commit's toolchain sections rather than copying pins. A unit test fails if upstream renames one.

  • Tag scheme: openclaw-v<version>-<YYYYMMDD>-<fork commit>-webkit-<WebKit revision>[-r<n>]. release.ts tag prints the tag for a commit. The plan job refuses a tag that disagrees with its commit or WebKit pin, and refuses to publish a commit that isn't on main. The publish job refuses a tag that moved after planning.

  • Assets:

    • upstream-layout zips (bun-<os>-<arch>.zip, plus -profile.zip with symbols, linker map and dSYM)
    • SHA256SUMS
    • manifest.json (schema v1): archive and extracted-executable URL, size and SHA-256, fork commit, bun --revision, WebKit revision and prebuilt, minimum OS, signing state
    • build provenance attestations

    Zips are byte-reproducible: sorted entries, fixed UTC mtimes, zip -X.

  • Smoke tests run each zip on its own platform: macos-15, macos-15-intel, ubuntu-24.04, ubuntu-24.04-arm, plus Alpine and windows-2025 for the optional targets. They check:

    • Bun.revision and process.versions.webkit; the latter closes the gap Bun.revision leaves
    • platform and arch
    • that the DFG JIT actually compiles
    • the code signature, on macOS
  • macOS: the sign-macos job signs with the hardened runtime and entitlements.plist, then notarizes. It reads the release fleet's secret names (MACOS_SIGNING_P12, MACOS_SIGNING_P12_PASSWORD, ASC_KEY_ID, ASC_ISSUER_ID, ASC_PRIVATE_KEY_P8), never in pull requests. It runs in an openclaw-release environment when publishing. Without secrets, the executables stay as upstream links them (arm64 ad-hoc signed, x64 unsigned), and the manifest and release notes say so.

  • Dry runs: every PR that touches the pipeline, and every tagless dispatch, builds and smoke-tests everything. The would-be release is uploaded as the release artifact.

  • The upstream-sync and security-patch cadence is in the doc, with a pointer from UPSTREAM_SYNC.md and a CHANGELOG entry.

Where builds run, and what they cost

Measured on main 9e3414b3. None of this needed paid or new capacity.

Host Provision ninja Per target job Cost per release
GitHub ubuntu-24.04-arm (4 vCPU, 16 GB, 108 GB free disk) 2–14 min 9.0–9.4 min 12–25 min $0 (public repo)
Crabbox r8g.4xlarge spot (16 vCPU), sequential 2–4.5 min 4.0–4.5 min 20 min for all 4 ≈ $0.20
Blacksmith 16vcpu-ubuntu-2404-arm (not tried; app already installed here) — ≈ 5 min est. ≈ 7–10 min ≈ $1 (est., $0.02/min)
  • Provisioning variance is download time. One darwin-x64 job spent 12 min fetching Rust std for 11 targets; another run's apt.llvm.org key fetch failed, so provisioning now retries four times over about 12 minutes, each in a fresh container.
  • Peak memory was about 11 GB with 16 parallel jobs.
  • Evaluation targets on GitHub runners: windows-x64 took 17 min to provision (xwin) plus 12 min to build; musl took 4–10 plus 10 min.
  • Recommendation: stay on free GitHub runners. vars.OPENCLAW_RELEASE_BUILD_RUNNER switches the build runner if latency ever matters.

Decisions for Peter

  1. Where macOS signing keys live. This repo has no signing secrets, so the first release's darwin assets are not Developer-ID signed or notarized.
    • (a) Add the fleet secrets to an openclaw-release environment of openclaw/bun, restricted to openclaw-v* tags, then set OPENCLAW_RELEASE_REQUIRE_SIGNING=true. Recommended.
    • (b) Sign in openclaw/releases.
    • (c) Stay unsigned. The Mac app re-signs anyway, but browser downloads fail Gatekeeper.
  2. WebKit. [JSC] StringAt, StringCharCodeAt and StringCodePointAt must survive DCE oven-sh/WebKit#578, the FTL string-bounds fix, is still open, and its preview is 392 commits behind the pinned 35e8970. These releases therefore lack the fix that the current setup-test-bun build (steipete/bun openclaw-ci-ddfce5d0-webkit-4429d113) carries. Switching OpenClaw CI to these releases would bring back the CSS tokenizer loop. Either get fix(types): add missing types for WebSocket oven-sh/bun#578 merged upstream, or stand up an openclaw/WebKit prebuilt pipeline. That pipeline needs 32-core runners (steipete/WebKit's attempt sat queued for 24 h without them), which means GitHub larger runners on the Team plan: a few dollars per WebKit revision. It also needs a small fork-only webkit.ts change.
  3. Tag protection: add a ruleset for openclaw-v* tags (create restricted, no update or delete).
  4. Release visibility: releases publish as prereleases with --latest=false until vars.OPENCLAW_RELEASE_PRERELEASE=false.
  5. musl and Windows: musl stays out of releases until a consumer needs it. windows-x64 needs an Authenticode certificate (Azure Trusted Signing or DigiCert KeyLocker) first.
  6. Cadence: a weekly release after the upstream sync lands, and security fixes within one working day (details in the doc).
  7. Cached builder image (optional): push the provisioned container to ghcr.io/openclaw/bun-release-builder:<script hash> once per toolchain change. That takes apt.llvm.org and the other download hosts out of routine releases and saves 2–14 min per job. It's free for a public package, but it adds a package and packages: write.

Follow-ups outside this repo:

  • openclaw's scripts/codesign-mac-app.sh has no Bun entry in its JIT-runtime list, so it would sign an embedded Bun without allow-jit. The new smoke test shows that makes Bun silently fall back to the interpreter.
  • Its runtime entitlements also lack disable-library-validation, which native addons need.
  • The Tauri app has no runtime pin yet; manifest.json is meant for it.

How did you verify your code works?

  • This PR's dry run on the final head (36296369162, ac3f678) passed all of: plan and unit tests, four builds in 12–14 min each, signing pass-through, four native smoke tests (including the DFG JIT probe) and the manifest. One earlier run on cad10f2 lost linux-arm64 to apt.llvm.org failing all three attempts, which led to the backoff above.

  • First release (36294392271), fetched through the public download URLs:

    • all zips and manifest.json match SHA256SUMS
    • manifest.json's executable.sha256 matches the extracted darwin-arm64 binary
    • gh attestation verify passes for a zip and for the manifest; the signer is this workflow on this branch
    • on this Mac, the released darwin-arm64 binary, and darwin-x64 under Rosetta, report 1.4.3-canary.1+9e3414b3f and WebKit 35e8970d…, and compile with the DFG JIT

    One caveat: right after upload, …/download/…/manifest.json answered HTTP 500 for about a minute before serving normally, so consumers should use curl --retry.

  • musl and windows-x64 (36291753474): all three targets built and ran on Alpine and windows-2025 with the right revision and WebKit. That run is red only because it still had an earlier, wrong expected value in the smoke test, since fixed.

  • Crabbox (AWS r8g.4xlarge, lease cbx_372d08571181, released): the same scripts built all four targets in 4.0–4.5 min each. The cross-built darwin binaries run on macOS.

  • macOS signing proof, run locally. I imported the fleet's Foundation p12 from 1Password into a throwaway keychain and ran sign-macos.sh on this machine:

    • darwin-arm64 came out signed Developer ID Application: OpenClaw Foundation (FWJYW4S8P8), with the hardened runtime, a secure timestamp and all five entitlements
    • the signed binary passes the JIT probe; a hardened signature without allow-jit fails it
    • notarization is not proven end to end. App Store Connect auth worked and submissions were created, but this Mac's uplink (~20 KB/s) made notarytool's 5 MB S3 parts time out. A GitHub macOS runner won't have that problem.
  • Checks: bun test test/internal/source-lints/openclaw-release.test.ts (6 tests), actionlint, shellcheck, the repo's prettier with organize-imports, and tsc under scripts/tsconfig.json's strict settings.

    • zizmor reports only three low "self-repository" notes; the other workflows get the same.

Problems these runs caught, fixed in this PR:

  • cmake 3 can't parse zip mtimes, so zips now use zip -X
  • upstream's CI environment report needs GitHub run variables the container lacks
  • apt.llvm.org failed a job's attempts twice, the second time for minutes on end, so provisioning now retries with backoff
  • upstream ships darwin-x64 unsigned
  • a JIT check that couldn't detect a missing allow-jit

Side effects:

  • pushed the tag openclaw-v1.4.3-20260925-9e3414b3f7-webkit-35e8970dfd
  • published the prerelease
  • the publish run auto-created an empty openclaw-release environment (no secrets, no protection rules)
  • a few App Store Connect notary submissions that never finished uploading

Cross-compile darwin-arm64, darwin-x64, linux-x64 and linux-arm64 on the
upstream build image, smoke-test each executable on its own platform, sign
and notarize the darwin ones when the openclaw-release environment has a
Developer ID, and publish zips, SHA256SUMS, a pinnable manifest.json and
build provenance attestations.
@autofix-troubleshooter

Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

cmake 3 cannot parse the --mtime the zips were stamped with, and its zip
writer records access and creation times. Stamp the staged files and let
Info-ZIP write sorted entries in UTC instead, so a zip depends only on its
files. Inside the build container, GITHUB_ACTIONS made the build's
environment report ask for run variables the container does not have.
Also refuse to publish when the tag moved after it was planned, and state
the glibc floor the binary check enforces (2.17), not the sysroot's.
…ected value

The JIT loop sums 7i for i < 3e7 mod 1000003, which is 28665. Packaging
now dereferences symlinks, and sign-macos.sh takes SIGN_KEYCHAIN so a Mac
whose own keychain also holds the identity signs from the imported one.
The upstream bootstrap downloads from a dozen hosts (apt.llvm.org's key
was briefly unreachable in one run) and cannot be rerun in place. Each
attempt now starts from a clean debian:13 container, and the build runs in
the one that provisioned.
Upstream links darwin-x64 without a code signature (only arm64 gets the
linker's ad-hoc one), so the smoke test verifies a signature only where one
exists, and the manifest records "none" for it.
Without allow-jit JavaScriptCore falls back to its interpreter and the loop
still computes the right sum, so the old check could not see a missing
entitlement. numberOfDFGCompiles reports JSC's 1000000 sentinel when the
JIT is unavailable; a real compile reports a small count.
@socket-security

socket-security Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

@steipete
steipete marked this pull request as ready for review September 27, 2026 04:51
apt.llvm.org served its key's HEAD but failed the download for three
attempts a minute apart on one runner while the other jobs of the run
provisioned. Wait 2, 4 and 6 minutes between four attempts instead, and
document a cached builder image as the structural fix.
@steipete
steipete merged commit 1817bc1 into main Sep 27, 2026
17 checks passed
@steipete
steipete deleted the claude/openclaw-release-pipeline branch September 27, 2026 05:48
steipete pushed a commit to fuller-stack-dev/bun that referenced this pull request Oct 20, 2026
…module-graph.test.ts (oven-sh#45674)

### What does this PR do?

Fixes the flaky "50 graphs alive at once, each with its own state, then
all exit and are collected" in
`test/js/bun/module-graph/module-graph.test.ts`. It failed in 2 of 31
builds of main, 125686 to 127114 (Ubuntu 25.04 x64, Windows 11 aarch64)
and passed on the retry.

The test registered one array, `graphs[25].big`, with a
`FinalizationRegistry` and failed if 100 collections did not finalize
it. It now tracks the array of every one of the 50 graphs with
`Lifetimes` from `module-graph-lifetimes.ts`, as
`module-graph-gc.test.ts` does. There, an object that is not finalized
counts as kept alive only if a root reaches it in the debugging heap
snapshot, and the failure message is the path from that root.

Two things change with the helper, and the first is what makes the runs
below pass:

1. **Where the collection runs.** The helper calls `Bun.gc(true)` from a
timer callback, main's `collected()` from the continuation of the async
test. The `runInternalMicrotask` frame that holds the stale word
(artifact 2) is not on the stack in a timer callback. In 240 of 240 runs
all 50 arrays were finalized by the first collection.
2. **What is asserted if one is left.** Not that it was finalized, but
that no root reaches it.

### Why it failed

On main one of the 50 graphs outlives the collections in almost every
run, and the test fails when that one is number 25. Whole file, CI's
environment, 840 runs:

| graphs left after the collections | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| runs | 2 | 802 | 3 | 33 |

12 of the 840 failed. In the failing runs looked at (9 heap snapshots,
12 stack dumps) nothing in the heap holds the one that is left, and one
word on the native stack points at it.

All of what follows is the Linux x64 binary that CI built for main at
7f3bc6a, with `BUN_GARBAGE_COLLECTOR_LEVEL=1
BUN_RUNTIME_TRANSPILER_CACHE_PATH=0` as in `scripts/runner.node.ts`. The
failure needs both that environment and the whole file: 0 of 240 without
the environment, 0 of 1600 with the test alone. I did not look at the
Windows failure.

<details><summary>Artifact 1: the heap snapshot</summary>

`generateHeapSnapshotForDebugging()` right after the 100 collections.
These are the array and every cell from which it can be reached:

```
snapshot: 27033 cells, 99750 edges, 586 roots; arrays named `big` still in it: 1
  cell   1532 Promise                0x34cf520fa40  incoming edges 0  in `roots` no  a root reaches it no
  cell   1555 ModuleRecord           0x34cf527e980  incoming edges 3  in `roots` no  a root reaches it no
  cell   1573 ModuleNamespaceObject  0x34cef51dd50  incoming edges 3  in `roots` no  a root reaches it no
  cell   1591 JSModuleEnvironment    0x34cf5278950  incoming edges 3  in `roots` no  a root reaches it no
  cell   1626 Array                  0x34cef3755a0  incoming edges 2  in `roots` no  a root reaches it no
  cell   1631 Function               0x34cef45a100  incoming edges 2  in `roots` no  a root reaches it no
  cell   1653 Function               0x34cef45a0e0  incoming edges 2  in `roots` no  a root reaches it no
```

The snapshots of 8 other failing runs have the same seven kinds of cell,
with the `Promise` (fulfilled with the `ModuleRecord`) as the only one
without an incoming edge.
</details>

<details><summary>Artifact 2: the stack word and the frame that owns it
(gdb, same run as artifact 1)</summary>

The test writes the snapshot and sends itself SIGUSR2, and gdb stops
there.

```
Thread 1 "bun-profile" received signal SIGUSR2, User defined signal 2.
(gdb) info registers rsp rbp
rsp            0x7fffffffa0c8
rbp            0x7fffffffa240

words in [rsp, end of stack) = [0x7fffffffa0c8, 0x7ffffffff000) that point into one of those cells: 1
  0x7fffffffa8a0 holds 0x34cf520fa40 = Promise+0; it lies in the frame with rbp 0x7fffffffa8f0, at rbp-0x50
(gdb) x/gx 0x7fffffffa8a0
0x7fffffffa8a0:	0x0000034cf520fa40
(gdb) info symbol 0x1bccee0        # where that frame's callee returns to
JSC::runInternalMicrotask(...) + 6976

rbp chain
  openclaw#3  rbp 0x7fffffffa540  Bun::Process_functionKill
  openclaw#4  rbp 0x7fffffffa550  (JIT code)
  openclaw#5  rbp 0x7fffffffa5d0  op_call_ignore_result_return_location
  openclaw#6  rbp 0x7fffffffa680  llint_call_javascript
  openclaw#7  rbp 0x7fffffffa7e0  JSC::asyncFunctionGeneratorBodyCall
  openclaw#8  rbp 0x7fffffffa8f0  JSC::runInternalMicrotask            <- owns 0x7fffffffa8a0
  openclaw#9  rbp 0x7fffffffab70  JSC::MicrotaskQueue::drainWithUseCallOnEachMicrotask
  openclaw#10 rbp 0x7fffffffac00  JSC::VM::drainMicrotasks
  openclaw#11 rbp 0x7fffffffac20  Zig::GlobalObject::drainMicrotasks
  openclaw#12 rbp 0x7fffffffac50  <bun_jsc::event_loop::EventLoop>::exit
  openclaw#13 rbp 0x7fffffffacf0  TimerObjectInternals::fire
```

12 failing runs that dumped their own stack from `/proc/self/mem` show
the same: one word, `Promise+0`, at `rbp-0x50` of
`runInternalMicrotask`. In the 5 of them where I looked for it, the
frame's callee returns to the same `0x1bccee0`, which is
`JSMicrotask.cpp:2053`.

**Who wrote it.** A hardware watchpoint on `0x7fffffffa8a0`, set at the
first line of the test, sees 10 writes. The last one is the `Promise`:
`pushq %r14` in the prologue of `JSC::ModuleGraphLoadingState::create`
(`ModuleGraphLoadingState.cpp:71`, rbp `0x7fffffffa8b0`), which saves a
register of its caller.

**Why it stays.** The 100 collections run in the continuation of an
async function, so each runs under a `runInternalMicrotask` frame at
that same address. In the disassembly the function has 9 stores to
`-0x50(%rbp)`. Following the jump table and every branch, only case 14
of the switch (resume an async function) reaches the call at
`JSMicrotask.cpp:2053`, and none of the 9 stores is on a way to it. The
slot is inside a live frame, so stack sanitizing does not cover it.

So the graph that is left is the one whose load called `create` last at
that depth.
</details>

### How did you verify your code works?

**Failure rate.** Whole file, 12 copies side by side, main and this PR
in alternating rounds:

| | main | this PR |
|---|---|---|
| runs that failed | 12 of 1200 (all this test) | 0 of 1200 |

**What the snapshot says about a survivor.** With this PR there was none
to ask about: in those 240 runs, with a logging copy of the helper, the
snapshot was never taken. So this is main's test as it is, followed by
the helper's `Heap` asked about the 50 addresses, 1080 runs. The old
assertion failed in 12 of them. In 11 the array was in the snapshot with
no root reaching it, in 1 it was gone by then, in 0 a root reached it.

In 7 of the 1080 runs a root did reach two other arrays. In the one run
whose paths were printed, both start at `root(JITWorkList)`, a
compilation that is still running. `stillAlive` goes on collecting while
a root reaches something.

**Real references must fail.** One line added before `graphs.length =
0`. All 9 fail, with these messages:

| graph 25 is held by | message |
|---|---|
| a global, the namespace | `root(ProtectedValues) GlobalObject
-Property:held-> ModuleNamespaceObject -> ModuleRecord ->
JSModuleEnvironment -> Array` |
| a global closure over `inc` | `root(ProtectedValues) GlobalObject
-Property:held-> Function -> JSLexicalEnvironment -Variable:inc->
Function(inc) -> JSModuleEnvironment -> Array` |
| a local of the suspended test | `root(Output) FunctionCodeBlock -> ...
-Variable:pendingHeap-> Promise -> AsyncFunctionGenerator -> ...` |
| `setInterval(inc)` | `root(StrongHandles) StrongRootBlock -> Timeout
-Property:callback-> Function(inc) -> JSModuleEnvironment
-Variable:big-> Array` |
| `process.on(..., inc)` | `root(ProtectedValues) GlobalObject ->
Process -> Function(inc) -> JSModuleEnvironment -Variable:big-> Array` |
| a reaction of a pending promise | `root(ProtectedValues) GlobalObject
-Property:held-> Promise -> Function(inc) -> JSModuleEnvironment
-Variable:big-> Array` |
| a `FinalizationRegistry` held value | `root(ProtectedValues)
GlobalObject -Property:held-> FinalizationRegistry -> Array` |
| a `WeakMap` value of a live key | `root(Output) Array` |
| an `AbortSignal` listener | `root(WeakSets) AbortSignal ->
Function(inc) -> JSModuleEnvironment -Variable:big-> Array` |

With `globalThis.held = graphs[7]` instead, main's test passes 5 of 5
and this PR's fails 5 of 5.

**Debug build**, default timeout: the test passes 6 of 6 alone and in 6
of 6 runs of the whole file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants