-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Make bazel mod tidy
work with include()
#22063
Labels
area-Bzlmod
Bzlmod-specific PRs, issues, and feature requests
P2
We'll consider working on this in future. (Assignee optional)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
Milestone
Comments
Since every repo can only be
That is, we just need to know which extension proxy comes from which segment and results in which imports. |
Sounds good to me! |
Wyverald
added a commit
that referenced
this issue
May 9, 2024
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards #22063
Wyverald
added a commit
that referenced
this issue
May 9, 2024
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards #22063
Wyverald
added a commit
that referenced
this issue
May 9, 2024
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards #22063
copybara-service bot
pushed a commit
that referenced
this issue
May 10, 2024
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards #22063 Closes #22307. PiperOrigin-RevId: 632377764 Change-Id: I282a68bc7962088ae4583418f73b2e60a0ec88f0
Kila2
pushed a commit
to Kila2/bazel
that referenced
this issue
May 13, 2024
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards bazelbuild#22063 Closes bazelbuild#22307. PiperOrigin-RevId: 632377764 Change-Id: I282a68bc7962088ae4583418f73b2e60a0ec88f0
Wyverald
added a commit
that referenced
this issue
May 13, 2024
The current ModuleExtensionUsage class was designed in the days before we allowed multiple `use_extension` calls for the same extension in the same module. This PR brings the class up to speed to better reflect the actual API. This will also lay the groundwork for `bazel mod tidy` working with `include()`d segments. Work towards #22063 Closes #22307. PiperOrigin-RevId: 632377764 Change-Id: I282a68bc7962088ae4583418f73b2e60a0ec88f0
Wyverald
added a commit
that referenced
this issue
May 20, 2024
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
Wyverald
added a commit
that referenced
this issue
May 23, 2024
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
@bazel-io fork 7.2.0 |
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this issue
May 23, 2024
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
Wyverald
added a commit
that referenced
this issue
May 24, 2024
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
github-merge-queue bot
pushed a commit
that referenced
this issue
May 24, 2024
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
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
P2
We'll consider working on this in future. (Assignee optional)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: bug
After #21855 is in, we'll need to address the case where
include()
d files need tidying. This would require Bazel itself to generate proper fixup events for included files (potentially only for extension proxies that are bound to a variable, IOW 'exported'), and for Buildozer to properly handle files that are MODULE.bazel-like but not exactly named "MODULE.bazel" (per discussion in the PR, they would be calledfoo.MODULE.bazel
).The text was updated successfully, but these errors were encountered: