Skip to content

cli: add dx fetch and --offline for build and test (closes #13197) - #13285

Merged
TrapsterDK merged 3 commits into
mainfrom
issue-13197-dx-fetch
Nov 18, 2026
Merged

TrapsterDK merged 3 commits into
mainfrom
issue-13197-dx-fetch

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Users need a way to download everything a build needs while online, then build and test with no network.

What

  • dx fetch [--vendor[=DIR]] [--here] [--affected [--since <ref>|--base <ref>]] [--debug|--release] [scope ...] [-- bazel-options ...] runs bazel fetch (or bazel vendor with --vendor, default vendor_src) over dx scopes with the same .bazelrc, cache settings and build mode as dx build. Like dx build, --affected with scopes keeps only the affected targets inside them.
  • After Bazel succeeds, dx fetch places the pinned prebuilt dx into $DX_CACHE_DIR/bin/<version>/ when the running binary matches the .dx/pins sha256 (cli/cli/src/exec/dx_asset.rs), and reports a dx_cached or dx_not_cached notice.
  • dx build --offline and dx test --offline pass --repository_disable_download to Bazel and to the scope queries.
  • The release consumer test runs dx fetch //..., then dx test --offline //... with every download blocked through a --downloader_config of block *.
  • Docs: new docs/cli/commands/fetch.md (in the user book and route test), and --offline in build-test-coverage.md.

Tests

  • bazel test //cli/plan:dx_plan_test //cli/process:dx_process_test //cli/cli:dx_cli_test //tools/ci:command_docs_test //tools/docs/site:rendered_site_test //tools/docs/site:site_unit: all pass.
  • //tools/api:api_test: api/cli.json is regenerated (it also picks up dx --affected: intersect with scopes, clear no-git error, --base and [affected] base #13277's --base). The test still fails on main's dx.schema.json changed but its version is still 1; bump the schema version first, which comes from dx --affected: intersect with scopes, clear no-git error, --base and [affected] base #13277, not this PR.
  • tools/dx check --apply --affected: generate, format, typecheck pass. Lint warnings are only in files this PR doesn't touch.
  • //tools/ci:prose_rules_test fails on main already (docs/design/layout.md: 1304 words). This PR doesn't touch that file.
  • //deploy/private/release/tests:release_consumer_smoke_test runs through evidence.yml on linux_x86_64, macos_arm64 and windows_x86_64.

Closes #13197

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K

TrapsterDK and others added 3 commits November 18, 2026 01:51
dx fetch runs bazel fetch (bazel vendor with --vendor[=DIR], default
vendor_src) over dx scopes, with the build mode and shared settings dx
build uses, then places the pinned prebuilt dx into DX_CACHE_DIR when the
running binary matches the .dx/pins sha256. dx build/test --offline pass
--repository_disable_download to Bazel and the scope queries. The release
consumer test runs dx fetch, then dx test --offline with every download
blocked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
…ch page in the user book

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
… dx build

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
@TrapsterDK
TrapsterDK merged commit eb3059f into main Nov 18, 2026
2 of 12 checks passed
@TrapsterDK
TrapsterDK deleted the issue-13197-dx-fetch branch November 18, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dx fetch: warm caches for offline builds

1 participant