-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Restore Target Uniqueness Guard in dependency_tree_parser.bzl #1122
Merged
jin
merged 1 commit into
bazel-contrib:master
from
jonshea:dependency_tree_parser-seen_imports-fix
May 3, 2024
Merged
Restore Target Uniqueness Guard in dependency_tree_parser.bzl #1122
jin
merged 1 commit into
bazel-contrib:master
from
jonshea:dependency_tree_parser-seen_imports-fix
May 3, 2024
Conversation
This file contains 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
I noticed the refactor of `dependency_tree_parser.bzl` in bazel-contrib#994 might have unintentionally omitted a line that added target labels to the set of `seen_imports`. This line is present in [v5.3](https://github.com/bazelbuild/rules_jvm_external/blob/5.3/private/dependency_tree_parser.bzl#L155-L156), but then removed in [v6.1](https://github.com/bazelbuild/rules_jvm_external/blob/6.1/private/dependency_tree_parser.bzl#L457). I believe this removal was accidental, as it is now possible for `maven_install` to create a generated BUILD file which contains multiple copies of a target with the same name, which is an invalid state. This PR restores the missing call to `seen_imports[target_label] = True`.
danochoa
approved these changes
May 1, 2024
jin
approved these changes
May 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch!
mbland
added a commit
to EngFlow/bazel_invocation_analyzer
that referenced
this pull request
Jul 8, 2024
- https://github.com/bazelbuild/rules_jvm_external/releases/tag/6.2 This new version resolves the issue mentioned in #182: - bazel-contrib/rules_jvm_external#1189 Fixed by: - bazel-contrib/rules_jvm_external#1122 Per my comment on that issue, source JARs are no longer fetched without explicitly setting `fetch_sources = True`. This is why they no longer appear in `maven_install.json`. Finally, @shs96c noted to me in private that: > ...with recent `rules_jvm_external` releases, all you need to update > is `bazel run @maven//:pin`. There’s no need for the `unpinned_maven` > repo any more. I removed the `unpinned_maven` repo and ran `REPIN=1 bazel run @maven//:pin` to regenerate `maven_install.json`. This also removed the `unpinned_maven` entries from `MODULE.bazel.lock`. I'll update this section of my Bzlmod migration blog post after merging this change: - https://blog.engflow.com/2024/06/27/migrating-to-bazel-modules-aka-bzlmod---the-easy-parts/#with-rules_jvm_external
mbland
added a commit
to EngFlow/bazel_invocation_analyzer
that referenced
this pull request
Jul 8, 2024
- https://github.com/bazelbuild/rules_jvm_external/releases/tag/6.2 This new version resolves the issue mentioned in #182: - bazel-contrib/rules_jvm_external#1189 Fixed by: - bazel-contrib/rules_jvm_external#1122 Per my comment on that issue, source JARs are no longer fetched without explicitly setting `fetch_sources = True`. This is why they no longer appear in `maven_install.json`. Finally, @shs96c noted to me in private that: > ...with recent `rules_jvm_external` releases, all you need to update > is `bazel run @maven//:pin`. There’s no need for the `unpinned_maven` > repo any more. I removed the `unpinned_maven` repo and ran `REPIN=1 bazel run @maven//:pin` to regenerate `maven_install.json`. This also removed the `unpinned_maven` entries from `MODULE.bazel.lock`. I'll update this section of my Bzlmod migration blog post after merging this change: - https://blog.engflow.com/2024/06/27/migrating-to-bazel-modules-aka-bzlmod---the-easy-parts/#with-rules_jvm_external Signed-off-by: Mike Bland <mbland@engflow.com>
mbland
added a commit
to EngFlow/bazel_invocation_analyzer
that referenced
this pull request
Jul 10, 2024
Details: - https://github.com/bazelbuild/rules_jvm_external/releases/tag/6.2 This new version resolves the issue mentioned in #182: - bazel-contrib/rules_jvm_external#1189 Fixed by: - bazel-contrib/rules_jvm_external#1122 Per my comment on that issue, source JARs are no longer fetched without explicitly setting `fetch_sources = True`. This is why they no longer appear in `maven_install.json`. Finally, @shs96c noted to me in private that: > ...with recent `rules_jvm_external` releases, all you need to update is `bazel run @maven//:pin`. There’s no need for the `unpinned_maven` repo any more. I removed the `unpinned_maven` repo and ran `REPIN=1 bazel run @maven//:pin` to regenerate `maven_install.json`. This also removed the `unpinned_maven` entries from `MODULE.bazel.lock`. I'll update this section of my Bzlmod migration blog post after merging this change: - https://blog.engflow.com/2024/06/27/migrating-to-bazel-modules-aka-bzlmod---the-easy-parts/#with-rules_jvm_external Signed-off-by: Mike Bland <mbland@engflow.com>
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.
I noticed the refactor of
dependency_tree_parser.bzl
in #994 might have unintentionally omitted a line that added target labels to the set ofseen_imports
. This line is present in v5.3, but then removed in v6.1.I believe this removal was accidental, as it is now possible for
maven_install
to create a generated BUILD file which contains multiple copies of a target with the same name, which is an invalid state.This PR restores the missing call to
seen_imports[target_label] = True
.