Skip to content

feat(agent-image): make the entrypoint FOD hash and native-addon copy per-system (RIG-3749) - #1195

Open
rigel-mintaka wants to merge 3 commits into
compass-native/rig-3748-arm64-spikefrom
compass-native/rig-3749-entrypoint-per-system
Open

rigel-mintaka wants to merge 3 commits into
compass-native/rig-3748-arm64-spikefrom
compass-native/rig-3749-entrypoint-per-system

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 2 PRs:

  1. main
  2. ci(release): add a dispatch-only arm64 agent-image build spike (RIG-3748) #1184
  3. "feat(agent-image): make the entrypoint FOD hash and native-addon copy per-system (RIG-3749)" (this PR)

The agent container only built on x86_64-linux: nodeModules.outputHash was a
single x64 value, and the bundle copied pi-natives-linux-x64's two AVX2
variants by name. An aarch64 build fails at the fixed-output hash, and again at
the cp — the x64 natives package is cpu-gated in bun.lock, so it is not
installed on arm64 at all.

Both the hash and the addon set now come from one per-system record keyed by
pkgs.stdenv.hostPlatform.system, following the shape of
tools/toolchain/versions/bun.nix. The addon list is generated, not a fixed
pair, because the file count differs by arch: x64 ships
pi_natives.linux-x64-{modern,baseline}.node (the loader picks by AVX2, which
is x86-only) while arm64 ships a single unsuffixed pi_natives.linux-arm64.node.
An unsupported system throws by name rather than falling back to a wrong hash.

x86_64-linux is unchanged in effect: same hash, and the generated copy shell is
byte-identical to the three lines it replaces.

The aarch64 hash is lib.fakeSha256 in this commit. The arm64 build spike
reports the real value and it lands before this leaves draft.

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

RIG-3749

@rigel-mintaka
rigel-mintaka added this pull request to stack #1196 September 12, 2026 23:53
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-native-rig-3749-entr.compass-eng-docs.pages.dev

Deployed from compass-native/rig-3749-entrypoint-per-system at 46c9e16.

rigel-mintaka and others added 3 commits September 13, 2026 17:48
… per-system (RIG-3749)

The agent container only built on x86_64-linux: `nodeModules.outputHash` was a
single x64 value, and the bundle copied `pi-natives-linux-x64`'s two AVX2
variants by name. An aarch64 build fails at the fixed-output hash, and again at
the `cp` — the x64 natives package is cpu-gated in bun.lock, so it is not
installed on arm64 at all.

Both the hash and the addon set now come from one per-system record keyed by
`pkgs.stdenv.hostPlatform.system`, following the shape of
`tools/toolchain/versions/bun.nix`. The addon list is generated, not a fixed
pair, because the file count differs by arch: x64 ships
`pi_natives.linux-x64-{modern,baseline}.node` (the loader picks by AVX2, which
is x86-only) while arm64 ships a single unsuffixed `pi_natives.linux-arm64.node`.
An unsupported system throws by name rather than falling back to a wrong hash.

x86_64-linux is unchanged in effect: same hash, and the generated copy shell is
byte-identical to the three lines it replaces.

The aarch64 hash is `lib.fakeSha256` in this commit. The arm64 build spike
reports the real value and it lands before this leaves draft.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
The comment named a development task rather than the mechanism, which reads as
stale once that task is merged. Describe what replaces the value instead.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
Replace the placeholder with the hash an aarch64 install actually produces.

Measured on two hosts with different arch and bun version, each carrying a
positive control that reproduces the committed x86_64 hash:

  x86_64-linux, bun 1.4.0   x64 sha256-JbgM44... (matches) / arm64 sha256-asK46R...
  aarch64-darwin, bun 1.3.13  x64 sha256-JbgM44... (matches) / arm64 sha256-asK46R...

The arm64 tree carries one addon, pi_natives.linux-arm64.node, confirming the
single-entry addon list. The x86_64 fixed-output derivation is the same store
path before and after this change.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-native/rig-3749-entrypoint-per-system branch from b867a88 to 46c9e16 Compare September 13, 2026 21:50
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review September 13, 2026 22:15
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