Skip to content

Commit b1f50c0

Browse files
authored
Merge pull request #137 from AdaWorldAPI/claude/fix-rust-avx512-build-XfX4d
Add rustynum vendor dependency to all Docker builds
2 parents f83bd52 + 11d13e3 commit b1f50c0

7 files changed

Lines changed: 29 additions & 8 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ pyo3 = { version = "0.23", optional = true, features = ["extension-module"] }
206206
# - Zero-copy Container bridge: view_u64_as_bytes()
207207
# Requires: nightly Rust (portable_simd)
208208
# Requires: git clone https://github.com/AdaWorldAPI/rustynum vendor/rustynum
209+
# (or: git submodule update --init vendor/rustynum)
209210
# -----------------------------------------------------------------------------
210211
rustynum-rs = { path = "vendor/rustynum/rustynum-rs", optional = true }
211212

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
FROM rust:1.93-slim-bookworm AS builder
2626

2727
RUN apt-get update && apt-get install -y \
28-
pkg-config libssl-dev cmake protobuf-compiler \
28+
pkg-config libssl-dev cmake protobuf-compiler git \
2929
&& rm -rf /var/lib/apt/lists/*
3030

3131
WORKDIR /build
@@ -40,6 +40,13 @@ RUN mkdir -p src/bin && \
4040
# --- Full source ---
4141
COPY . .
4242

43+
# --- Vendor submodules (clone if not present in build context) ---
44+
# Cargo validates path dependencies at resolution time regardless of features,
45+
# so vendor repos must exist even when their features aren't enabled.
46+
RUN if [ ! -f vendor/rustynum/rustynum-rs/Cargo.toml ]; then \
47+
git clone --depth 1 https://github.com/AdaWorldAPI/rustynum vendor/rustynum; \
48+
fi
49+
4350
# Features to enable (flight enables Arrow Flight gRPC)
4451
# NOTE: lancedb feature has API compatibility issues - enable after fixing lance module
4552
ARG FEATURES="simd,parallel,flight"

Dockerfile.crewai

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ RUN apt-get update && apt-get install -y \
2323

2424
WORKDIR /build
2525

26-
# --- Clone crewai-rust vendor ---
27-
RUN git clone --depth 1 https://github.com/AdaWorldAPI/crewai-rust vendor/crewai-rust
26+
# --- Clone vendor repos ---
27+
RUN git clone --depth 1 https://github.com/AdaWorldAPI/crewai-rust vendor/crewai-rust && \
28+
git clone --depth 1 https://github.com/AdaWorldAPI/rustynum vendor/rustynum
2829

2930
# --- Copy source ---
3031
COPY . .

Dockerfile.full

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ RUN apt-get update && apt-get install -y \
2222

2323
WORKDIR /build
2424

25-
# --- Clone both vendor repos ---
25+
# --- Clone all vendor repos ---
2626
RUN git clone --depth 1 https://github.com/AdaWorldAPI/n8n-rs vendor/n8n-rs && \
27-
git clone --depth 1 https://github.com/AdaWorldAPI/crewai-rust vendor/crewai-rust
27+
git clone --depth 1 https://github.com/AdaWorldAPI/crewai-rust vendor/crewai-rust && \
28+
git clone --depth 1 https://github.com/AdaWorldAPI/rustynum vendor/rustynum
2829

2930
# --- Copy source ---
3031
COPY . .

Dockerfile.n8n

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ RUN apt-get update && apt-get install -y \
2323

2424
WORKDIR /build
2525

26-
# --- Clone n8n-rs vendor ---
27-
RUN git clone --depth 1 https://github.com/AdaWorldAPI/n8n-rs vendor/n8n-rs
26+
# --- Clone vendor repos ---
27+
RUN git clone --depth 1 https://github.com/AdaWorldAPI/n8n-rs vendor/n8n-rs && \
28+
git clone --depth 1 https://github.com/AdaWorldAPI/rustynum vendor/rustynum
2829

2930
# --- Copy source ---
3031
COPY . .

Dockerfile.release

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN cargo chef prepare --recipe-path recipe.json
2727
FROM chef AS deps
2828

2929
RUN apt-get update && apt-get install -y \
30-
pkg-config libssl-dev cmake protobuf-compiler \
30+
pkg-config libssl-dev cmake protobuf-compiler git \
3131
&& rm -rf /var/lib/apt/lists/*
3232

3333
COPY --from=planner /build/recipe.json recipe.json
@@ -54,6 +54,11 @@ FROM deps AS builder
5454
# Copy full source
5555
COPY . .
5656

57+
# --- Vendor submodules (clone if not present in build context) ---
58+
RUN if [ ! -f vendor/rustynum/rustynum-rs/Cargo.toml ]; then \
59+
git clone --depth 1 https://github.com/AdaWorldAPI/rustynum vendor/rustynum; \
60+
fi
61+
5762
# AVX-512 binary
5863
RUN RUSTFLAGS="-C target-cpu=x86-64-v4 -C link-arg=-s" \
5964
cargo build --release --bin ladybug-server && \

Dockerfile.unified

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ RUN apt-get update && apt-get install -y \
3939
WORKDIR /build/ladybug
4040
COPY . .
4141

42+
# --- Vendor submodules (clone if not present in build context) ---
43+
RUN if [ ! -f vendor/rustynum/rustynum-rs/Cargo.toml ]; then \
44+
git clone --depth 1 https://github.com/AdaWorldAPI/rustynum vendor/rustynum; \
45+
fi
46+
4247
ARG LB_FEATURES="simd,parallel,codebook,hologram,quantum"
4348

4449
# Build with CPU auto-detect

0 commit comments

Comments
 (0)