Repository navigation
ci: release pipeline for tagged fork builds - #8
Conversation
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.
|
Hi! I'm the 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.
… notarize script does
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.
|
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. |
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.
…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.
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 ofscripts/openclaw-release/release.tsandsign-macos.sh, so each step can also run on a Crabbox lease or a Mac..github/OPENCLAW_RELEASE.mddocuments the pipeline, cadence and open decisions.First release:
openclaw-v1.4.3-20260925-9e3414b3f7-webkit-35e8970dfdbuildsmainat9e3414b3against WebKit35e8970d. 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 becausemaindoesn'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.tsbootstrap 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 tagprints 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 onmain. The publish job refuses a tag that moved after planning.Assets:
bun-<os>-<arch>.zip, plus-profile.zipwith symbols, linker map and dSYM)SHA256SUMSmanifest.json(schema v1): archive and extracted-executable URL, size and SHA-256, fork commit,bun --revision, WebKit revision and prebuilt, minimum OS, signing stateZips 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 andwindows-2025for the optional targets. They check:Bun.revisionandprocess.versions.webkit; the latter closes the gapBun.revisionleavesmacOS: the
sign-macosjob signs with the hardened runtime andentitlements.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 anopenclaw-releaseenvironment 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
releaseartifact.The upstream-sync and security-patch cadence is in the doc, with a pointer from
UPSTREAM_SYNC.mdand a CHANGELOG entry.Where builds run, and what they cost
Measured on
main9e3414b3. None of this needed paid or new capacity.ubuntu-24.04-arm(4 vCPU, 16 GB, 108 GB free disk)r8g.4xlargespot (16 vCPU), sequential16vcpu-ubuntu-2404-arm(not tried; app already installed here)apt.llvm.orgkey fetch failed, so provisioning now retries four times over about 12 minutes, each in a fresh container.vars.OPENCLAW_RELEASE_BUILD_RUNNERswitches the build runner if latency ever matters.Decisions for Peter
openclaw-releaseenvironment ofopenclaw/bun, restricted toopenclaw-v*tags, then setOPENCLAW_RELEASE_REQUIRE_SIGNING=true. Recommended.openclaw/releases.35e8970. These releases therefore lack the fix that the currentsetup-test-bunbuild (steipete/bunopenclaw-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 anopenclaw/WebKitprebuilt 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-onlywebkit.tschange.openclaw-v*tags (create restricted, no update or delete).--latest=falseuntilvars.OPENCLAW_RELEASE_PRERELEASE=false.ghcr.io/openclaw/bun-release-builder:<script hash>once per toolchain change. That takesapt.llvm.organd 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 andpackages: write.Follow-ups outside this repo:
openclaw'sscripts/codesign-mac-app.shhas no Bun entry in its JIT-runtime list, so it would sign an embedded Bun withoutallow-jit. The new smoke test shows that makes Bun silently fall back to the interpreter.disable-library-validation, which native addons need.manifest.jsonis 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 oncad10f2lost linux-arm64 toapt.llvm.orgfailing all three attempts, which led to the backoff above.First release (36294392271), fetched through the public download URLs:
manifest.jsonmatchSHA256SUMSmanifest.json'sexecutable.sha256matches the extracted darwin-arm64 binarygh attestation verifypasses for a zip and for the manifest; the signer is this workflow on this branch1.4.3-canary.1+9e3414b3fand WebKit35e8970d…, and compile with the DFG JITOne caveat: right after upload,
…/download/…/manifest.jsonanswered HTTP 500 for about a minute before serving normally, so consumers should usecurl --retry.musl and windows-x64 (36291753474): all three targets built and ran on Alpine and
windows-2025with 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, leasecbx_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.shon this machine:Developer ID Application: OpenClaw Foundation (FWJYW4S8P8), with the hardened runtime, a secure timestamp and all five entitlementsallow-jitfails itChecks:
bun test test/internal/source-lints/openclaw-release.test.ts(6 tests),actionlint,shellcheck, the repo's prettier with organize-imports, andtscunderscripts/tsconfig.json's strict settings.zizmorreports only three low "self-repository" notes; the other workflows get the same.Problems these runs caught, fixed in this PR:
zip -Xapt.llvm.orgfailed a job's attempts twice, the second time for minutes on end, so provisioning now retries with backoffallow-jitSide effects:
openclaw-v1.4.3-20260925-9e3414b3f7-webkit-35e8970dfdopenclaw-releaseenvironment (no secrets, no protection rules)