diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 60ea0087..fd2624f8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,9 +1,5 @@ -# Generated by rust-bucket v0.5.0. DO NOT EDIT BY HAND. FROM rust:1.92-bookworm -# Cache buster - increment to force rebuild: v5 -ARG CACHE_BUST=5 - # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ git \ @@ -15,43 +11,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3-pip \ && rm -rf /var/lib/apt/lists/* -# Install cargo-nextest (required test runner per TESTING.md) -# Build from source to avoid architecture compatibility issues +# Install cargo-nextest RUN cargo install cargo-nextest --locked -# Install Beads task tracker (required per AGENTS.md) -# bd must be available on PATH -# NOTE: Beads is a Go project, NOT a Rust crate. Install via official shell script. -# Do NOT use "cargo install beads" - that installs an unrelated empty crate. -# Install Go 1.24+ (required for beads v0.46.0) from official binary distribution. -# Debian bookworm's golang-go package provides only Go 1.19, which is too old. -RUN ARCH=$(dpkg --print-architecture) && \ - if [ "$ARCH" = "amd64" ]; then GOARCH="amd64"; \ - elif [ "$ARCH" = "arm64" ]; then GOARCH="arm64"; \ - else echo "Unsupported architecture: $ARCH" && exit 1; fi && \ - curl -fsSL "https://go.dev/dl/go1.24.2.linux-${GOARCH}.tar.gz" | tar -C /usr/local -xzf - && \ - /usr/local/go/bin/go install github.com/steveyegge/beads/cmd/bd@v0.46.0 && \ - (command -v bd || ln -sf /root/go/bin/bd /usr/local/bin/bd 2>/dev/null || true) - -# Ensure all tool binaries are on PATH -ENV PATH="/usr/local/go/bin:/root/go/bin:/root/.local/bin:/root/.cargo/bin:${PATH}" - -# Installs ratchet for validating project ratchets -RUN curl -sSf https://raw.githubusercontent.com/imbue-ai/ratchet/main/install.sh | sh - -# Installs uv +# Ensure tool binaries are on PATH +ENV PATH="/root/.local/bin:/root/.cargo/bin:${PATH}" + +# Install uv RUN curl -LsSf https://astral.sh/uv/install.sh | sh # Set working directory WORKDIR /workspace -# Verify installations -RUN echo "=== Verifying installations ===" && \ - cargo --version && \ - cargo-nextest --version && \ - (bd version || echo "Warning: bd not in PATH yet, but continuing...") && \ - ratchet --version && \ - echo "=== All verifications complete ===" +# Pre-compile Rust dependencies for faster builds +# Copy only dependency manifests first to leverage Docker layer caching +COPY Cargo.toml Cargo.lock ./ + +# Create dummy source files to satisfy cargo +RUN mkdir -p src && \ + echo "fn main() {}" > src/main.rs && \ + echo "" > src/lib.rs + +# Build dependencies (release and debug) +RUN cargo build --release && cargo build + +# Remove dummy source files (real source will be mounted/copied later) +RUN rm -rf src -# Default command CMD ["bash"]