Skip to content

fix(bootstrap): skip hosts with no published bootstrap instead of failing - #1507

Open
benceruleanlu wants to merge 1 commit into
bl/arm64-staging-loop-and-invariantsfrom
bl/arm64-bootstrap-host-skip
Open

benceruleanlu wants to merge 1 commit into
bl/arm64-staging-loop-and-invariantsfrom
bl/arm64-bootstrap-host-skip

Conversation

@benceruleanlu

@benceruleanlu benceruleanlu commented Sep 8, 2026

Copy link
Copy Markdown
Member

Part of a stack of review fixes for #1486. Based on #1506.

Summary

detectPlatform now throws on Linux ARM64, and both dev hooks call it unconditionally. pnpm run init, which is pnpm install && pnpm run bootstrap and the command the README gives new contributors, dies with a stack trace on that host after installing. pnpm run dev:bootstrap dies the same way before Electron starts, and predev points the developer at pnpm run bootstrap, the command that throws.

A host with no published bootstrap is a fact rather than an error: the app falls back to system git.

Feature behavior

detectPlatform returns null for such hosts, and every mode reports the situation and exits 0. The script gains the two modes the hooks needed, --check to warn only and --if-missing to build when absent, so both package.json one-liners now just call it. The host-to-directory mapping each of them had copied lives only in detectPlatform.

An explicit --platform naming an unknown target still fails, so release builds, which always pass --platform, cannot silently skip.

Test coverage and validation

Exercised the script with process.platform and process.arch stubbed:

  • linux/arm64 under --check, --if-missing and no flag: prints "No bootstrap python is published for linux arm64" and exits 0.
  • darwin/arm64 with the directory absent under --check: prints the same warning as before and exits 0.
  • darwin/arm64 with the directory present: --check and --if-missing are silent, exit 0, and leave the directory untouched.
  • An explicit unknown --platform still exits non-zero.

Full unit suite: 274 files, 4736 passed, 2 skipped. Typecheck, lint and format pass. README updated for the skip.

Change breakdown

Total changed lines: 46 (37 added, 9 deleted).

Product code

  • 1 files; +34 / -6; 40 changed lines; 87.0% of total.
  • scripts/build-bootstrap-python.mjs

Test code

  • 0 files; +0 / -0; 0 changed lines; 0%.

Documentation

  • 1 files; +1 / -1; 2 changed lines; 4.3% of total.
  • README.md

Configuration and CI

  • 1 files; +2 / -2; 4 changed lines; 8.7% of total.
  • package.json

Generated files

  • 0 files; +0 / -0; 0 changed lines; 0%.

Lockfiles

  • 0 files; +0 / -0; 0 changed lines; 0%.

Vendored code

  • 0 files; +0 / -0; 0 changed lines; 0%.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ebb967eb-b63a-4613-830b-38da8a30195f

📥 Commits

Reviewing files that changed from the base of the PR and between 2b9c6a5 and 4cb1068.

📒 Files selected for processing (3)
  • README.md
  • package.json
  • scripts/build-bootstrap-python.mjs

Comment @coderabbitai help to get the list of available commands.

…ling

detectPlatform threw on Linux ARM64, and both dev hooks called it
unconditionally, so `pnpm run init` (install && bootstrap) and
`pnpm run dev:bootstrap` died with a stack trace on that host — while
`predev` pointed the developer at `pnpm run bootstrap`, the command that
threw. No bootstrap for a host is a fact, not an error: the app falls back to
system git.

Return null for such hosts and report it, and give the script the two modes
the hooks needed — --check (warn only) and --if-missing (build when absent).
Both package.json one-liners now just call it, so the host-to-directory
mapping they had each copied lives only in detectPlatform. An explicit
--platform with an unknown name still fails.
@benceruleanlu
benceruleanlu force-pushed the bl/arm64-bootstrap-host-skip branch from d2ebb5b to 4cb1068 Compare September 9, 2026 01:33
@benceruleanlu
benceruleanlu removed this pull request from stack #1510 September 9, 2026 01:34
@benceruleanlu
benceruleanlu added this pull request to stack #1513 September 9, 2026 01:34

This branch has not been deployed

No deployments
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.

3 participants