Skip to content

feat: fetch the per-chip macOS office bundle - #252

Merged
quickbeard merged 3 commits into
mainfrom
feat/macos-per-chip-bundles
Aug 6, 2026
Merged

feat: fetch the per-chip macOS office bundle#252
quickbeard merged 3 commits into
mainfrom
feat/macos-per-chip-bundles

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Why

codev-scripts now publishes codev-office-macos-arm64.zip and codev-office-macos-x86_64.zip (~1.7 GB each) instead of one ~3.1 GB zip carrying both chips' installers. This is codevhub's side of that contract.

Producer PR: quickbeard/codev-scripts#27

Target vs. platform

A new OfficeTarget type separates bundle identity (per-chip on macOS) from script identity (per-OS): officeBundleName takes a target, officeScriptName still takes a platform. Four bundles, three setup scripts — the one macOS script resolves its own bundle from uname -m. tests/lib/download.test.ts asserts that asymmetry directly: codev-office-macos-arm64.zip staged alongside plain codev-office-macos-setup.sh.

APPROX_BUNDLE_MB is keyed by target; macOS drops 3100 → 1700.

Two behaviours worth review

Rosetta. process.arch reports the architecture of the node binary, not of the machine — an x64 node under Rosetta on Apple Silicon says "x64". Believing it costs 3.4 GB to land 1.7: we fetch the Intel bundle, then the setup script (native bash, uname -m = arm64) finds nothing it can use and downloads the arm64 one itself. detectArch() consults sysctl.proc_translated, guarded so a genuine Intel Mac (or a missing sysctl) falls through to x86_64.

--platform macos from another OS now requires --arch. On a Linux x64 host detectArch() would answer x86_64 — confident, plausible and wrong, for a 1.7 GB download. It refuses instead of guessing. --arch accepts arm64/aarch64 and x86_64/x64/intel, and is rejected outright for the x64-only bundles. On a Mac the chip is detected for you; --arch is then only needed to stage a bundle for the other chip.

Tests

pnpm check, pnpm typecheck, pnpm test — 1405 passed, 2 skipped (the pre-commit hook ran the same gate plus build).

New coverage: detectArch including the Rosetta override, officeTarget (including the deliberate null for macOS-without-arch), --arch parsing and its aliases, and three end-to-end runSkillOffice cases. The existing runSkillOffice describe block computed its bundle name from the host platform, which would have broken on a Mac dev machine — it now derives the target, and the new tests are pinned to linux via withPlatform so they behave the same wherever the suite runs.

🤖 Generated with Claude Code

Quickbeard and others added 3 commits August 6, 2026 17:50
codev-scripts now publishes codev-office-macos-arm64.zip and
codev-office-macos-x86_64.zip (~1.7 GB each) instead of one ~3.1 GB zip
carrying both chips' installers. This is codevhub's side of that contract.

A new OfficeTarget type separates bundle identity (per-chip on macOS) from
script identity (per-OS): officeBundleName takes a target, officeScriptName
still takes a platform. There are four bundles but still three setup scripts —
the one macOS script resolves its own bundle from `uname -m`.

Two behaviours worth calling out:

Rosetta. process.arch reports the architecture of the NODE BINARY, not of the
machine — an x64 node under Rosetta on Apple Silicon says "x64". Believing it
costs 3.4 GB to land 1.7: we would fetch the Intel bundle, and the setup script
(native bash, `uname -m` = arm64) would find nothing it can use and download the
arm64 one itself. detectArch() consults sysctl.proc_translated.

--platform macos from another OS now REQUIRES --arch. On a Linux x64 host
detectArch() would answer x86_64 — confident, plausible and wrong, for a 1.7 GB
download. It refuses instead of guessing. --arch accepts arm64/aarch64 and
x86_64/x64/intel, and is rejected for the x64-only bundles.

APPROX_BUNDLE_MB is now keyed by target: macOS drops 3100 -> 1700.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
APPROX_BUNDLE_MB is the one place codevhub states a bundle size, and the README
already tells the reader the command prints the approximate size before
downloading. Repeating "~1.7 GB each rather than ~3.1 GB" in the README and
again in the OfficeTarget comment just adds two more places to drift when the
bundles are rebuilt.

The remaining size references are not bundle-size documentation — they justify
a specific decision (what guessing the wrong chip costs), so they stay.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 6a50eed into main Aug 6, 2026
2 of 4 checks passed
@quickbeard
quickbeard deleted the feat/macos-per-chip-bundles branch August 6, 2026 11:10
quickbeard added a commit that referenced this pull request Aug 6, 2026
* chore: correct the macOS bundle size to ~1.6 GB, bump to 0.5.15

The per-chip bundles (#252) were sized from an estimate made before they
existed. They have now been built and verified — CLOSURE CLEAN, zip -t,
sha256sum -c on both — and the real figures are 1637 MB arm64 and 1669 MB
x86_64, so APPROX_BUNDLE_MB drops 1700 -> 1600.

The prose that quotes a size does so to justify a decision — what fetching the
wrong chip's bundle actually costs — so those numbers move with it rather than
being dropped: 1.7 -> 1.6, and the Rosetta test's "3.4 GB to land 1.7" -> "3.2
GB to land 1.6".

Matching updates in codev-scripts and codev-landing-page.

* docs: drop the remaining bundle size from the --arch paragraph

The reason to require --arch is that nothing on a non-Mac host implies which
Mac the bundle is for; the download size was supporting colour, and the README
now carries no hardcoded bundle size at all.

---------

Co-authored-by: Quickbeard <quickbeard@gmail.com>
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