Skip to content

fix(build): install server deps natively, not under QEMU (fixes stalled :latest builds) - #122

Merged
StrandedTurtle merged 1 commit into
mainfrom
ccr-44bed3b3-tyenjv
Oct 25, 2026
Merged

StrandedTurtle merged 1 commit into
mainfrom
ccr-44bed3b3-tyenjv

Conversation

@StrandedTurtle

Copy link
Copy Markdown
Owner

Summary

The :latest image builds for v1.8.0 and v1.9.0 hung in "Build and push". The log shows the cause:

#26 [linux/arm64 server-deps 5/5] RUN npm ci --omit=dev
#26 14.54 qemu: uncaught target signal 4 (Illegal instruction) - core dumped

The arm64 image is built on x86 runners under QEMU emulation. npm ci (whose better-sqlite3 install step runs node-gyp) intermittently crashed there, and buildx then hung instead of failing. It's intermittent, which is why a re-run worked. My earlier cache-scope change didn't address this.

The fix is in the server-deps stage:

  • It now runs on the build machine's own CPU (--platform=$BUILDPLATFORM, like the client stage) with npm ci --omit=dev --ignore-scripts, so nothing runs npm under emulation.
  • Nothing needs compiling for the target CPU:
    • better-sqlite3 ships prebuilt binaries for every platform inside the package and picks one at runtime (prebuilds/linuxmusl-<arch>.node); its node-gyp step was redundant.
    • ssh2/cpu-features only build optional speed-ups for Docker-over-SSH, which DockPull doesn't use; they fall back to JS.
    • protobufjs's postinstall only prints a warning.
  • The python3/make/g++ toolchain is dropped, and unused macOS/Windows prebuilds are pruned.
  • The build fails loudly if either linuxmusl-x64 or linuxmusl-arm64 prebuild is missing.

Testing

  • Reproduced the new stage and ran DockPull from it in node:22-alpine (amd64): server starts, login, settings and history work, and better-sqlite3 loads (SQLite 3.53.4).
  • The arm64 prebuild is AArch64, linked against libc.musl-aarch64 and libstdc++ (both present in node:22-alpine). This sandbox can't emulate arm64 or reach Alpine's package mirror, so the full multi-arch image build is first exercised by the release workflow after merge.
  • Server tests: 198 pass.

Generated by Claude Code

…ed :latest builds)

npm ci for linux/arm64 ran under QEMU emulation and intermittently crashed
with "qemu: uncaught target signal 4 (Illegal instruction)"; buildx then hung
instead of failing, stalling the :latest builds of v1.8.0 and v1.9.0. Nothing
in the server deps needs compiling for the target CPU (better-sqlite3 bundles
prebuilt binaries for every platform and picks one at runtime), so install
them once on the build machine with --ignore-scripts and copy them into both
images. Drops the python3/make/g++ toolchain stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KiL5R3bRpvGk6QP3E21eHF
@StrandedTurtle
StrandedTurtle merged commit c32e82e into main Oct 25, 2026
2 checks passed
@StrandedTurtle
StrandedTurtle deleted the ccr-44bed3b3-tyenjv branch October 25, 2026 11:41
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.

2 participants