FROM gcc:15.2.0-trixie
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
COPY . /workspace
# Fetch external dependencies and build the project
RUN bazelisk fetch //... && \
bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
# Ignore VCS and build artifacts .git .gitignore bazel-bin bazel-out bazel-testlogs BUILD.bazel *.log *.tmp *.o *.a *.so .cache .bazelrc bazel-*/* # Ignore IDE files *.swp *.swo *.DS_Store # Ignore node_modules if present node_modules/ # Ignore Python caches __pycache__/ *.pyc
Failing step - [6/6] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar Exact error message and exit code - ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such target '@@local_cuda//:cub': target 'cub' not declared in package '' defined by /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD - ... - ERROR: process "/bin/sh -c bazelisk fetch //... && bazelisk build //app/blitzar:blitzar" did not complete successfully: exit code: 2 Context (failing command/step) - Dockerfile: RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar Missing packages/files mentioned - No such target '@@local_cuda//:cub' declared in package '', defined by external/local_cuda/BUILD (i.e., missing cub target in local_cuda repository wiring) Version/dependency notes - Bazelisk attempted to fetch Bazel: downloading bazel-7.1.2-linux-x86_64 (Bazel 7.1.2). No explicit version mismatch reported beyond this failure.
FROM gcc:15.2.0-trixie
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
# Remove CUDA-related Bazel wiring to allow CPU-only build in environments without CUDA
RUN if [ -f WORKSPACE ]; then \
echo "Patching WORKSPACE to disable CUDA rules (if present)"; \
sed -i '/# rules_cuda/,+4d' WORKSPACE || true; \
fi
WORKDIR /workspace
COPY . /workspace
# Fetch external dependencies and build the project
RUN bazelisk fetch //... && \
bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
- Failing step (from Dockerfile): RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Exact error message and exit code: ERROR: process "/bin/sh -c bazelisk fetch //... && bazelisk build //app/blitzar:blitzar" did not complete successfully: exit code: 2 - Missing packages or files mentioned: - no such target '@@local_cuda//:cuda_runtime_static': target 'cuda_runtime_static' not declared in package '' defined by /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD - Version/mismatch information (from logs): - Bazel 7.1.2 is being downloaded/used: Downloading https://releases.bazel.build/7.1.2/release/bazel-7.1.2-linux-x86_64... - Context note: - The error occurs during bazelisk fetch/build for //app/blitzar:blitzar, with CUDA-related rules_cuda processing leading to the missing cuda_runtime_static target. This suggests a mismatch or incomplete declaration in the external local_cuda BUILD or an incompatibility with the CUDA rules being used. Possible next steps include aligning the CUDA rule versions with the expected local_cuda targets, or disabling CUDA-related dependencies if CUDA is not required.
workspace(name = "dev_spaceandtime_blitzar")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# libbacktrace
git_repository(
name = "com_github_ianlancetaylor_libbacktrace",
build_file = "//bazel/libbacktrace:libbacktrace.BUILD",
commit = "86885d1",
remote = "https://github.com/ianlancetaylor/libbacktrace",
)
# spdlog
git_repository(
name = "com_github_gabime_spdlog",
build_file = "//bazel:spdlog.BUILD",
commit = "5ebfc92",
remote = "https://github.com/gabime/spdlog",
)
# catch2
git_repository(
name = "com_github_catchorg_catch2",
commit = "53d0d91",
remote = "https://github.com/catchorg/Catch2",
)
# boost
git_repository(
name = "com_github_nelhage_rules_boost",
commit = "ff4fefd",
# Patch build to add libbacktrace dependency.
# See https://github.com/nelhage/rules_boost/issues/534
patches = [
"//bazel:stacktrace.patch",
],
remote = "https://github.com/nelhage/rules_boost",
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()
# rules_cuda
git_repository(
name = "rules_cuda",
commit = "775ba0c",
remote = "https://github.com/bazel-contrib/rules_cuda",
)
load("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains", "rules_cuda_dependencies")
rules_cuda_dependencies()
register_detected_cuda_toolchains()
FROM gcc:15.2.0-trixie
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Overwrite WORKSPACE to a minimal configuration to avoid CUDA-related external dependencies in restrictive environments
RUN bash -lc 'cat > WORKSPACE << "EOS"\nworkspace(name = "dev_spaceandtime_blitzar")\nEOS'
COPY . /workspace
# Fetch external dependencies and build the project
RUN bazelisk fetch //... && \
bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
- Exact error message and exit code
- ERROR: failed to build: failed to solve: process "/bin/sh -c bash -lc 'cat > WORKSPACE << \"EOS\"\\nworkspace(name = \"dev_spaceandtime_blitzar\")\\nEOS'" did not complete successfully: exit code: 2
- Failing command/step
- [5/7] RUN bash -lc 'cat > WORKSPACE << "EOS"\nworkspace(name = "dev_spaceandtime_blitzar")\nEOS'
- Additional error context (from logs)
- bash: line 1: warning: here-document at line 1 delimited by end-of-file (wanted `EOSnworkspace')
- bash: -c: line 1: syntax error near unexpected token `('
- bash: -c: line 1: `cat > WORKSPACE << "EOS"\nworkspace(name = "dev_spaceandtime_blitzar")\nEOS'
- Dockerfile reference
- Dockerfile:24 (the RUN command creating WORKSPACE with a here-doc)
- Missing packages or files mentioned
- None indicated
- Version mismatch info
- Base image used: gcc:15.2.0-trixie; No version mismatch reported.No matches found.
FROM gcc:15.2.0-trixie
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
COPY . /workspace
# Remove CUDA-related CUDA rules from WORKSPACE to allow CPU-only builds in restricted environments
RUN set -eux; \
if [ -f WORKSPACE ]; then \
# Remove the CUDA repo block
sed -i '/git_repository(name = "rules_cuda"/,$!d' WORKSPACE || true; \
sed -i '/load("@rules_cuda\/cuda:repositories.bzl"/d' WORKSPACE || true; \
sed -i '/rules_cuda_dependencies()/d' WORKSPACE || true; \
sed -i '/register_detected_cuda_toolchains()/d' WORKSPACE || true; \
sed -i '/\$\(bazel.*cuda\)/d' WORKSPACE || true; \
fi
# Fetch external dependencies and build the project
RUN bazelisk fetch //... && \
bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
- Exact error message and exit code - ERROR: Fetching target dependencies for deps(//...) encountered an error: error loading package under directory '': error loading package 'sxt/execution/schedule': at /workspace/bazel/sxt_build_system.bzl:1:6: Unable to find package for @@[unknown repo 'rules_cuda' requested from @@]//cuda:defs.bzl: The repository '@@[unknown repo 'rules_cuda' requested from @@]' could not be resolved: No repository visible as '@rules_cuda' from main repository. - Dockerfile:37 - The process did not complete successfully: exit code: 2 - Failing command/step - [7/7] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Missing packages or files mentioned - Unknown repo 'rules_cuda' requested from @@] //cuda:defs.bzl could not be resolved - No repository visible as '@rules_cuda' from main repository - error loading package 'sxt/execution/schedule' - Version mismatch info - Bazelisk version used: v1.18.0 (from: curl ... bazelisk-linux-amd64 -o /usr/local/bin/bazelisk) - Bazel version pulled by Bazelisk: 7.1.2 (from: https://releases.bazel.build/7.1.2/release/bazel-7.1.2-linux-x86_64)
ubuntu/squid (124 stars): Squid is a caching proxy for the Web. Long-term versions maintained by Canonical ubuntu/nginx (140 stars): Nginx, a high-performance reverse proxy & web server. Long-term tracks maintaine ubuntu/bind9 (117 stars): BIND 9 is a very flexible, full-featured DNS system. Long-term versions maintain ubuntu/kafka (60 stars): Apache Kafka, a distributed event streaming platform. Long-term tracks maintaine ubuntu/zookeeper (14 stars): ZooKeeper maintains configuration information centrally. Long-term tracks mainta ubuntu/apache2 (102 stars): Apache, a secure & extensible open-source HTTP server. Long-term tracks maintain ubuntu/prometheus (78 stars): Prometheus is a systems and service monitoring system. Long-term versions mainta ubuntu/mysql (72 stars): MySQL open source fast, stable, multi-thread SQL database. Long-term tracks main ubuntu/postgres (42 stars): PostgreSQL is an open source object-relational database. Long-term versions main ubuntu/dotnet-aspnet (26 stars): Chiselled Ubuntu runtime image for ASP.NET apps. Long-term tracks maintained by
FROM gcc:15.2.0-trixie
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
COPY . /workspace
# Build the project from source
RUN bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
Summary of Docker build error - Failing command/step - RUN bazelisk build //app/blitzar:blitzar (Dockerfile:26) - Exact error messages (preserve exact text) - /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD: no such target '@@local_cuda//:cuda_runtime_static': target 'cuda_runtime_static' not declared in package '' defined by /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD - /workspace/sxt/base/error/BUILD:15:17: no such target '@@local_cuda//:cuda_runtime_static': target 'cuda_runtime_static' not declared in package '' defined by /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD and referenced by '//sxt/base/error:panic' - Analysis of target '//app/blitzar:blitzar' failed; build aborted: Analysis failed - ERROR: Build did NOT complete successfully - (exit code: 1) - Missing packages or files mentioned - Missing/undeclared Bazel target: cuda_runtime_static in external/local_cuda/BUILD (referenced as @@local_cuda//:cuda_runtime_static) - Version mismatch / environment information - Bazelisk version: 1.18.0 - Bazel version attempted: 7.1.2 (bazel-7.1.2-linux-x86_64) - Base image: gcc:15.2.0-trixie - Bazel-related repository state: com_github_nelhage_rules_boost commit ff4fefded63953945bcf61bc1f20c924bf7525ce; Repository rules_cuda instantiated at commit 775ba0c41679aab6ee60425360bdd841aaf92bb6
FROM nvidia/cuda:12.3.0-base-ubuntu22.04
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
COPY . /workspace
# Build the project from source (CUDA toolchain will be available in this image, if required)
RUN bazelisk fetch //... && \
bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
Docker build error summary - Failing step (command/step): - RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Exit code: 1 - Exact error messages (preserved): - "src/main/tools/process-wrapper-legacy.cc:80: \"execvp(/usr/local/cuda/bin/nvcc, ...)\": No such file or directory" - "ERROR: /workspace/sxt/field51/operation/BUILD:45:17: Compiling sxt/field51/operation/neg.cc failed: (Exit 1): nvcc failed: error executing CudaCompile command (from target //sxt/field51/operation:neg) /usr/local/cuda/bin/nvcc -x cu '-rdc=true' -Xcompiler -fPIC -ccbin /usr/bin/gcc -I . -I bazel-out/k8-fastbuild/bin -I . -I bazel-out/k8-fastbuild/bin -I external/local_cuda -I ... (remaining 16 arguments skipped)" - (Also mentions additional similar failures for cmov.cc and sq.cc) - Missing packages or files mentioned: - /usr/local/cuda/bin/nvcc (No such file or directory) - Version/mismatch information: - Base image used: docker.io/nvidia/cuda:12.3.0-base-ubuntu22.04 - Bazel launcher downloaded: bazel-7.1.2 (bazelisk fetch downloads bazel 7.1.2) - Implication: CUDA toolchain (nvcc) is not present in the image despite CUDA base image being used (nvcc missing). This is a mismatch between the expected CUDA toolchain in the image and what is actually available.
FROM nvidia/cuda:12.3.0-devel-ubuntu22.04
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
COPY . /workspace
# Build the project from source
RUN bazelisk fetch //... && \
bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
- Failing step: - [6/6] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Exact error message and exit code: - nvcc fatal : Unknown option '-Wno-unknown-cuda-version' - Exit code: 1 - Missing packages/files mentioned: - None reported. The logs show typical apt-get installs succeeded; no missing file/package errors. - Version information / potential mismatch notes: - Base image uses NVIDIA CUDA: 12.3.0-devel-ubuntu22.04 - Bazel/Bazelisk: fetching Bazel 7.1.2 (bazel-7.1.2-linux-x86_64) - The error occurs during nvcc invocation with an unknown option, suggesting a CUDA/NVCC Flag compatibility issue rather than a missing file.
FROM gcc:15.2.0-trixie
# Install essential build dependencies
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip \
git \
build-essential \
python3 \
python3-pip \
; \
rm -rf /var/lib/apt/lists/*
# Install Bazelisk (Bazel wrapper) for building Bazel projects
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk && \
chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Overwrite WORKSPACE to a minimal configuration to avoid CUDA-related external dependencies in restrictive environments
RUN bash -lc 'cat > WORKSPACE << "EOS"\nworkspace(name = "dev_spaceandtime_blitzar")\n\nload("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")\n\n# Core external dependencies used by the project\ngit_repository(\n name = "com_github_ianlancetaylor_libbacktrace",\n build_file = "//bazel/libbacktrace:libbacktrace.BUILD",\n commit = "86885d1",\n remote = "https://github.com/ianlancetaylor/libbacktrace",\n)\n\ngit_repository(\n name = "com_github_gabime_spdlog",\n build_file = "//bazel:spdlog.BUILD",\n commit = "5ebfc92",\n remote = "https://github.com/gabime/spdlog",\n)\n\ngit_repository(\n name = "com_github_catchorg_catch2",\n commit = "53d0d91",\n remote = "https://github.com/catchorg/Catch2",\n)\n\ngit_repository(\n name = "com_github_nelhage_rules_boost",\n commit = "ff4fefd",\n patches = [\n "//bazel:stacktrace.patch",\n ],\n remote = "https://github.com/nelhage/rules_boost",\n)\n\nload("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")\nboost_deps()\nEOS'\n'
COPY . /workspace
# Build the project from source
RUN bazelisk fetch //... && \
bazelisk build //app/blitzar:blitzar
# Default to run the built binary
CMD ["/workspace/bazel-bin/app/blitzar/blitzar"]
Concerns: The build step runs before COPY . /workspace, so the code is not present when bazelisk build is executed; as a result, the image will fail to build., There are no local Bazel BUILD definitions shown in the Dockerfile; the build relies on //app/blitzar:blitzar existing in the copied source, but the initial build occurs before the source is copied, making the build incorrect., Overwriting WORKSPACE with a minimal config and using fixed commit SHAs in git_repository rules may lead to brittle builds that fail in restrictive environments or as upstream repos change., The CMD path assumes a Bazel-built binary at /workspace/bazel-bin/app/blitzar/blitzar, which will only exist after a successful build; in a corrected flow this should be copied into a simpler runtime image.
# syntax=docker/dockerfile:1
# Multi-stage build:
# - Builder: CUDA-enabled image with GCC to compile the project via Bazel
# - Runtime: CUDA runtime image to provide necessary GPU libraries, with the built binary copied in
FROM nvidia/cuda:12.6.0-devel-ubuntu22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl gnupg2 lsb-release \
git build-essential python3 python3-pip pkg-config zip unzip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
# CUDA runtime path for the build
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${CUDA_HOME}/bin:${PATH}
# Create a non-root user for building
RUN useradd -m -s /bin/bash blitzar-builder
USER blitzar-builder
WORKDIR /workspace
# Copy source code
COPY --chown=blitzar-builder:blitzar-builder . /workspace
# Build the project
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: runtime image
FROM nvidia/cuda:12.6.0-runtime-ubuntu22.04 AS runtime
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${CUDA_HOME}/bin:${PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
# Copy built binary from builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Run as non-root for security
RUN useradd -m -s /bin/bash blitzar-runtime
USER blitzar-runtime
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
Summary: - Exact error message and exit code: nvcc fatal : Unknown option '-Wno-unknown-cuda-version' (Exit code 1 reported during nvcc compilation) - Failing command/step: Builder step 7/7: RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar The failure occurs during the Bazel build of //app/blitzar:blitzar, specifically when compiling sxt/base/device/stream_handle.cc with nvcc. - Missing packages or files mentioned: None explicitly listed as missing. The log shows a toolchain flag causing the failure, not a missing file/package. - Version mismatch / environment info: - Base image/toolchain: docker.io/nvidia/cuda:12.6.0-devel-ubuntu22.04 (CUDA 12.6 devel), with nvcc at /usr/local/cuda/bin/nvcc. - Error indicates the nvcc in this CUDA toolchain does not recognize the flag -Wno-unknown-cuda-version, suggesting a mismatch between the build scripts (which pass that flag) and the installed nvcc version. This is a CUDA toolchain/flag compatibility issue rather than a missing dependency.
# syntax=docker/dockerfile:1
# Multi-stage build: CPU-only (no CUDA) to build the project from source using Bazel
# Stage 1: builder
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config unzip zip \
python3 python3-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy source code
COPY --chown=root:root . /workspace
# Build the project (CPU-only by default; CUDA paths are not required)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: runtime
FROM debian:bookworm-slim AS runtime
# Install runtime dependencies (glibs)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Copy built binary from builder
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Create a non-root user for running the binary
RUN useradd -m -s /bin/bash blitzar
USER blitzar
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
Failing step (Docker build, builder 6/6) - RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar Exit code - exit code: 2 Exact error message - ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such target '@@local_cuda//:cub': target 'cub' not declared in package '' defined by /root/.cache/bazel/_bazel_root/external/local_cuda/BUILD Missing packages/files mentioned - The failure references a Bazel external target: '@@local_cuda//:cub' not declared in the external CUDA workspace (external/local_cuda/BUILD). This indicates a missing or undeclared CUDA target in the local_cuda Bazel config. Version mismatch / hints - DEBUG: Rule 'rules_cuda' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "775ba0c41679aab6ee60425360bdd841aaf92bb6" (CUDA rules mismatch hint). This suggests a possible version/commit mismatch in the CUDA Bazel rules configuration.
# syntax=docker/dockerfile:1
# Stage 1: Builder with CUDA-enabled toolchain to compile the project using Bazel
FROM nvidia/cuda:12.3.0-devel-ubuntu22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config unzip zip \
python3 python3-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy source code
COPY --chown=root:root . /workspace
# Build the project (CUDA toolchain available)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: Runtime image
FROM nvidia/cuda:12.3.0-runtime-ubuntu22.04 AS runtime
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${CUDA_HOME}/bin:${PATH}
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
# Install runtime libraries required by the binary
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libstdc++6 libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
# Copy built binary from builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Create a non-root user and run the binary
RUN useradd -m -s /bin/bash blitzar
USER blitzar
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
- Exact error message and exit code - nvcc fatal : Unknown option '-Wno-unknown-cuda-version' - (Exit 1) during compilation of sxt/execution/async/future_fwd.cc - Failing command/step - Failing build step: [builder 6/6] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Nested error during Bazel build: Compiling sxt/execution/async/future_fwd.cc failed: (Exit 1): nvcc failed: error executing CudaCompile command ... nvcc fatal : Unknown option '-Wno-unknown-cuda-version' - Missing packages or files mentioned - No missing-packages/files reported. The log shows successful apt installs prior to this step; the error is CUDA/NVCC flag related, not a missing file/package. - Version mismatch info - CUDA toolkit in use: nvidia/cuda:12.3.0-devel-ubuntu22.04 (also 12.3.0-runtime-ubuntu22.04 in prior step) - The error suggests a compatibility issue between nvcc and the host toolchain (unknown flag -Wno-unknown-cuda-version), possibly due to CUDA/toolchain versions (nvcc invoked with /usr/bin/gcc and CUDA 12.3 tooling).
# syntax=docker/dockerfile:1
# Stage 1: Builder (CPU-only, no CUDA) using a stable Debian base
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config unzip zip \
python3 python3-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy source code
COPY --chown=root:root . /workspace
# Build the project (CPU-only build; CUDA toolchain is not required for this configuration)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: Runtime image
FROM debian:bookworm-slim AS runtime
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libstdc++6 libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Copy built binary from builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Create a non-root user for running the binary
RUN useradd -m -s /bin/bash blitzar
USER blitzar
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
- Failing step (failing command): [builder 6/6] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar
- Exact error message and exit code:
- Error:
ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such target '@@local_cuda//:cub': target 'cub' not declared in package '' defined by /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD
- Exit code: 2
- Also note the final log: ERROR: process "/bin/sh -c bazelisk fetch //... && bazelisk build //app/blitzar:blitzar" did not complete successfully: exit code: 2
- Missing packages or files mentioned:
- undeclared target: @@local_cuda//:cub
- location: external/local_cuda/BUILD (no such target 'cub' declared in that BUILD)
- Version mismatch / relevant debug info:
- DEBUG: Rule 'com_github_nelhage_rules_boost' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "ff4fefded63953945bcf61bc1f20c924bf7525ce"
- DEBUG: Rule 'rules_cuda' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "775ba0c41679aab6ee60425360bdd841aaf92bb6"# syntax=docker/dockerfile:1
# Stage 1: Builder (CPU-only, no CUDA) using a stable Debian base
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config unzip zip \
python3 python3-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy source code
COPY --chown=root:root . /workspace
# Patch WORKSPACE to avoid CUDA-related external dependencies (disable CUDA rules)
RUN sed -i '/rules_cuda/d' WORKSPACE \
&& sed -i '/local_cuda/d' WORKSPACE \
&& sed -i '/load("@rules_cuda\\\/cuda:repositories.bzl"/d' WORKSPACE \
&& sed -i '/rules_cuda_dependencies()/d' WORKSPACE \
&& sed -i '/register_detected_cuda_toolchains()/d' WORKSPACE \
&& sed -i '/@@local_cuda/d' WORKSPACE 2>/dev/null || true
# Build the project (CPU-only build; CUDA toolchain is not required for this configuration)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: Runtime image
FROM debian:bookworm-slim AS runtime
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libstdc++6 libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Copy built binary from builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Create a non-root user for running the binary
RUN useradd -m -s /bin/bash blitzar
USER blitzar
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
- Failing step (Dockerfile command): RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar
- Exit code: 2
- Exact errors to preserve:
- ERROR: Traceback (most recent call last):
File "/workspace/WORKSPACE", line 44, 15, in <toplevel>
git_repository(
Error in repository_rule: argument 'name' is required
- ERROR: Fetching target dependencies for deps(//...) encountered an error: error loading package under directory '': error loading package 'cbindings': Unable to find package for @@[unknown repo 'rules_cuda' requested from @@]//cuda:defs.bzl: The repository '@@[unknown repo 'rules_cuda' requested from @@]' could not be resolved: No repository visible as '@rules_cuda' from main repository.
- Missing packages/files or config issues highlighted:
- In workspace, a git_repository rule is being invoked without a required argument: name
- The build references an unknown/missing Bazel repository: rules_cuda (cuda:defs.bzl) not resolved; no repository visible as @rules_cuda
- Version info / notes observed:
- Bazelisk binary download: https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64
- Bazel version attempt noted as 7.1.2
- Debug note about boost rule: “Rule 'com_github_nelhage_rules_boost' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "ff4fefded63953945bcf61bc1f20c924bf7525ce"” (reproducible form hint)workspace(name = "dev_spaceandtime_blitzar")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
# libbacktrace
git_repository(
name = "com_github_ianlancetaylor_libbacktrace",
build_file = "//bazel/libbacktrace:libbacktrace.BUILD",
commit = "86885d1",
remote = "https://github.com/ianlancetaylor/libbacktrace",
)
# spdlog
git_repository(
name = "com_github_gabime_spdlog",
build_file = "//bazel:spdlog.BUILD",
commit = "5ebfc92",
remote = "https://github.com/gabime/spdlog",
)
# catch2
git_repository(
name = "com_github_catchorg_catch2",
commit = "53d0d91",
remote = "https://github.com/catchorg/Catch2",
)
# boost
git_repository(
name = "com_github_nelhage_rules_boost",
commit = "ff4fefd",
# Patch build to add libbacktrace dependency.
# See https://github.com/nelhage/rules_boost/issues/534
patches = [
"//bazel:stacktrace.patch",
],
remote = "https://github.com/nelhage/rules_boost",
)
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()
# rules_cuda
git_repository(
name = "rules_cuda",
commit = "775ba0c",
remote = "https://github.com/bazel-contrib/rules_cuda",
)
load("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains", "rules_cuda_dependencies")
rules_cuda_dependencies()
register_detected_cuda_toolchains()
# syntax=docker/dockerfile:1
# Stage 1: Builder (CPU-only, no CUDA) using a stable Debian base
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config unzip zip \
python3 python3-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy source code
COPY --chown=root:root . /workspace
# Patch WORKSPACE to avoid CUDA-related external dependencies (disable CUDA rules)
RUN python3 - <<'PY'
import io,sys
p='WORKSPACE'
with open(p,'r') as f:
s=f.read()
start = s.find('git_repository(\n name = "rules_cuda"')
if start!=-1:
end = s.find('\n)\n', start)
if end!=-1:
s = s[:start] + s[end+3:]
with open(p,'w') as f:
f.write(s)
print('patched')
PY
# Build the project (CPU-only build; CUDA toolchain is not required for this configuration)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: Runtime image
FROM debian:bookworm-slim AS runtime
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libstdc++6 libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Copy built binary from builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Create a non-root user for running the binary
RUN useradd -m -s /bin/bash blitzar
USER blitzar
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
Failing step - Builder step: RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar (Dockerfile:40) Exact error messages (preserved) - ERROR: Failed to load Starlark extension '@@rules_cuda//cuda:repositories.bzl'. - Cycle in the workspace file detected. This indicates that a repository is used prior to being defined. - The following chain of repository dependencies lead to the missing definition. - - @@rules_cuda - This could either mean you have to add the '@@rules_cuda' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file. - ERROR: Error computing the main repository mapping: cycles detected during computation of main repo mapping - ----- - process "/bin/sh -c bazelisk fetch //... && bazelisk build //app/blitzar:blitzar" did not complete successfully: exit code: 37 Missing packages/files (caused by error) - Missing repository definition: the Starlark extension is attempting to load '@@rules_cuda//cuda:repositories.bzl', but the @@rules_cuda repository is not defined (cycle in workspace leading to a missing definition). - Suggested fix mentions adding the '@@rules_cuda' repository (e.g., via http_archive) in the WORKSPACE file or moving its definition earlier. Version/tooling notes - Bazelisk attempted to download Bazel v7.1.2 (log shows: "Downloading https://releases.bazel.build/7.1.2/release/bazel-7.1.2-linux-x86_64..."), indicating the Bazel version being used for the build.
# syntax=docker/dockerfile:1
# Stage 1: Builder (CPU-only, avoiding CUDA to minimize host dependencies)
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config unzip zip \
python3 python3-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy full source context
COPY --chown=root:root . /workspace
# Patch WORKSPACE to remove CUDA-related rules to allow CPU-only build
RUN python3 - <<'PY'
import io,sys
p='WORKSPACE'
with open(p,'r') as f:
s=f.read()
# Remove blocks that define rules_cuda and related CUDA toolchain dependencies
import re
# Remove the git_repository block for rules_cuda
s = re.sub(r"(?s)#\s*rules_cuda.*?\)\n","",s, count=1)
# Remove loads and calls related to rules_cuda
lines = s.splitlines(True)
new_lines = []
skip = False
for line in lines:
if 'load("@rules_cuda' in line or 'repositories.bzl' in line and 'rules_cuda' in line:
continue
if 'register_detected_cuda_toolchains' in line or 'rules_cuda_dependencies' in line or 'commit = ' in line:
# skip lines related to CUDA toolchains
continue
new_lines.append(line)
with open(p,'w') as f:
f.writelines(new_lines)
print('WORKSPACE patched')
PY
# Build the project (CPU-only build)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: Runtime image (minimal, CPU-based)
FROM debian:bookworm-slim AS runtime
# Install runtime libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libstdc++6 libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Copy built binary from builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Create a non-root user for running the binary
RUN useradd -m -s /bin/bash blitzar
USER blitzar
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
- Build status: build_failed - Failing step: Docker build step: RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar (builder 7/7); exit code 1 - Root cause: git_repository fetch of //external:com_github_nelhage_rules_boost failed because commit, tag, or branch was not provided in WORKSPACE. Exact error: "Exactly one of commit, tag, or branch must be provided". No such package '@@com_github_nelhage_rules_boost//boost': Exactly one of commit, tag, or branch must be provided - Location of error: /workspace/WORKSPACE:26:15; stack traces reference external/bazel_tools/tools/build_defs/repo/git.bzl (lines 180 and 36) showing the failure to clone/update - Missing packages/files: The git_repository rule for //external:com_github_nelhage_rules_boost is missing a commit/tag/branch, causing Bazel to fail fetching the boost rules - Bazel/Bazelisk environment: Bazelisk fetches Bazel 7.1.2 (bazel-7.1.2-linux-x86_64); Bazelisk version v1.22.0; installed at /usr/local/bin/bazelisk - Additional context (concerns): CUDA-removal patch is brittle and may not remove all CUDA references across Bazel/workspace layouts, risking a CPU-only build if CUDA toolchains are still pulled in. The binary path /workspace/bazel-bin/app/blitzar/blitzar may fail if target name or output layout changes.
Image gcc:15.2.0-trixie exists on Docker Hub.
Image nvidia/cuda:12.6.0-devel-ubuntu22.04 exists on Docker Hub.
# syntax=docker/dockerfile:1
# Stage 1: Builder (CPU-only, avoiding CUDA to minimize host dependencies)
FROM debian:bookworm-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential pkg-config unzip zip \
python3 python3-dev python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper)
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.22.0/bazelisk-linux-amd64 \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy full source context
COPY --chown=root:root . /workspace
# Patch WORKSPACE to remove CUDA-related rules to allow CPU-only build
RUN python3 - <<'PY'
import io,sys
p='WORKSPACE'
with open(p,'r') as f:
s=f.read()
# Remove the CUDA rule dependencies block by dropping the rules_cuda load and related blocks
lines = s.splitlines(True)
new_lines = []
i=0
while i < len(lines):
line = lines[i]
if line.strip().startswith('git_repository(') and 'rules_cuda' in line:
# skip this entire git_repository block until the closing ')'
i += 1
# skip until a line that is a single closing parenthesis at column 0
while i < len(lines) and not lines[i].strip() == ')':
i += 1
# skip the closing ')'
if i < len(lines):
i += 1
continue
if line.strip().startswith('load("@rules_cuda'):
# skip this line and potentially following load lines until end of block
i += 1
continue
if 'register_detected_cuda_toolchains()' in line or 'rules_cuda_dependencies()' in line:
i += 1
continue
new_lines.append(line)
i += 1
with open(p,'w') as f:
f.writelines(new_lines)
print('WORKSPACE patched to CPU-only')
PY
# Build the project (CPU-only build)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar
# Stage 2: Runtime image (minimal, CPU-based)
FROM debian:bookworm-slim AS runtime
# Install runtime libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libstdc++6 libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Copy built binary from builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Create a non-root user for running the binary
RUN useradd -m -s /bin/bash blitzar
USER blitzar
WORKDIR /root
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD []
Summary (under 1500 chars): - Failing step: builder 7/7 RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Exact error message and exit code: ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such package '@@[unknown repo 'local_cuda' requested from @@]//': The repository '@@[unknown repo 'local_cuda' requested from @@]' could not be resolved: No repository visible as '@local_cuda' from main repository ------ ERROR: failed to build: failed to solve: process "/bin/sh -c bazelisk fetch //... && bazelisk build //app/blitzar:blitzar" did not complete successfully: exit code: 2 - Failing command/step: RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Missing packages or files mentioned: The workspace references an unknown repository 'local_cuda' (no repository visible as '@local_cuda' from the main repository), which could not be resolved. - Version mismatch / tooling context: - Bazelisk/Bazel download: Bazel 7.1.2 (bazel-7.1.2-linux-x86_64) via https://releases.bazel.build/7.1.2/release/bazel-7.1.2-linux-x86_64... - Bazelisk version: v1.22.0 The error occurs during dependency fetching due to an unresolved local_cuda repository in the BazelWORKSPACE/Bazel setup.
# Docker build cache **/*.pyc **/.DS_Store **/.cache **/.git **/node_modules **/.cargo **/target **/build
Summary (preserving actionable details): - Build status: VerifyBuild status: build_failed - Concerns: - Potentially brittle CUDA-removal patch in WORKSPACE; if workspace structure changes, patching may fail or reintroduce CUDA rules. - Runtime image may miss runtime dependencies required by the built binary (image currently installs only ca-certificates, libstdc++6, and libgcc-s1; additional libraries may be needed at runtime). - COPY path /workspace/bazel-bin/app/blitzar/blitzar depends on Bazel output layout; if the target name or path changes, the binary copy may break. - Failing step (Docker build): - [builder 7/7] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Exact error message and exit code: - ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such package '@@[unknown repo 'local_cuda' requested from @@]//': The repository '@@[unknown repo 'local_cuda' requested from @@]' could not be resolved: No repository visible as '@local_cuda' from main repository - ------ - ERROR: failed to build: failed to solve: process "/bin/sh -c bazelisk fetch //... && bazelisk build //app/blitzar:blitzar" did not complete successfully: exit code: 2 - Failing command/step details: - RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar - Missing packages/files or related issues mentioned: - Unresolved repository: unknown repo 'local_cuda' requested from the main Bazel workspace. The error indicates no repository visible as '@local_cuda' from the main repository. - Version and related info: - Bazelisk attempted to download Bazel 7.1.2 (bazel-7.1.2-linux-x86_64) as part of this step. - Build log shows Bazel rules with specific commits (e.g., com_github_nelhage_rules_boost commit ff4fefded63953945bcf61bc1f20c924bf7525ce and rules_cuda commit 775ba0c41679aab6ee60425360bdd841aaf92bb6), indicating external repos configured in WORKSPACE, but the local_cuda repo remains unresolved.
FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Ensure git is allowed to access the workspace
RUN git config --global --add safe.directory /workspace
# Build from source (disable CUDA paths via Bazel flag if needed)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN blitzar --version || true
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
- Failing step - Step [7/9] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false - Exact error message and exit code - ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such target '@@local_cuda//:cub': target 'cub' not declared in package '' defined by /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD - Exit code: 2 - Failing command/step details - Command: bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false - Context: inside Dockerfile at the RUN step above; Bazelisk attempted to fetch/build, but failed during dependency loading due to a Bazel target issue in local CUDA rules. - Missing packages or files mentioned - Missing/undefined target: cub in external local_cuda BUILD (no such target '@@local_cuda//:cub') - This indicates an unresolved target in the external CUDA-related Bazel configuration (external/local_cuda/BUILD) - Version mismatch or environment notes - Bazel version being used: Bazel 7.1.2 (bazel-7.1.2-linux-x86_64) - Bazelisk version: v1.19.0 - Observed in log: CUDA-related Bazel rules (rules_cuda, local_cuda) failing to preload a required target, suggesting a mismatch or misconfiguration between CUDA Bazel rules and the local_cuda repository (no cub target declared).
FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Ensure git is allowed to access the workspace
RUN git config --global --add safe.directory /workspace
# Patch CUDA-related workspaces to force CPU-only builds (disable CUDA Bazel rules)
RUN python3 - <<'PY'
import io,sys
p = 'WORKSPACE'
with open(p,'r') as f:
s = f.read()
# Remove CUDA-related dependencies block if present
s = s.replace('git_repository(\n name = "rules_cuda",\n commit = "775ba0c",\n remote = "https://github.com/bazel-contrib/rules_cuda",\n)\n','')
s = s.replace('\nload("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains", "rules_cuda_dependencies")\n','')
s = s.replace('\nrules_cuda_dependencies()\n','')
s = s.replace('\nregister_detected_cuda_toolchains()\n','')
with open(p,'w') as f:
f.write(s)
print('Patched WORKSPACE to disable CUDA rules')
PY
# Build from source (disable CUDA paths via Bazel flag if needed)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN blitzar --version || true
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
Failing step - [ 8/10] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false Exact error message and exit code - ERROR: Fetching target dependencies for deps(//...) encountered an error: error loading package under directory '': error loading package 'sxt/algorithm/block': at /workspace/bazel/sxt_build_system.bzl:1:6: Unable to find package for @@[unknown repo 'rules_cuda' requested from @@]//cuda:defs.bzl: The repository '@@[unknown repo 'rules_cuda' requested from @@]' could not be resolved: No repository visible as '@rules_cuda' from main repository. - ------ - Dockerfile:46 - ... did not complete successfully: exit code: 2 Missing packages/files mentioned - Bazel cannot resolve the repository "rules_cuda" (Unknown repo 'rules_cuda' requested from ...). The repository/packages required by the CUDA rules could not be found or not visible to the main Bazel workspace. Version/mismatch information - Bazel version attempted: Bazel 7.1.2 (downloaded by bazelisk: https://releases.bazel.build/7.1.2/release/bazel-7.1.2-linux-x86_64) - Bazelisk version: 1.19.0 - Base image: gcc:15.2.0-trixie (from prior step)
FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Ensure git is allowed to access the workspace
RUN git config --global --add safe.directory /workspace
# Sanitize CUDA-related Bazel configuration to attempt CPU-only build
RUN set -e; \
if [ -f WORKSPACE ]; then \
sed -i '/rules_cuda/d' WORKSPACE || true; \
sed -i '/@rules_cuda/d' WORKSPACE || true; \
sed -i '/load(.*rules_cuda/d' WORKSPACE || true; \
fi; \
if [ -f bazel/sxt_build_system.bzl ]; then \
sed -i '/cuda/d' bazel/sxt_build_system.bzl || true; \
sed -i '/defs.bzl/d' bazel/sxt_build_system.bzl || true; \
fi
# Build from source (disable CUDA paths via Bazel flag if needed)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
Failing step (command in Dockerfile) - RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false Exact errors and exit code - ERROR: /workspace/WORKSPACE:50:1: name 'register_detected_cuda_toolchains' is not defined - ERROR: Fetching target dependencies for deps(//...) encountered an error: error loading package under directory '': error loading package 'cbindings': Unable to find package for @@[unknown repo 'rules_cuda' requested from @@]//cuda:defs.bzl: The repository '@@[unknown repo 'rules_cuda' requested from @@]' could not be resolved: No repository visible as '@rules_cuda' from main repository. - Dockerfile:42 … the failing command is as above - ERROR: failed to build: failed to solve: process "/bin/sh -c bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false" did not complete successfully: exit code: 2 Missing packages/files mentioned - Unknown repo 'rules_cuda' required by cuda:defs.bzl (cannot resolve: No repository visible as '@rules_cuda' from main repository) - Possible missing/undefined toolchain symbol: 'register_detected_cuda_toolchains' (name not defined in WORKSPACE) Version information that matters - Base image: gcc:15.2.0-trixie - Bazelisk/Bazel version attempted: Bazelisk fetched Bazel 7.1.2 (bazel-7.1.2-linux-x86_64) - Context suggests a CUDA toolchain/rules configuration mismatch with the Bazel version in use (unknown repo 'rules_cuda' and undefined toolchain symbol).
FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Ensure git is allowed to access the workspace
RUN git config --global --add safe.directory /workspace
# Patch CUDA-related Bazel configuration to attempt CPU-only build
RUN python3 - <<'PY'
import io,sys
import re
def patch_file(path):
with open(path,'r') as f:
s = f.read()
s_lines = s.splitlines()
out_lines = []
i = 0
while i < len(s_lines):
line = s_lines[i]
if 'name = "rules_cuda"' in line:
# skip this whole block until a closing parenthesis of the block
i += 1
# skip until a line that ends with ')' after potential indentation
while i < len(s_lines):
if s_lines[i].strip().endswith(')'):
i += 1
break
i += 1
continue
if 'load("@rules_cuda' in line or 'rules_cuda_dependencies' in line or 'register_detected_cuda_toolchains' in line:
i += 1
continue
out_lines.append(line)
i += 1
with open(path,'w') as f:
f.write('\n'.join(out_lines))
print('Patched', path)
paths = ['WORKSPACE','bazel/sxt_build_system.bzl']
for p in paths:
try:
patch_file(p)
except Exception as e:
print('Patch error', p, e)
PY
# Build from source (CPU-only by default)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
Failing step - [ 8/10] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false Exact error message and exit code - ERROR: /workspace/WORKSPACE:48:1: syntax error at 'newline': expected expression - ERROR: Error computing the main repository mapping: error loading package 'external': Failed to parse WORKSPACE file - The failing command exited with code: 1 Missing packages or files mentioned - No missing files/packages explicitly listed. The failure is a syntax error in /workspace/WORKSPACE during Bazel workspace parsing (external mapping). Version/compatibility notes - Bazelisk version installed: v1.19.0 (from step that downloads bazelisk) - Bazel binary attempted: bazel-7.1.2-linux-x86_64 (downloaded during this step) - Root cause locus: syntax error in /workspace/WORKSPACE at line 48, causing failure to compute the main repository mapping.
FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Ensure git is allowed to access the workspace
RUN git config --global --add safe.directory /workspace
# Create a minimal stub for rules_cuda to allow CPU-only builds without requiring CUDA toolchain
RUN mkdir -p /workspace/overrides/rules_cuda/cuda
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
# Build from source (CPU-only, override CUDA rules with stub)
RUN bazelisk fetch //... --override_repository=rules_cuda=/workspace/overrides/rules_cuda \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false --override_repository=rules_cuda=/workspace/overrides/rules_cuda
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
Actionable summary:
- Build status: VerifyBuild status: build_failed
- Key concerns:
- Build relies on network access to fetch Bazel dependencies and CUDA rule overrides; in air-gapped environments this will fail.
- The binary path bazel-bin/app/blitzar/blitzar must exist after the Bazel build; if workspace layout changes, the COPY of the built binary may fail.
- If the project build requires environment specifics or flags beyond use_cuda=false, the Dockerfile assumes the target //app/blitzar:blitzar exists.
- Build error context:
- Summary of Docker build error
- Failing step:
- [ 8/11] RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- Exact error messages and exit code:
- 0.227 bash: line 1: warning: here-document at line 1 delimited by end-of-file (wanted `EOFndef')
- 0.227 bash: -c: line 1: syntax error near unexpected token `('
- 0.227 bash: -c: line 1: `cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- ------ Dockerfile:31
- (snippet) 29 | # Create a minimal stub for rules_cuda to allow CPU-only builds without requiring CUDA toolchain
- 31 | >>> RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- 32 |
- 33 | # Build from source (CPU-only, override CUDA rules with stub)
- --------------------
- ERROR: failed to build: failed to solve: process "/bin/sh -c bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << \"EOF\"\\\\ndef rules_cuda_dependencies():\\\\n pass\\\\n\\\\ndef register_detected_cuda_toolchains():\\\\n pass\\\\nEOF'" did not complete successfully: exit code: 2
- Base image / version info:
- Using base image gcc:15.2.0-trixie (docker.io/library/gcc:15.2.0-trixie)
- Missing packages or files:
- None explicitly missing; the error is a shell syntax issue with the here-document in the RUN command.
- Version mismatch information:
- No explicit version mismatch reported. The build uses gcc:15.2.0-trixie as the base image.
- Notes:
- The error arises from a here-document in the Dockerfile RUN command, resulting in a syntax error near an unexpected token '(' and exit code 2. To fix, correct the here-document construction for /workspace/overrides/rules_cuda/cuda/defs.bzl (proper EOF handling and quoting).FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Ensure git is allowed to access the workspace
RUN git config --global --add safe.directory /workspace
# Create a minimal stub for rules_cuda to allow CPU-only builds via override_repository
RUN mkdir -p /workspace/overrides/rules_cuda/cuda
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
RUN bash -lc 'mkdir -p /workspace/overrides/rules_cuda/cuda; printf "package(default_visibility = [\\"//visibility:public\\"])" > /workspace/overrides/rules_cuda/cuda/BUILD'
# Build from source (CPU-only, use an override for rules_cuda)
RUN bazelisk fetch //... --override_repository=rules_cuda=/workspace/overrides/rules_cuda \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false --override_repository=rules_cuda=/workspace/overrides/rules_cuda
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version || true
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
Summary of Docker build error
- Failing step
- [ 8/12] RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- Exact error messages (preserved)
- bash: line 1: warning: here-document at line 1 delimited by end-of-file (wanted `EOFndef')
- bash: -c: line 1: syntax error near unexpected token `('
- bash: -c: `cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- Exit code
- failed to build: failed to solve: process "/bin/sh -c bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << \"EOF\"\\ndef rules_cuda_dependencies():\\n pass\\n\\ndef register_detected_cuda_toolchains():\\n pass\\nEOF'" did not complete successfully: exit code: 2
- Context from log (version info)
- Base image: gcc:15.2.0-trixie (sha256:34214606c5ff7f9f6f0530c0edf7ce30d12ff6ac973fda861e61c92e99f4f607)
- Bazelisk version attempted: v1.19.0 (downloaded in step 6)
- Missing packages or files
- Not mentioned; error indicates a syntax issue with the here-document, not a missing file.
- Notes
- The failure is due to a malformed here-document in the Dockerfile (line 31), causing a syntax error near the '(' and an unexpected end-of-file delimiter.FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Ensure git is allowed to access the workspace
RUN git config --global --add safe.directory /workspace
# Patch CUDA-related Bazel configuration to attempt CPU-only build by removing CUDA rules
RUN python3 - <<'PY'
import re
p = 'WORKSPACE'
with open(p,'r') as f:
s = f.read()
pattern = re.compile(r'git_repository\(\s*name\s*=\s*"rules_cuda".*?\)\\n', re.S)
s2 = pattern.sub('', s)
s2 = s2.replace('load("@rules_cuda//cuda:repositories.bzl", "register_detected_cuda_toolchains", "rules_cuda_dependencies")\n','')
s2 = s2.replace('rules_cuda_dependencies()\n','')
s2 = s2.replace('register_detected_cuda_toolchains()\n','')
with open(p,'w') as f:
f.write(s2)
print('Workspace patched')
PY
# Build from source (CPU-only by default)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
- Exact error message and exit code - Exit code: 2 - ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such package '@@[unknown repo 'local_cuda' requested from @@]//': The repository '@@[unknown repo 'local_cuda' requested from @@]' could not be resolved: No repository visible as '@local_cuda' from main repository - Failing command/step - Step 8/10 in Dockerfile - RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false - Missing packages or files mentioned - The error indicates a missing Bazel external repository: unknown repo 'local_cuda' requested from @@; the repository '@local_cuda' could not be resolved (i.e., local_cuda is not defined or visible inWORKSPACE) - Version mismatch/info - Base image: gcc:15.2.0-trixie - Bazelisk version downloaded: v1.19.0 - Bazel version downloaded: 7.1.2 (bazel-7.1.2-linux-x86_64) - Issue appears due to unresolved external repository (local_cuda) rather than a clear version mismatch.
FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Create a minimal stub for CUDA rule overrides to allow CPU-only builds via repository override
RUN mkdir -p /workspace/overrides/rules_cuda/cuda
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/repositories.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
# Build from source (CPU-only by using an override_repository for rules_cuda)
RUN bazelisk fetch //... --override_repository=rules_cuda=/workspace/overrides/rules_cuda \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false --override_repository=rules_cuda=/workspace/overrides/rules_cuda
# Install the built binary to a standard location
RUN set -e; if [ -f bazel-bin/app/blitzar/blitzar ]; then cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar; else echo 'Build output not found:'; ls -R; exit 1; fi
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
- Failing step: [ 7/10] RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/repositories.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- Exact error messages and exit code:
- 0.217 bash: line 1: warning: here-document at line 1 delimited by end-of-file (wanted `EOFndef')
- 0.217 bash: -c: line 1: syntax error near unexpected token `('
- 0.217 bash: -c: line 1: `cat > /workspace/overrides/rules_cuda/cuda/repositories.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- ERROR: failed to build: failed to solve: process "/bin/sh -c bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/repositories.bzl << \"EOF\"\\ndef rules_cuda_dependencies():\\n pass\\n\\ndef register_detected_cuda_toolchains():\\n pass\\nEOF'" did not complete successfully: exit code: 2
- Failing command/step details:
- RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/repositories.bzl << "EOF"\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
- Missing packages or files mentioned: None. The error is due to an incorrect here-document in the RUN command, not a missing package/file.
- Version information:
- Base image: gcc:15.2.0-trixie (digest sha256:34214606c5ff7f9f6f0530c0edf7ce30d12ff6ac973fda861e61c92e99f4f607)
- Bazelisk version referenced: v1.19.0 (downloaded in step 7)FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Create a minimal stub for CUDA rule overrides to allow CPU-only builds via repository override
RUN mkdir -p /workspace/overrides/rules_cuda/cuda
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/repositories.bzl << "PY"\n
def rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nPY'
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "PY"\n# Minimal dummy CUDA defs for CPU-only build\nPY'
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/BUILD << "PY"\npackage(default_visibility = ["//visibility:public"])\nPY'
# Build from source (CPU-only by using an override_repository for rules_cuda)
RUN bazelisk fetch //... --override_repository=rules_cuda=/workspace/overrides/rules_cuda \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false --override_repository=rules_cuda=/workspace/overrides/rules_cuda
# Install the built binary to a standard location
RUN set -e; if [ -f bazel-bin/app/blitzar/blitzar ]; then cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar; else echo 'Build output not found:'; ls -R; exit 1; fi
# Basic self-test availability
RUN /usr/local/bin/blitzar --version || true
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
#0 building with "default" instance using docker driver #1 [internal] load build definition from Dockerfile #1 transferring dockerfile: 1.95kB done #1 DONE 0.0s Dockerfile:29 -------------------- 27 | RUN mkdir -p /workspace/overrides/rules_cuda/cuda 28 | RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/repositories.bzl << "PY"\n 29 | >>> def rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nPY' 30 | RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "PY"\n# Minimal dummy CUDA defs for CPU-only build\nPY' 31 | RUN bash -lc 'cat > /workspace/overrides/rules_cuda/BUILD << "PY"\npackage(default_visibility = ["//visibility:public"])\nPY' -------------------- ERROR: failed to build: failed to solve: dockerfile parse error on line 29: unknown instruction: def
FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Create a default Bazel rules file to disable CUDA if present (safe default for CPU builds)
RUN bash -lc 'printf "build --define=use_cuda=false\n" > .bazelrc || true'
# Build from source (CPU-only by default)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
Summary (under 1500 chars): - Exact error message and exit code: ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such target '@@local_cuda//:cuda_runtime_static': target 'cuda_runtime_static' not declared in package '' defined by /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/local_cuda/BUILD Exit code: 2 - Failing command/step: [7/9] RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false - Missing packages or files mentioned: - Missing target: cuda_runtime_static in external/local_cuda/BUILD (target '@@local_cuda//:cuda_runtime_static' not declared) - Version mismatch information: - Bazel version being pulled: Bazel 7.1.2 (bazel-7.1.2-linux-x86_64) - Bazelisk version: 1.19.0 - Context: CUDA-related Bazel rules failing due to missing/undeclared cuda_runtime_static in local_cuda, suggesting a mismatch or misconfiguration between the CUDA rule version and the local_cuda repository.
FROM bazel/bazel:7.1.2 as builder
# Install build tools and essential dependencies in builder
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Build the target from source (disable CUDA by flag if supported by project)
RUN bazel build //app/blitzar:blitzar --define=use_cuda=false
FROM debian:bookworm-slim
# Runtime dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
libstdc++6 \
libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root
# Copy the built binary from the builder stage
COPY --from=builder /workspace/bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
RUN chmod +x /usr/local/bin/blitzar
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
FROM gcc:15.2.0-trixie AS builder
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Create a minimal stub for rules_cuda to allow CPU-only builds via repository override
RUN mkdir -p /workspace/overrides/rules_cuda/cuda
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/BUILD << "EOF"\n# stub for CUDA rules to enable CPU-only build via override\nEOF'
RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/defs.bzl << "EOF"\n# Minimal dummy CUDA defs for CPU-only build\ndef rules_cuda_dependencies():\n pass\n\ndef register_detected_cuda_toolchains():\n pass\nEOF'
# Build from source (CPU-only by default using override repository for rules_cuda)
RUN bazelisk fetch //... --override_repository=rules_cuda=/workspace/overrides/rules_cuda \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false --override_repository=rules_cuda=/workspace/overrides/rules_cuda
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
# Runtime image
FROM debian:bookworm-slim
# Runtime dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
libstdc++6 \
libgcc-s1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root
COPY --from=builder /usr/local/bin/blitzar /usr/local/bin/blitzar
RUN chmod +x /usr/local/bin/blitzar
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
- VerifyBuild status: build_failed
- Build error
- Failing command/step:
[builder 7/11] RUN bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/BUILD << "EOF"\n# stub for CUDA rules to enable CPU-only build via override\nEOF'
- Exact error message:
"ERROR: process \"/bin/sh -c bash -lc 'cat > /workspace/overrides/rules_cuda/cuda/BUILD << \\\"EOF\\\"\\n# stub for CUDA rules to enable CPU-only build via override\\nEOF'\" did not complete successfully: exit code: 1"
- Per-step output (from the failing step):
- "bash: line 1: warning: here-document at line 1 delimited by end-of-file (wanted `EOFn#')"
- "cat: stub: No such file or directory"
- "cat: for: No such file or directory"
- "cat: CUDA: No such file or directory"
- "cat: rules: No such file or directory"
- "cat: to: No such file or directory"
- "cat: enable: No such file or directory"
- "cat: CPU-only: No such file or directory"
- "cat: build: No such file or directory"
- "cat: via: No such file or directory"
- "cat: overridenEOF: No such file or directory"
- Missing packages/files: None explicitly reported. Errors indicate the here-document failed to create /workspace/overrides/rules_cuda/cuda/BUILD due to an EOF/quoting issue, yielding multiple "No such file or directory" messages for the here-doc content tokens.
- Version mismatch: None reported.
- stage-1 base: debian:bookworm-slim
- builder base: gcc:15.2.0-trixie
- Root cause (notes): Improperly formed here-document in the RUN command, causing the shell to misinterpret the EOF delimiter and produce cascading "No such file or directory" errors.
- Recommendations (actionable):
- Correct the here-document syntax in the RUN command (proper EOF delimiter handling and quoting).
- Ensure /workspace/overrides/rules_cuda/cuda/BUILD path exists or create it before writing.
- Consider writing the file with a simpler approach (e.g., a file write via printf/cat with a separate script) to avoid complex quoting.
- After fix, verify dependencies/libraries in the runtime image (ldd) and ensure required libs are present if CPU-only build is intended.FROM gcc:15.2.0-trixie
# Install build tools and essential dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
ca-certificates \
curl \
unzip \
build-essential \
pkg-config \
libstdc++6 \
libgcc-s1 \
python3 \
&& rm -rf /var/lib/apt/lists/*
# Install Bazelisk (bazel wrapper) to drive Bazel builds
RUN curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
&& chmod +x /usr/local/bin/bazelisk
WORKDIR /workspace
# Copy project source
COPY . /workspace
# Patch WORKSPACE to remove CUDA rules to enable CPU-only builds
RUN python3 - <<'PY'
import io
p = 'WORKSPACE'
with open(p,'r') as f:
lines = f.read().splitlines()
new_lines = []
i = 0
while i < len(lines):
line = lines[i]
if 'git_repository(' in line and 'name = "rules_cuda"' in line:
# Skip until the end of this paren block
paren = 0
while i < len(lines):
paren += lines[i].count('(')
paren -= lines[i].count(')')
i += 1
if paren <= 0:
break
continue
if 'load("@rules_cuda' in line or 'rules_cuda_dependencies' in line or 'register_detected_cuda_toolchains' in line:
i += 1
continue
new_lines.append(line)
i += 1
with open(p,'w') as f:
f.write('\n'.join(new_lines))
print('Patched WORKSPACE to remove rules_cuda block')
PY
# Build from source (CPU-only by default via removal of CUDA rules)
RUN bazelisk fetch //... \
&& bazelisk build //app/blitzar:blitzar --define=use_cuda=false
# Install the built binary to a standard location
RUN cp bazel-bin/app/blitzar/blitzar /usr/local/bin/blitzar
# Basic self-test availability
RUN /usr/local/bin/blitzar --version
ENTRYPOINT ["/usr/local/bin/blitzar"]
CMD ["--help"]
- Failing step (Dockerfile step 7/9): RUN bazelisk fetch //... && bazelisk build //app/blitzar:blitzar --define=use_cuda=false - Exact error message and exit code: ERROR: Fetching target dependencies for deps(//...) encountered an error: Evaluation of query "deps(//...)" failed: preloading transitive closure failed: no such package '@@[unknown repo 'local_cuda' requested from @@]//': The repository '@@[unknown repo 'local_cuda' requested from @@]' could not be resolved: No repository visible as '@local_cuda' from main repository ... (the process then exits with) exit code: 2 - Missing packages/files / repository issue: - The build cannot resolve the repository local_cuda: "no such package '@@[unknown repo 'local_cuda' requested from @@]//'" and "The repository '@@[unknown repo 'local_cuda' requested from @@]' could not be resolved: No repository visible as '@local_cuda' from main repository" - This indicates the local_cuda repository is not defined/visible in WORKSPACE for the Bazel fetch/build. - Version information observed: - Bazel version being downloaded via Bazelisk: Bazel 7.1.2 (https://releases.bazel.build/7.1.2/release/bazel-7.1.2-linux-x86_64...)