build: configured docker build pipelines for cargo native addons

- Switched Docker images to build native addons via cargo/napi-rs (`OMP_NATIVE_BUILD_BACKEND=cargo`) instead of Bazel.
- Updated Cargo.toml workspace members explicitly to prevent loading errors from stale directories under crates/.
- Added depth-agnostic patterns to .dockerignore files to exclude nested build outputs from Docker build contexts.
- Added OMP_NATIVE_CARGO_PROFILE environment variable to support configuring cargo profiles for addon builds.
This commit is contained in:
can1357
2026-08-14 07:09:48 +02:00
parent ebcbdd5297
commit ad318c7572
11 changed files with 183 additions and 39 deletions
+4 -2
View File
@@ -7,9 +7,11 @@ RUN apt-get update && apt-get install -y curl ca-certificates unzip build-essent
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:$PATH"
# Install Rust
# Install Rust. The natives build defaults to Bazel; this image has no
# bazelisk and needs only the host addon, so route it through cargo/napi-rs.
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:$PATH"
ENV PATH="/root/.cargo/bin:$PATH" \
OMP_NATIVE_BUILD_BACKEND=cargo
# Copy local repo
WORKDIR /repo
+5 -2
View File
@@ -7,9 +7,12 @@ RUN apt-get update && apt-get install -y curl ca-certificates unzip build-essent
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:$PATH"
# Install Rust (needed to build native addon)
# Install Rust (needed to build native addon). The natives build defaults to
# Bazel; this image has no bazelisk and needs only the host addon, so route it
# through the cargo/napi-rs backend.
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:$PATH"
ENV PATH="/root/.cargo/bin:$PATH" \
OMP_NATIVE_BUILD_BACKEND=cargo
# Copy local repo
WORKDIR /repo
+5 -2
View File
@@ -8,9 +8,12 @@ RUN apt-get update && apt-get install -y curl ca-certificates unzip jq procps bu
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:$PATH"
# Install Rust (needed to build native addon)
# Install Rust (needed to build native addon). The natives build defaults to
# Bazel; this image has no bazelisk and needs only the host addon, so route it
# through the cargo/napi-rs backend.
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:$PATH"
ENV PATH="/root/.cargo/bin:$PATH" \
OMP_NATIVE_BUILD_BACKEND=cargo
# Install Node.js (needed for verdaccio and npm)
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \