Skip to content

fix(buck2): ship static_checks in the consumer rules product - #1352

Merged
schickling merged 4 commits into
mainfrom
schickling-assistant/2026-09-23-rules-inventory-static-checks
Sep 23, 2026
Merged

schickling merged 4 commits into
mainfrom
schickling-assistant/2026-09-23-rules-inventory-static-checks

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

The standalone consumer rules product is broken from current main in four independent ways, all reproduced by building the first downstream consumer against the locked provider:

  1. The TypeScript package projection (schema 12) emits load("@rules//buck2:static_checks.bzl", ...) in every consumer BUCK file, but the rules product inventory never shipped buck2/static_checks.bzl:
From load at packages/@overeng/meters/BUCK:13
Caused by:
    File not found: rules//buck2/static_checks.bzl
  1. nix build .#buck2-rules fails outright since feat(buck2): add standalone root and aggregate gates #1301/feat(buck2): move bounded Weaver checks #1302 switched the toolchains sources to @capabilities natively — the packager's --replace-fail substitutions find nothing:
substituteStream() in derivation buck2-rules: ERROR: pattern "//.buck2/capabilities:defs.bzl"
doesn't match anything in file '.../buck2-rules/buck2/toolchains/BUCK'
  1. The projection emits workspace_dist / workspace_dependency_views on every package_tree(...) call, but the package_tree wrapper neither declared nor forwarded them:
error: Argument `workspace_dependency_views` occurs more than once
  1. The toolchains, javascript, package_tools, and static_checks rules reference labels under packages/@overeng/buck2-tools (typescript-runner.ts, package_command_runtime, javascript_action_runtime, src/static-check-runner.ts, src/repository-policy-runner.ts), but the product shipped neither the runner sources nor the package, so every consumer target evaluation fails with package rules//packages/@overeng/buck2-tools does not exist.

All four reproduced on pristine main — pre-existing, not consumer-specific.

Goal

buck2-rules builds from main again, ships every file and label consumer projections reference, and the downstream standalone consumer builds both of its products end to end.

Decisions

  • Extend the hand-maintained inventory (+ unit-test expectation) rather than deriving it from projection loads — derivation belongs to the static-checks migration (Migrate residual static checks to Buck2 #1344).
  • Delete the two obsolete substituteInPlace calls instead of weakening to --replace: the sources now emit @capabilities refs directly.
  • Mirror package_view's parameter shape in the package_tree wrapper (declare, default empty, fold workspace_dist into workspace_files).
  • Generate a packages/@overeng/buck2-tools/BUCK in the packager mirroring the repository's own runtime targets, and alias the root runtime labels onto the package targets (root filegroups cannot source files from inside a nested package).

Verification

  • devenv tasks run genie:run regenerates inventory.json with exactly the added entries; genie:check fresh; lint:check:format passes; genie:buck2:test 87 pass / 0 fail (includes the updated inventory expectation).
  • nix build .#buck2-rules succeeds; the output ships buck2/static_checks.bzl, all five runner sources, and the nested package BUCK. Before this change the same build fails with the substitution error above.
  • End to end (the real consumer gate): pinned a private downstream consumer to this branch, refreshed its stale fixed-output hash, and built both of its standalone Buck products — nix build .#geist-design-system .#meters succeeds and emits both tarball artifacts. Each of the four fixes was individually forced by this loop (the failure advanced one gap per fix).

Pre-flip deviations

  • check:all not run locally: the shared builder is saturated by concurrent deploys and heavy builds. CI owns those lanes.

Complexity

No new abstractions — inventory entries, two dead lines removed, one wrapper parameterized to match its sibling, one mirrored package BUCK.

Concerns

Friction & bottlenecks

  • Bottleneck: shared nix builder saturation starved small builds (contract-test nix build --impure queued 28+ min).

References

Posted on behalf of @schickling
field value
agent_identity dev3.direct.omp.2qbt6gyt
session unknown
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.2.6
agent_runtime OMP 18.2.6
agent_model openai-codex/gpt-5.6-sol
worktree 2026-09-20-p2-standalone-root/2026-09-20-p2-standalone-root
tooling_profile dotfiles@f45f5d9

The TypeScript package projection (schema 12) loads
@rules//buck2:static_checks.bzl in every consumer BUCK file, but the
rules product inventory never shipped the file, so standalone consumer
roots (private-shared products) cannot resolve the load. The
//.buck2/capabilities substitutions in the packager are also dead since
the toolchains sources switched to @capabilities natively, and
--replace-fail now breaks the buck2-rules build outright.

agent-identity: dev3.direct.omp.2qbt6gyt
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.2.6
agent-runtime: OMP 18.2.6
agent-model: openai-codex/gpt-5.6-sol
tooling-profile: dotfiles@f45f5d9
@schickling-assistant
schickling-assistant marked this pull request as ready for review September 23, 2026 10:30
@github-actions
github-actions Bot requested a review from schickling September 23, 2026 10:31
The TypeScript package projection emits workspace_dist and
workspace_dependency_views maps on every package_tree call, but the
wrapper neither declared the parameters nor forwarded them, so every
consumer package_tree evaluation fails with 'Argument
workspace_dependency_views occurs more than once'. Mirror package_view:
declare both parameters with empty defaults and fold workspace_dist
into workspace_files.

agent-identity: dev3.direct.omp.2qbt6gyt
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.2.6
agent-runtime: OMP 18.2.6
agent-model: openai-codex/gpt-5.6-sol
tooling-profile: dotfiles@f45f5d9
The toolchains, javascript, package_tools, and static_checks rules
reference labels under packages/@overeng/buck2-tools (typescript-runner,
package_command_runtime, javascript_action_runtime, src/static-check-runner,
src/repository-policy-runner), but the consumer rules product neither
shipped those source files nor created the package, so every consumer
target evaluation fails with 'package does not exist'. Ship the three
missing runner sources and generate the package BUCK mirroring the
repository's own runtime targets.

agent-identity: dev3.direct.omp.2qbt6gyt
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.2.6
agent-runtime: OMP 18.2.6
agent-model: openai-codex/gpt-5.6-sol
tooling-profile: dotfiles@f45f5d9
With the nested package BUCK present, the root filegroups can no longer
source files from inside it ('Source file does not exist as a member of
package rules//'). Alias the root runtime labels onto the package
targets instead.

agent-identity: dev3.direct.omp.2qbt6gyt
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.2.6
agent-runtime: OMP 18.2.6
agent-model: openai-codex/gpt-5.6-sol
tooling-profile: dotfiles@f45f5d9
@schickling
schickling merged commit ddc5c5c into main Sep 23, 2026
27 checks passed
@schickling
schickling deleted the schickling-assistant/2026-09-23-rules-inventory-static-checks branch September 23, 2026 12:35
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.

2 participants