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

Cover missing cases during module extension label normalization #20482

Closed
wants to merge 1 commit into from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Dec 9, 2023

The previous logic missed to normalize cases such as "extension.bzl" and "//extension.bzl", thus resulting in crashes if these styles are mixed as well as invalid buildozer commands for use_repo fixing.

Instead of enumerating cases, parse the label and emit it in unambiguous canonical form with a leading @ stripped.

@fmeum fmeum marked this pull request as ready for review December 9, 2023 09:20
@github-actions github-actions bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Dec 9, 2023
@@ -486,11 +490,23 @@ private String normalizeLabelString(String rawExtensionBzlFile) {
// same Label, this would result in a crash.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update this comment!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated @iancha1992

@Wyverald Wyverald added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Dec 19, 2023
@Wyverald
Copy link
Member

(please merge once the comment above is addressed)

The previous logic missed to normalize cases such as `"extension.bzl"`
and `"//extension.bzl"`, thus resulting in crashes if these styles are
mixed as well as invalid buildozer commands for `use_repo` fixing.

Instead of enumerating cases, parse the label and emit it in unambiguous
canonical form with a leading `@` stripped.
@fmeum fmeum force-pushed the fix-normalization branch from 3901c66 to fa98b07 Compare December 20, 2023 06:54
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Dec 20, 2023
@fmeum fmeum deleted the fix-normalization branch December 20, 2023 23:07
@fmeum
Copy link
Collaborator Author

fmeum commented Dec 20, 2023

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Dec 20, 2023
@iancha1992
Copy link
Member

@bazel-io fork 7.1.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Dec 20, 2023
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Dec 20, 2023
The previous logic missed to normalize cases such as `"extension.bzl"` and `"//extension.bzl"`, thus resulting in crashes if these styles are mixed as well as invalid buildozer commands for `use_repo` fixing.

Instead of enumerating cases, parse the label and emit it in unambiguous canonical form with a leading `@` stripped.

Closes bazelbuild#20482.

PiperOrigin-RevId: 592666970
Change-Id: Ieea34b27a187545a11107a334bbae14fef974ae8
github-merge-queue bot pushed a commit that referenced this pull request Jan 9, 2024
…on (#20630)

The previous logic missed to normalize cases such as `"extension.bzl"`
and `"//extension.bzl"`, thus resulting in crashes if these styles are
mixed as well as invalid buildozer commands for `use_repo` fixing.

Instead of enumerating cases, parse the label and emit it in unambiguous
canonical form with a leading `@` stripped.

Closes #20482.

Commit
71787cf

PiperOrigin-RevId: 592666970
Change-Id: Ieea34b27a187545a11107a334bbae14fef974ae8

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
Co-authored-by: Ian (Hee) Cha <heec@google.com>
Co-authored-by: Xùdōng Yáng <wyverald@gmail.com>
@iancha1992
Copy link
Member

The changes in this PR have been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants