Bump bundled buildozer 7.1.2 → 8.5.1 for bazel mod tidy / buildifier parity - #14
Closed
alexeagle wants to merge 1 commit into
Closed
Bump bundled buildozer 7.1.2 → 8.5.1 for bazel mod tidy / buildifier parity#14alexeagle wants to merge 1 commit into
bazel mod tidy / buildifier parity#14alexeagle wants to merge 1 commit into
Conversation
… 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>
Author
|
Superseded by figma/figma#842013. That PR fixes the same buildifier vs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bazel mod tidyrewrites/reformatsMODULE.bazelusing the buildozer binarypinned in
src/MODULE.tools(@buildozer_binary, viaBazelModTidyFunction).This fork pins buildozer 7.1.2, which predates buildtools
PR #1345 "Keep
includecalls together inMODULE.bazelfiles"(first shipped in buildozer v8.2.0). As a result,
mod tidyinserts a blankline between every consecutive
include()call.Standalone buildifier 8.5.1 (what consumers pin via
buildifier_prebuilt, andwhat pre-commit hooks run) does have bazelbuild#1345 and keeps
include()calls compact.So
MODULE.bazelflip-flops depending on which tool touched it last — a formatterversion 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 neverbackported to the 8.x LTS line — so 8.6/8.7 remained on 7.1.2.
Changes
src/MODULE.tools:buildozer7.1.2→8.5.1buildozer 8.5.1 adds a dependency on
rules_shell 0.3.0; this fork currentlyresolves
rules_shell 0.2.0, so this is a real module-resolution change, not ahash swap — the lockfiles must be regenerated by Bazel (per the note at the top of
src/MODULE.tools):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.lockregeneration as a build step.
Test plan
MODULE.bazel.lockandsrc/test/tools/bzlmod/MODULE.bazel.lock8.7.0-figmaNrelease and verifybazel mod tidyleaves consecutiveinclude()calls compact (no blank lines), matchingbuildifier 8.5.1🤖 Generated with Claude Code