Skip to content

Lazy by default: fetch and set up nothing that is not used #15298

Backlog

Description

@TrapsterDK

A consumer that adds rules_dx but builds nothing from it should fetch and set up nothing beyond an empty project. A consumer that uses one language should fetch only that language's tools.

Speed

  • Bare consumer builds: fails analysis today on @dx_rust_toolchains//:..._rustdoc.

Cold

Fresh output base, empty repository cache, median of 3.

  • Empty consumer: 66 repos, 125 MB, ~2.7 s.
  • Bare rules_dx consumer: 130 repos, 595 MB, 5.4–7.5 s. Target: same as empty.
  • Per-language consumers fetch only their own tools.

Warm

Warm build --nobuild after shutdown, median of 5.

  • Baseline measured for empty, bare and per-language consumers.
  • Toolchain packages load no heavy .bzl.

Abstract

  • One shared helper for toolchain hubs, lazy repos and platform lists that every language uses.
  • A test fails when any registered toolchain fetches a repo the build does not use.
  • One registration line for consumers that works with --incompatible_restrict_non_root_registrations.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxwSmXz9LXAwC5de1M

Grouped trackers

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hxb7tMzRqzVaKmAvVT

Activity

  1. TrapsterDK commented on Nov 30, 2026

    @TrapsterDK
    CollaboratorAuthor

    Progress from the bare-consumer and fetch-measurement lane. Measured on Linux x86_64 with Bazel 9.3.1 and --jobs=4. Each consumer has only bazel_dep(rules_dx) plus local_path_override, and the target is build --nobuild //:t.

    Speed

    • rust: register the musl companion toolchains from a hub, so a bare consumer resolves (part of #15298) #15300 fixes the bare-consumer failure invalid registered toolchain '@dx_rust_toolchains//:..._musl__stable__clippy'. The musl clippy and rustdoc toolchains existed only when the root-only rules_rust patches applied; they now come from a dx_rust_musl_toolchains hub. The PR adds an offline regression case to nested_bazel_harness_test, and it re-records the harness cache set, which was stale on main (an_indirect_consumer_... was missing rules_kotlin-v2.4.21.tar.gz).
    • Other bare-consumer breaks, all from root-only patches (tools/testing/consumer/pending.txt):
      • @rules_dx//rust:defs.bzl fails to load without the rules_rust override (@@rules_rust+//rust/private:rustdoc_toolchain.bzl: no such file).
      • Without a host PATH, rules_py's rules_py_uv_host fails with Unable to determine host libc!.
      • Java needs --java_runtime_version, because the default local_jdk fails.

    Cold

    Fresh output base and empty repository cache, median of 3. MB is the whole cache, mostly extracted contents; dl is the downloads.

    consumer repos MB (dl) ms
    empty MODULE 65 125 (32) 2770
    bare 137 598 (143) 5510
    bare, no rules_dx register_toolchains 121 594 (145) (single run)
    go 141 924 (207) 7475
    rust (plus the rules_rust override) 145 1284 (259) 11875
    java (plus remotejdk_25 flags) 144 1658 (487) 10644
    • I dropped each register_toolchains call one at a time. No single call adds more than 6 repos or 5 MB:
      • cc: llvm, llvm_version, dx_cc_toolchains, dx_licenses, dx_pins_data, dx_windows_support
      • julia: rules_julia, dx_prebuilt, via julia/private/toolchains.BUILD.bazel → runtime/defs.bzl
      • haskell, d and dx_rust_toolchains: llvm
      • most others: dx_pins_data and dx_toolchains
    • All of our registrations together add about 16 repos and about 5 MB, not the 50-100 MB the plan estimates.
    • The roughly 470 MB gap between bare and empty comes from the module graph and other modules' non-dev registrations. The largest pieces are rules_rust 220 MB, bazel_tools 72, protobuf 57 and rules_kotlin 54. Only bazel#32487 or upstream opt-in can remove them.
    • Cross-language leak: the java consumer also fetches python_3_14_x86_64-unknown-linux-gnu.

    Warm

    build --nobuild after shutdown, median of 5. Spread is about 3%.

    empty bare go rust java
    1283 1951 2274 2208 2223

    Abstract

    • The fetch-guard test fits PR 3 of the plan: a bare consumer fetches no rules_dx+ repo, and a rust-only consumer fetches nothing else. It can only pass after PRs 2 and 4, so I am leaving it to PR 3.
    • Today a bare consumer fetches 15 rules_dx+ repos.
    • The rust-only consumer adds only host repos for Linux x86_64 on top of bare: rustc, std, tools, tinyjson and dx_coreutils.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hxwSmXz9LXAwC5de1M

  2. TrapsterDK commented on Nov 30, 2026

    @TrapsterDK
    CollaboratorAuthor

    Abstract: platform support work, built on the platforms.json table from the lazy plan, is tracked in #15302.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hxwSmXz9LXAwC5de1M

  3. TrapsterDK commented on Nov 30, 2026

    @TrapsterDK
    CollaboratorAuthor

    Warm: the dx_pins lazy-check branch (perf-ext-lazy, 536e466) cuts lockfile restarts from 88 to 36 and the dx_pins check from 668 ms to 451 ms. Warm total is unchanged: 8181 ms vs 8221 ms median of 5, with a spread of about 1.5 s. No PR. The remaining restarts come from re-reading the 35 pins JSON files, so the next gain needs a Bazel change that batch-checks recorded files from the same repository.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hxwSmXz9LXAwC5de1M

  4. TrapsterDK commented on Nov 30, 2026

    @TrapsterDK
    CollaboratorAuthor

    Merged #15312: rules_dx's rust docs rules now load in a consumer on stock rules_rust. Covered by a nested harness case. Items (b) (blocked on aspect-build/rules_py#1686) and (c) remain.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hxb7tMzRqzVaKmAvVT

  5. TrapsterDK commented on Nov 30, 2026

    @TrapsterDK
    CollaboratorAuthor

    Merged #15313 (platform table PR1, part of #15303). macos_x86_64 stays host-only until every lang.json lists it; that lands with the rest of #15303.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hxb7tMzRqzVaKmAvVT

  6. TrapsterDK commented on Nov 30, 2026

    @TrapsterDK
    CollaboratorAuthor

    Merged #15314 (macos_x86_64 analysis fixes, part of #15303). Three rules_apple fixture roots still need a macOS exec platform to analyze for macos_x86_64.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hxb7tMzRqzVaKmAvVT

  7. TrapsterDK commented on Nov 30, 2026

    @TrapsterDK
    CollaboratorAuthor

    Merged #15315: a warm dx test makes one launcher call instead of two. Fresh consumer, 15 interleaved runs: median 700 ms before, 439 ms after.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hxb7tMzRqzVaKmAvVT

  8. 299 remaining items

  9. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    Windows strtoul fix (#15610) is upstream: issue hermeticbuild/hermetic-llvm#1021, PR hermeticbuild/hermetic-llvm#1022. Drop patches/llvm/runtime_exec_configuration.patch once a release carries it.

  10. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    B12 item 62 (swift): split merged in #15626. Upstream issue bazelbuild/rules_swift#2044 and PR bazelbuild/rules_swift#2045 for Windows linker_inputs. Rust toolchain_components.patch waits for a rules_rust release with #4354 and #4397, which are already merged.

  11. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    Haskell split (#15632): upstream issues filed: tweag/rules_haskell#2534 (static library action misses cc toolchain files) and tweag/rules_haskell#2535 (cc_wrapper cannot find an external cc). Patch headers will point at them before merge.

  12. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    Merged #15632 (9dbedf7): Haskell step 2. Patch headers point at tweag/rules_haskell#2534 and #2535. Upstream PRs with regression tests are next.

  13. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    Merged #15633 (c32bbc2): dx lock and dx lock --check for the root lock (#15409).

  14. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    Upstream PRs opened with regression tests: tweag/rules_haskell#2536 (fixes #2534, cc_toolchain_inputs.patch) and tweag/rules_haskell#2537 (fixes #2535, cc_wrapper_external_cc.patch). Delete the patches once a release carries them.

  15. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    Main CI fixes merged: #15634 (Biome test globals for *_test.*), #15635 (Error Prone dataflow jar on the processor path), #15636 (Qt repos on hosts without a pinned 7-Zip). Still open: linux_arm64 cc_allocator_library has no C++ toolchain.

  16. TrapsterDK commented on Dec 4, 2026

    @TrapsterDK
    CollaboratorAuthor

    Progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions