Skip to content

core: load-graph test covers BUILD packages of core tool label_flag defaults #10117

Closed

Description

@TrapsterDK

Follow-up to #10085 (part of #10084).

The #10085 load-graph test covers .bzl loads from core and config/BUILD.bazel. Core shard aspects also depend on tool targets through //config:tool_* label_flags. Analysis loads the BUILD file of each flag's default package. If that BUILD file loads a language rule set, every consumer fetches that rule set, even when the language goes unused.

Where

  • config/BUILD.bazel (label_flag build_setting_default values for tools used by core-family shards)
  • quality/families/core.bzl and the core-family files that quality/families/core_probe.bzl loads (TOOLS[*]["attr"] defaults)
  • the core load-graph test added by core: loading core never fetches a language rule set #10085

Fix

  • Extend the test: for every tool in a core-family TOOLS table, resolve the //config:tool_* default to its package and add that package's BUILD.bazel to the roots.
  • Move each tool target that fails into a package whose BUILD file loads no language rule set. A prebuilt in @dx_tools already passes; a rules_py or rules_rust build does not.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B

Activity

  1. added
    P2
    model:sonnet
    on Nov 9, 2026
  2. TrapsterDK commented on Nov 9, 2026

    @TrapsterDK
    CollaboratorAuthor

    Found while planning #10085: core-family aspect files also point straight at rules_py tools, with no //config:tool_* flag in between. Analysis loads quality/tools/python/BUILD.bazel, which loads @rules_py at line 1, so a Go-only consumer still fetches rules_py after #10085.

    Where

    • quality/families/core.bzl:27 (docstrfmt)
    • quality/families/ansible.bzl:7, cloudformation.bzl:7, cmake.bzl:7, html_template.bzl:7, make.bzl:13, sql.bzl:8, yaml.bzl:13

    Fix

    • Have the test also follow literal attr.label(default = "//pkg:...") values in reachable .bzl files into pkg/BUILD.bazel.
    • Move these tools out of a rules_py package, as described above.
  3. TrapsterDK commented on Nov 9, 2026

    @TrapsterDK
    CollaboratorAuthor

    Investigated, no change made. Aspect attr defaults (including label_flag defaults such as //config:tool_ruff) are resolved when the aspect is instantiated, so repointing these attrs at a flag still loads quality/tools/python/BUILD.bazel and @rules_py. Splitting the package does not help either, since docstrfmt (core.bzl) is still a rules_py py_binary. Needs a design decision from #10085: either the data/toolchain mechanism for registering quality tools, or prebuilt hermetic builds (sha256-pinned archives in @dx_tools) of the 9 python tools so the default labels need no rules_py load. The test from the first Fix bullet does not exist on main yet.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hzLvRXZcoZvVp18RGd

  4. TrapsterDK commented on Nov 10, 2026

    @TrapsterDK
    CollaboratorAuthor

    Audit of origin/main: unchanged. quality/tools/python still exists and the core family aspect files still default to it; blocked on the design decision in the earlier comment.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hzLvRXZcoZvVp18RGd

  5. TrapsterDK commented on Nov 10, 2026

    @TrapsterDK
    CollaboratorAuthor

    Decision: Python core tools go prebuilt via @dx_prebuilt (#10544, #10545). This PR adds the test and a shrink-only pending list.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Xut2hzLvRXZcoZvVp18RGd

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

    P2model:sonnet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions