8000 bootstrap: a checkout for each pinned commit, so builds with other pins never race by NateIsern · Pull Request #596 · OxyHQ/OxyOS · GitHub
[go: up one dir, main page]

Skip to content

bootstrap: a checkout for each pinned commit, so builds with other pins never race - #596

Merged
NateIsern merged 1 commit into
mainfrom
fix/bootstrap-checkout-per-pin
Nov 12, 2026
Merged

NateIsern merged 1 commit into
mainfrom
fix/bootstrap-checkout-per-pin

Conversation

@NateIsern
Copy link
Copy Markdown
Member

Every build on a machine shared one checkout of each application (OXYOS_CACHE/src/Bloom, and likewise Dropsea and Atlas). A bootstrap for a tree pinning another commit switched it under a running build. On 11 November a gate on seldon failed to bundle its packages ("Unable to resolve module ./social" in Bloom's src/icons/index.ts), because another tree's bootstrap had moved the shared checkout from e79ca5be to 69df4a88 mid-build. The #563 agent hit the same race earlier.

Change

  • A checkout per pinned commit. checkouts/NAME.git is one bare clone, fetched a commit at a time (--depth 1). checkouts/NAME/COMMIT is a worktree of it, with its packages installed once and never changed after. COMMIT.ready marks it complete (a half-made one is made again); COMMIT.used records when a bootstrap last named it.
  • env.sh reads tools/dev/pins to default BLOOM_DIR, DROPSEA_DIR and ATLAS_DIR to their pinned commits' checkouts. local.conf overrides still win.
  • The host's CMake vars are per Bloom checkout. toolchain.sh's output holds paths into that Bloom's React Native, so it moves from the shared toolchain/cmake-vars.txt to toolchain/cmake-vars/<hash of BLOOM_DIR>.txt (OXYOS_CMAKE_VARS). run-scenarios.sh and the sanitizer doc use it.
  • Pruning. Under the bootstrap lock, a checkout that no bootstrap has named for OXYOS_CHECKOUT_KEEP_DAYS (3) is removed, along with its cmake-vars file and any clone objects only it used (git gc --prune=now).
  • Runners' caches get the same layout through the gate's bootstrap; each runner has its own OXYOS_CACHE.
  • Old layout left alone. src/Bloom and the others stay in place for trees on branches from before this change, and can be removed once none builds. docs/developing.mdx says all this.

Tested on seldon, on the shared ~/.cache/oxyos

  • Two gates at once (SCENARIOS="transform text-input") on trees pinning different Bloom commits: a at e79ca5be (main), and b at fc1aeaca (Bloom 18.4.2: a desktop platform's chrome (pin bump, scenarios re-measured) #540's pin), started 60 s later. b's bootstrap made its own checkout while a built.
  • A third bootstrap at another pin (69df4a88) made a third checkout while both gates were bundling their packages, the phase that failed before.
  • Results: both gates passed. All three checkouts stayed at their commits with no changes, and each Bloom checkout has its own cmake-vars pointing into its own React Native.
  • Disk: the first Bloom checkout takes 2.0 GB, and a second adds 0.7 GB, since bun installs as hard links from its cache on the same filesystem. All of checkouts/ is 4.5 GB.
  • Pruning: with 69df4a88's .used aged 6 days, the next bootstrap removed its worktree and cmake-vars file and kept the two in use.

🤖 Generated with Claude Code

…ns never race

Every build on a machine shared one checkout of each application
(OXYOS_CACHE/src/Bloom), and a bootstrap for a tree pinning another commit
switched it under a running build: on 11 November a gate's packages failed to
bundle on seldon (Bloom's ./social unresolved) because another tree's bootstrap
had moved the checkout from e79ca5be to 69df4a88 mid-build.

Now each pinned commit has a checkout of its own, never changed once made:
checkouts/NAME.git, one clone fetched a commit at a time, and
checkouts/NAME/COMMIT, a worktree of it with its packages installed once
(COMMIT.ready when complete, COMMIT.used when a bootstrap last named it).
env.sh reads tools/dev/pins for the defaults. What the host's CMake is told
(toolchain.sh's output, paths into Bloom's React Native) is a file for each
Bloom checkout too (OXYOS_CMAKE_VARS, toolchain/cmake-vars/). A checkout no
bootstrap named for OXYOS_CHECKOUT_KEEP_DAYS (3) is removed with its
cmake-vars file and the clone's objects only it used. The runners' caches get
the same layout through the gate's bootstrap. docs/developing.mdx says how.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NateIsern
NateIsern enabled auto-merge November 11, 2026 21:41
@NateIsern
NateIsern added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 542b939 Nov 12, 2026
11 checks passed
@NateIsern
NateIsern deleted the fix/bootstrap-checkout-per-pin branch November 12, 2026 13:20
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.

1 participant

0