镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Merged
glennmichael123 merged 3 commits into
mainfrom
fix/pin-pantry-action
Sep 3, 2026
Merged

glennmichael123 merged 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:

+ typescript@7.1.0-dev.20260708.3

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 typescript@7.0.2, 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 build → build: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 `typescript@7.1.0-dev.20260708.3`, 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 `typescript@7.0.2` 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.
@glennmichael123
glennmichael123 merged commit d4c214e into main Sep 3, 2026
10 of 14 checks passed
@glennmichael123
glennmichael123 deleted the fix/pin-pantry-action branch September 3, 2026 11:56
glennmichael123 added a commit that referenced this pull request Sep 3, 2026
…1963 (#106)

main has been red on `zig-core` since #104 moved craft to
0.17.0-dev.1963. Every failure was in zig-js at the old pin — that
toolchain appends `pointer_stability` to ArrayList, and zig-js had 27 struct
literals and one JIT layout assertion that named the old shape.

zig-utils/zig-js#876 fixes that upstream, verified there on 1963 (2285
passed, 0 failed) and on the 1818 its own CI pins (53/53 checks). This is the
one-line pin to it.

Locally, craft's full `zig build` and `zig build test` against this zig-js
content on 1963: 153/153 steps, 2519 passed, 0 failed.

Co-authored-by: glennmichael123 <gtorregosa@gmail.com>
glennmichael123 added a commit that referenced this pull request Sep 3, 2026
…job (#107)

`integration` kept failing at "Build TypeScript SDK" with

    error: Cannot find package 'typescript' from '…/packages/typescript/scripts'

while `typescript-sdk` — same commit, same runner, same `bun run build`,
same shim — passed. The difference is one step earlier: `integration` runs
`eval "$(pantry env | sed -n '/^export /,$p')" && zig build`, and the log
inside that step reads:

    + typescript@7.1.0-dev.20260708.3
    + better-dx@0.2.20
    Linked 11 workspace package(s)
      Installing JS deps via bun
    683 packages installed
    ✗ Patch failed for ts-maps
    ⚡ pantry env activated → craft

`pantry env` does not just print exports. It runs a workspace setup: it
installs its own typescript and better-dx — neither the version the lockfile
names — then runs its own `bun install` with an explicit `--linker` flag
(`js_delegate.zig:208`), which overrides `bunfig.toml`'s `hoisted` and
re-links the whole tree. The explicit install step had put 351 packages in
place; this put 683, and root `node_modules/typescript` was gone.

The eval contributed nothing a step used. `pantry env` exports only
`PANTRY_*` variables (0.10.3 exports nothing at all), and no workflow reads
them. `zig` was found because the pantry action already puts every installed
bin on PATH — `packages/action/src/index.ts:852–912` — which is why `bun
install` runs without any eval. zig-js's CI uses the same action and runs
bare `zig build`.

Removed from all 16 sites across five workflows. The Apple signing gate in
release.yml is untouched; the only lines changed there are three build
prefixes and one bare eval inside the cross-compile loop.

This was also the origin of the `integration` break #104 set out to fix:
the dev-build `tsc` that could not find its linux-x64 binary was the one
`pantry env` had just installed and put on PATH.
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