Skip to content

Commit 2f2058e

Browse files
AlexMikhalevclaude
andcommitted
fix(ci): fix Docker build COPY flattening and WASM wasm-opt failure
Docker: COPY crates/*/Cargo.toml crates/ flattens all Cargo.toml files into crates/Cargo.toml (overwriting each other), causing cargo to fail with "failed to load manifest for workspace member /code/crates/src". Use COPY --parents with syntax=docker/dockerfile:1.7 to preserve the subdirectory layout that the workspace crates/* glob expects. WASM: wasm-opt bundled with wasm-pack cannot parse reference-types / bulk-memory features from recent Rust toolchains ("Only 1 table definition allowed in MVP"). Disable wasm-opt in wasm-test Cargo.toml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 41e74e4 commit 2f2058e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

crates/terraphim_automata/wasm-test/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ web-sys = { version = "0.3", features = ["console"] }
2626
[dev-dependencies]
2727
wasm-bindgen-test = "0.3"
2828

29+
[package.metadata.wasm-pack.profile.release]
30+
# Disable wasm-opt: the version bundled with wasm-pack is too old
31+
# to handle reference-types / bulk-memory WASM features produced by
32+
# recent Rust toolchains ("Only 1 table definition allowed in MVP").
33+
wasm-opt = false
34+
2935
[profile.release]
3036
# Optimize for small code size
3137
opt-level = "s"

docker/Dockerfile.multiarch

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# syntax=docker/dockerfile:1.7
12
# Multi-stage, multi-architecture Dockerfile for Terraphim Server
23
# Supports Ubuntu 18.04, 20.04, 22.04, and 24.04 with multiple architectures
34

@@ -98,8 +99,12 @@ RUN case "${TARGETARCH}" in \
9899
WORKDIR /code
99100

100101
# Copy dependency files first for better caching
102+
# NOTE: Docker COPY with wildcards flattens directory structure, so
103+
# "COPY crates/*/Cargo.toml crates/" would put all Cargo.toml files into
104+
# crates/Cargo.toml (overwriting each other). We use --parents to preserve
105+
# the subdirectory layout that the workspace crates/* glob expects.
101106
COPY Cargo.toml Cargo.lock ./
102-
COPY crates/*/Cargo.toml crates/
107+
COPY --parents crates/*/Cargo.toml ./
103108
COPY terraphim_server/Cargo.toml terraphim_server/
104109

105110
# Create empty source files to satisfy cargo

0 commit comments

Comments
 (0)