build: drop rust-engine COPY (gitignored binary, runtime has JS fallback)
Some checks are pending
sf self-deploy / build, test, and publish server image (push) Waiting to run
sf self-deploy / deploy test and probe (push) Blocked by required conditions
sf self-deploy / promote prod (push) Blocked by required conditions

The Dockerfile referenced /src/rust-engine/addon and /src/rust-engine/npm
under COPY --from=build, but .gitignore (lines 87-89) excludes the .node
binaries and the build stage doesn't run `node rust-engine/scripts/build.js`.
Result: COPY failed with 'directory not found', breaking the deploy chain.

The runtime gracefully falls back to JS implementations (we see
NativeUnavailableError → JS fallback in test runs), so the image still
boots and serves traffic. Real fix later: add rustup to the build stage
and compile the addon per architecture.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mikael Hugo 2026-05-18 04:33:31 +02:00
parent ddec9fd019
commit 1f39539b79

View file

@ -85,8 +85,13 @@ COPY --from=build /src/dist /opt/sf/dist
COPY --from=build /src/pkg /opt/sf/pkg
COPY --from=build /src/src/resources /opt/sf/src/resources
COPY --from=build /src/scripts/postinstall.js /src/scripts/link-workspace-packages.cjs /src/scripts/ensure-workspace-builds.cjs /opt/sf/scripts/
COPY --from=build /src/rust-engine/addon /opt/sf/rust-engine/addon
COPY --from=build /src/rust-engine/npm /opt/sf/rust-engine/npm
# rust-engine native addon intentionally not shipped here — .gitignore
# excludes the .node binaries (lines 87-89) and the build stage doesn't
# install the Rust toolchain. The runtime handles NativeUnavailableError
# with a JS fallback (visibleWidth, parseRoadmapFile, etc.), so the
# server boots and serves API/web traffic. Follow-up: add `rustup` to the
# build stage + `RUN node rust-engine/scripts/build.js --release` to
# ship the platform-specific binary.
COPY --from=build /src/web/.next/standalone /opt/sf/web/.next/standalone
WORKDIR /workspace