Skip to main content

build-without-dfinity-infra

Use when you need to run a Bazel build or test outside DFINITY's internal infrastructure — i.e. without access to the internal remote cache / remote downloader (bazel-remote.idx.dfinity.network), e.g. on a personal machine, in a sandbox, or for a reproducibility check. Two ways: --config=local, or bypassing the workspace bazelrc.

설치로 이동

소스 정보

저장소
dfinity/ic
최근 소스 활동
2026년 9월 16일 21:38
감지된 SKILL.md 언어
영어
스타
1,792
포크
410

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
build-without-dfinity-infra
description
Use when you need to run a Bazel build or test outside DFINITY's internal infrastructure — i.e. without access to the internal remote cache / remote downloader (bazel-remote.idx.dfinity.network), e.g. on a personal machine, in a sandbox, or for a reproducibility check. Two ways: --config=local, or bypassing the workspace bazelrc.
# Building without DFINITY's internal infrastructure The repo's `.bazelrc` imports `bazel/conf/.bazelrc.internal`, which points Bazel at DFINITY's internal remote cache and remote downloader (`bazel-remote.idx.dfinity.network`). These endpoints are reachable only from inside DFINITY's internal network — in practice that essentially means a **devenv** machine. They are **not** available on, e.g., a namespace.so devbox, a sandbox, or CI without those credentials, where a plain `bazel build` will fail or stall, and a plain `bazel query` or `bazel fetch` downloads each repository it needs from origin only after a failed attempt against the internal remote downloader (one `Remote Cache:` warning per fetch). If you're unsure whether the infra is reachable from where you are, probe it: ```sh curl -sS --max-time 5 -o /dev/null https://bazel-remote.idx.dfinity.network \ && echo "internal cache reachable" \ || echo "internal cache NOT reachable — build with --config=local" ``` When it's not reachable, build with one of the two approaches below. ## Option 1 — `--config=local` (recommended) Keeps the full workspace configuration but empties `--remote_cache=` and `--experimental_remote_downloader=` (see the `common:local` lines in `bazel/conf/.bazelrc.internal`), so no command contacts the internal endpoints: ```sh bazel build --config=local //my:target bazel query --config=local 'deps(//my:target)' ``` Use this when you want the normal build config minus the remote cache. It is also what you want for reproducibility checks, where a cache hit could otherwise mask non-determinism. ## Option 2 — bypass the workspace bazelrc entirely Ignore the workspace `.bazelrc` (which is what pulls in `.bazelrc.internal`) and load only the minimal build config, via *startup* options: ```sh bazel --noworkspace_rc --bazelrc=bazel/conf/.bazelrc.build build //my:target ``` These are startup options (before the `build` subcommand), and `--bazelrc` is resolved relative to the current working directory. Use this when you want nothing from the workspace/internal config at all — only the settings required to build. ## Which to use Prefer `--config=local`: it's a single build flag and keeps the rest of the workspace config intact. Reach for the `--noworkspace_rc` form only when you specifically need to exclude everything the workspace `.bazelrc` imports. ## Running in the dev container This is orthogonal to *where* you build — still run these through the pinned dev container. See the **run-in-dev-container** skill for how to invoke `container-run.sh`, including the podman/docker runtime choice for hosts without podman. ## Caveat: system tests won't work These flags only drop the remote cache/downloader; they can't replace the rest of the internal infrastructure. In particular, **system tests will not run**: they provision VMs via Farm, which lives inside DFINITY's internal network and is unreachable from outside it. `--config=local` removes the cache but cannot substitute Farm. Limit yourself to `bazel build` and non-system tests.
GitHub에서 보기