Skip to content

Bump bundled buildozer 7.1.2 → 8.5.1 for bazel mod tidy / buildifier parity - #14

Closed
alexeagle wants to merge 1 commit into
8.7.0-figmafrom
aeagle/bump-mod-tidy-buildozer-8-5-1
Closed

Bump bundled buildozer 7.1.2 → 8.5.1 for bazel mod tidy / buildifier parity#14
alexeagle wants to merge 1 commit into
8.7.0-figmafrom
aeagle/bump-mod-tidy-buildozer-8-5-1

Conversation

@alexeagle

Copy link
Copy Markdown

Summary

bazel mod tidy rewrites/reformats MODULE.bazel using the buildozer binary
pinned in src/MODULE.tools (@buildozer_binary, via BazelModTidyFunction).
This fork pins buildozer 7.1.2, which predates buildtools
PR #1345 "Keep include calls together in MODULE.bazel files"
(first shipped in buildozer v8.2.0). As a result, mod tidy inserts a blank
line between every consecutive include() call.

Standalone buildifier 8.5.1 (what consumers pin via buildifier_prebuilt, and
what pre-commit hooks run) does have bazelbuild#1345 and keeps include() calls compact.
So MODULE.bazel flip-flops depending on which tool touched it last — a formatter
version skew, not a logic bug in either tool.

This bumps the bundled buildozer to 8.5.1, matching buildifier and eliminating
the disagreement. It ports the intent of upstream
bazelbuild/bazel #28650
("Update buildozer to v8.5.1"), which landed on master (→ 9.x) but was never
backported to the 8.x LTS line — so 8.6/8.7 remained on 7.1.2.

Changes

  • src/MODULE.tools: buildozer 7.1.28.5.1

⚠️ Required follow-up — lockfile regeneration (CI will be red until done)

buildozer 8.5.1 adds a dependency on rules_shell 0.3.0; this fork currently
resolves rules_shell 0.2.0, so this is a real module-resolution change, not a
hash swap — the lockfiles must be regenerated by Bazel (per the note at the top of
src/MODULE.tools):

bazel run //src/test/tools/bzlmod:update_default_lock_file
bazel mod deps --lockfile_mode=update

I could not run these from my environment (needs the fork's Bazel in a full
checkout). This matches how figma/figma#837553 handled MODULE.bazel.lock
regeneration as a build step.

Test plan

  • Regenerate MODULE.bazel.lock and src/test/tools/bzlmod/MODULE.bazel.lock
  • Fork CI green
  • Cut a 8.7.0-figmaN release and verify bazel mod tidy leaves consecutive
    include() calls compact (no blank lines), matching buildifier 8.5.1

🤖 Generated with Claude Code

… parity

`bazel mod tidy` formats MODULE.bazel via the buildozer pinned in this file
(@buildozer_binary, see BazelModTidyFunction). At 7.1.2 it predates buildtools
PR bazelbuild#1345 ("Keep include calls together in MODULE.bazel files", first shipped in
buildozer v8.2.0), so it inserts a blank line between consecutive include()
calls -- disagreeing with standalone buildifier 8.5.1, which keeps them compact.
This makes MODULE.bazel flip-flop depending on which tool touched it last.

Bumping the bundled buildozer to 8.5.1 aligns mod tidy with buildifier. Ports
the intent of upstream bazelbuild/bazel bazelbuild#28650 (which bumped 8.2.1 -> 8.5.1 on
master; the 8.x LTS line, and thus 8.7.0, was never moved past 7.1.2).

NOTE: lockfiles still need regeneration (see PR description) --
buildozer 8.5.1 pulls rules_shell 0.3.0 (fork currently resolves 0.2.0), so
this is a real resolution change, not a hash swap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexeagle

Copy link
Copy Markdown
Author

Superseded by figma/figma#842013. That PR fixes the same buildifier vs bazel mod tidy disagreement entirely in-repo by declaring buildozer 8.5.1 as a root bazel_dep (MVS raises the version @bazel_tools' @buildozer_binary resolves), so no Bazel fork change or 8.7.0-figmaN release is needed. Verified: bazel mod tidy keeps consecutive include() calls compact. Closing.

@alexeagle alexeagle closed this Jul 6, 2026
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.

1 participant