Skip to content

fix(ci): build the SDK types with the repo's own tsc (and pin the pantry action) - #104

Open
glennmichael123 wants to merge 3 commits into
mainfrom
fix/pin-pantry-action
Open

fix(ci): build the SDK types with the repo's own tsc (and pin the pantry action)#104
glennmichael123 wants to merge 3 commits into
mainfrom
fix/pin-pantry-action

Conversation

@glennmichael123

@glennmichael123 glennmichael123 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

integration has been red on main since this morning, on commits that changed no dependency file.

commit integration
69e01f5 (v0.0.87, 00:37) pass
b693fb0 (#102, 12:23) fail
14fe431 (#101, 12:38) fail

git diff 69e01f5..b693fb0 -- '*package.json' '*bun.lock*' '*bunfig.toml' is empty. Nothing in the repo changed.

The wrong diagnosis, and what disproved it

My first commit here assumed the cause was pantry-pm/pantry/packages/action@main — a floating ref that moved from 235036fa (green) to 88dd705e (red) — and pinned it. That did not fix it. The run is worth reading: the pin took effect, the log shows Download action repository 'pantry-pm/pantry@235036fa…', and integration failed identically.

Pinning the action pins the installer, not what it installs. The same run shows it fetching:

resolved fresh at runtime. That dev build cannot resolve its own platform binary:

Error: Unable to resolve @typescript/typescript-linux-x64.
    at getExePath (.../pantry/typescript/lib/getExePath.js:53:19)

No pin of the action would have changed that.

The actual defect

craft builds with whatever tsc is first on PATH.

packages/typescript's build:types ran bun run tsc. Locally that finds the repo's own [email protected], because nothing shadows node_modules/.bin. In CI the pantry action installs into <repo>/pantry and puts it ahead on PATH, so the identical script silently ran a different compiler — a dev build the repo never declared.

That also explains why exactly one job went red: integration is the only job that runs bun run build in packages/typescript, and buildbuild:types is the only script that reaches tsc at all. typescript-sdk runs typecheck and bun test; lint runs pickier. A toolchain break surfaced in one job and looked like a code problem.

The fix

bunx --bun tsc, which resolves the local one in both places — and is the form CLAUDE.md already prescribes for pickier, so the two agree now.

Verified locally: bun run build in packages/typescript completes and emits both dist/index.d.ts and dist/index.d.cts.

The pin stays

It did not fix this, and the commit that added it claimed it would. But a third-party action referenced as @main is worth pinning for its own sake, and release.yml resolving a different action on every tag is the version of that risk that costs the most to discover. All 15 references are pinned; the Apple signing gate in release.yml is untouched — the only lines changed there are three uses: refs.

Unblocks #103.

`integration` has been red on main since this morning on commits that
changed no dependency file — b693fb0 and 14fe431 both fail, 69e01f5 passed.
Nothing in the repo changed; the action did.

`pantry-pm/pantry/packages/action` was referenced as `@main`, so every run
resolved it fresh. The last green run took SHA 235036fa; the first red one
took 88dd705e. The typescript that SHA provisions cannot resolve its own
`@typescript/typescript-linux-x64` binary, so `bun run tsc` dies:

    Error: Unable to resolve @typescript/typescript-linux-x64.
    Either your platform is unsupported, or you are missing the package on disk.

Only `integration` runs `bun run build` in packages/typescript, and that is
the only script that reaches `tsc` — `typescript-sdk` runs typecheck and
tests, `lint` runs pickier. That is why one job went red and the rest stayed
green, which reads like a code problem and is not one.

Pinned to 235036fa everywhere it is referenced, not just in ci.yml: the same
floating ref is in release, benchmarks, binary-size, mobile-e2e and
native-lifecycle, and a publish workflow that resolves a different action on
every tag is the version of this bug that is expensive to find.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

✅ Binary Size Report

Metric Value
Current Size 14254KB (13.92MB)
Change 0KB (0%) unchanged
Size limits
  • Warning: 14.50MB
  • Maximum: 16.00MB

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

✅ Binary load time

rounds:    25 interleaved
base:      p50 14.6ms   p95 17.8ms   (13.5–18.4ms)
head:      p50 14.6ms   p95 16.1ms   (13.4–16.6ms)
delta:     +0.1%  (fails above +20.0%)

No binary load time regression.
What this measures

craft --help: process spawn, dynamic linking and argument parsing.
It never opens a window, so it cannot see a change in window or
webview startup — real startup is benchmarks/startup.bench.ts, which
needs a display.

Both binaries are measured interleaved on this runner and compared by
p50, rather than against a number recorded on another machine. On
byte-identical binaries that method reads within ~3.5%; the old one
swung 45%.

…PATH

Pinning the pantry action was not enough, and the run that proved it is the
useful part: the pin took effect — the log shows
`pantry-pm/pantry@235036fa…` — and `integration` failed identically.

Pinning the action pins the *installer*, not what it installs. The same run
shows it fetching `[email protected]`, resolved fresh at
runtime, and that dev build cannot resolve its own
`@typescript/typescript-linux-x64`. Any pin of the action would have left
that untouched.

The actual defect is that craft built with whatever `tsc` happened to be
first on PATH. `bun run tsc` finds the repo's own `[email protected]` locally,
because nothing shadows `node_modules/.bin`; in CI the action installs into
`<repo>/pantry` and puts it ahead, so the same script silently ran a
different compiler. A repo should build with the toolchain it declares.

`bunx --bun tsc` resolves the local one in both places. It is also the form
CLAUDE.md already prescribes for pickier, so the two agree now.

The action pin stays. It did not fix this, and the commit before this one
said it would — but a third-party action referenced as `@main` is worth
pinning for its own sake, and `release.yml` resolving a different action on
every tag is the version of that risk that costs the most to discover.
@glennmichael123 glennmichael123 changed the title ci: pin the pantry action, which moved and broke integration fix(ci): build the SDK types with the repo's own tsc (and pin the pantry action) Sep 2, 2026
…iglang.org still serves

Two CI failures, one commit, because the second only became visible while
fixing the first.

**integration.** The earlier commit here routed `build:types` through
`bunx --bun tsc` and claimed that fixed it. It did not, and the run that
proved it is worth reading: `build:types` was never reached, because
`build.ts` itself calls `bunx tsc` twice (lines 28–29) and dies first. Both
resolve through PATH, and the pantry action in CI provisions its own
typescript into `<repo>/pantry` ahead of `node_modules/.bin` — a dev build
the lockfile never pinned, whose linux-x64 platform binary is missing.
Locally nothing shadows `node_modules/.bin`, which is why the same command
worked here and failed there.

`scripts/tsc.ts` resolves `typescript` through the module graph and execs
its `bin/tsc`. `build.ts` and `build:types` both go through it now, so
every place craft runs the compiler runs the one `bun.lock` names.

**darwin-x64.** `Setup Pantry` failed with

    HTTP 404 downloading https://ziglang.org/builds/zig-x86_64-macos-0.17.0-dev.1509+bb296ab9b.tar.xz

and every other platform's 1509 tarball 404s too. ziglang.org's index lists
one dev build — current master — plus tagged releases; the rest are pruned.
The three legs that passed did so on cached toolchains, and the next tagged
release would have failed to provision the same way. `deps.yaml` moves to
1963 and its comment records the shelf life, which the pin's existing
comment did not know about.

The drift was one idiom: 27 hand-rolled `.{ .items = &.{}, .capacity = 0 }`
list inits, which 1963 rejects because `ArrayList` gained a field. `.empty`
exists on both toolchains and the tree already uses it 193 times.

Verified on 1963: `zig build test` 150/150 steps, 0 failures;
`build-ios-all` all three archives; `zig build -Djs-runtime=false` clean.
`packages/typescript`: `bun run build` emits both `.d.ts` files, 512 tests
pass, pickier clean.
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