Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.2.0] Make bazel mod tidy work with include() #22527

Closed
wants to merge 1 commit into from

Conversation

bazel-io
Copy link
Member

We now generate fixup commands targeting include()d segments in addition to the root MODULE.bazel file itself. Fixup commands are grouped by file, and then passed to Buildozer using -f - (i.e. multiple commands for multiple files, passed in using stdin).

  • For repos to add, we find the first usage with the correct prod/dev type and add them there.
  • For repos to remove, we remove them from whichever usage had them.
  • At the end, all module files and included segments are formatted.

Fixes #22063

Closes #22455.

PiperOrigin-RevId: 636680730
Change-Id: Id894a449d8d1cdf39271ea3a724a91aebc51befb

Commit c902fbd

We now generate fixup commands targeting `include()`d segments in addition to the root MODULE.bazel file itself. Fixup commands are grouped by file, and then passed to Buildozer using `-f -` (i.e. multiple commands for multiple files, passed in using stdin).

- For repos to add, we find the first usage with the correct prod/dev type and add them there.
- For repos to remove, we remove them from whichever usage had them.
- At the end, all module files and included segments are formatted.

Fixes bazelbuild#22063

Closes bazelbuild#22455.

PiperOrigin-RevId: 636680730
Change-Id: Id894a449d8d1cdf39271ea3a724a91aebc51befb
@bazel-io bazel-io requested a review from a team as a code owner May 23, 2024 22:27
@bazel-io bazel-io added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. area-Bzlmod Bzlmod-specific PRs, issues, and feature requests awaiting-review PR is awaiting review from an assigned reviewer labels May 23, 2024
@Wyverald Wyverald enabled auto-merge May 23, 2024 22:28
@Wyverald
Copy link
Member

huh, I might need some help here. @fmeum @meteorcloudy For some reason, the test //src/test/py/bazel:mod_command_test hangs indefinitely on Windows -- very consistently, too.

The test methods testModTidy* are where things go wrong; it looks like the call to bazel mod tidy just hangs forever. But the weird thing is that this PR is a clean cherry-pick; the same code works just fine on Windows at HEAD (see #22455; also verified with a Windows VM).

I can't quite see the output of the inner Bazels easily; --sandbox_debug also doesn't seem to do anything (understandable as AFAIK there's no sandbox on Windows anyway). Any advice?

@fmeum
Copy link
Collaborator

fmeum commented May 24, 2024

Wild guess: We may be hitting a bug that was fixed by b3f5c62 at HEAD just three days ago. I'll verify this.

@Wyverald Wyverald disabled auto-merge May 24, 2024 21:58
@keertk keertk closed this May 25, 2024
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Bzlmod Bzlmod-specific PRs, issues, and feature requests team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants