From 1f39539b795e063f24a5886957352d134e69fcc7 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Mon, 18 May 2026 04:33:31 +0200 Subject: [PATCH] build: drop rust-engine COPY (gitignored binary, runtime has JS fallback) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- docker/Dockerfile.sf-server | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.sf-server b/docker/Dockerfile.sf-server index 59aaabe5c..0d9a5c346 100644 --- a/docker/Dockerfile.sf-server +++ b/docker/Dockerfile.sf-server @@ -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