Skip to content

ci: build the TypeScript job's Rust addon and CLIs in one invocation - #898

Merged
alongubkin merged 2 commits into
mainfrom
alon/alien-1216-typescript-job-rust-builds
Oct 5, 2026
Merged

alongubkin merged 2 commits into
mainfrom
alon/alien-1216-typescript-job-rust-builds

Conversation

@alongubkin

@alongubkin alongubkin commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Problem

The TypeScript packages and CLIs job spends most of its ~8 min compiling Rust (from #897's run):

Step Time
Build bindings dev addon (napi build --platform) 103 s
Build all CLIs and package gateway (cargo build -p alien-cli -p alien-deploy-cli -p alien-operator -p alien-ai-gateway) 173 s

The two builds select different packages, so cargo resolves features differently and compiles shared dependencies twice.

Change

  • One cargo build for the addon and, under the same condition as before, the CLIs and gateway. The addon is copied to alien-bindings-node.linux-arm64-gnu.node, which is what packages/bindings/src/loader.ts reads.
    • napi build --platform additionally generates index.js/index.d.ts in the crate. Those are gitignored and unused (see crates/alien-bindings-node/.gitignore).
  • wasm-bindgen-cli is still compiled from source. A prebuilt binary of the same version produced different packages/permissions/generated/bytes.js, so the generated-files check failed.

Verified

This PR's own CI runs the affected steps:

  • package layout validation
  • TypeScript unit tests
  • Rust/TS command integration
  • pnpm generate, plus the check that generated files are committed

Measured on this PR: the merged build took 178 s, against 103 + 173 = 276 s for the two separate builds on #897.

🤖 Generated with Claude Code

…m-bindgen prebuilt

The TypeScript job built the bindings addon with `napi build` and the CLIs
with a separate `cargo build`; the two package selections resolve features
differently, so shared dependencies compiled twice (~276 s together). They
now build in one `cargo build`, and the addon is copied to the file name the
loader reads (napi's generated index.js/index.d.ts are unused here).

wasm-bindgen-cli was compiled with `cargo install` on every run (~40 s); it
is now installed prebuilt at the Cargo.lock version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Restructures the build pipeline for Rust and native bindings.

The PR appears safe to merge based on the changes reviewed.

Summary

The PR combines the bindings addon and conditionally built CLIs and gateway into one Cargo invocation, then copies the addon to the filename expected by the bindings loader.

  • The attempted prebuilt wasm-bindgen installation was removed; the final workflow retains the original source-install step.
  • The prior finding about the prebuilt action is resolved because that action is no longer used.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Build job] --> B[One Cargo build]
  B --> C[Bindings addon]
  B -->|when CLI condition is true| D[CLIs and gateway]
  C --> E[Copy addon to expected .node filename]
Loading

Reviews (2) · Last reviewed commit: "ci: keep compiling wasm-bindgen-cli from..."

Comment thread .github/workflows/ci-fast.yml Outdated
The prebuilt binary produced different generated bytes than the committed
ones, so the generated-files check failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai review

@alongubkin alongubkin changed the title ci: build the TypeScript job's Rust in one invocation and install wasm-bindgen prebuilt ci: build the TypeScript job's Rust addon and CLIs in one invocation Oct 5, 2026
@alongubkin
alongubkin merged commit 8c8bdef into main Oct 5, 2026
24 checks passed
@alongubkin
alongubkin deleted the alon/alien-1216-typescript-job-rust-builds branch October 5, 2026 18:25
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