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

Stringification of an apparent label that fails repo mapping produces an incorrect canonical form #17258

Closed
brentleyjones opened this issue Jan 19, 2023 · 4 comments
Assignees
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

Comments

@brentleyjones
Copy link
Contributor

Description of the bug:

In a macro I produce an apparent label that fails repo mapping. When I stringify it, it produces an invalid canonical form instead of erroring. Calling .workspace_name on the label correctly errors:

Error: 'workspace_name' is not allowed on invalid Label @[unknown repo 'SwiftLint' requested from @rules_xcodeproj~override]//:swiftlint

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

print(str(Label("@SwiftLint//:swiftlint")))

It prints @@SwiftLint//:swiftlint, but should error, since @@SwiftLint//:swiftlint isn't a valid label.

Which operating system are you running Bazel on?

macOS

What is the output of bazel info release?

release 6.0.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

@fmeum asked me to file this 😄.

@brentleyjones
Copy link
Contributor Author

Minimally it could output the apparent name again.

@Wyverald
Copy link
Member

I actually noticed this myself yesterday and have a change in flight to fix it :)

@Wyverald Wyverald added type: bug P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. area-Bzlmod Bzlmod-specific PRs, issues, and feature requests labels Jan 19, 2023
@Wyverald Wyverald self-assigned this Jan 19, 2023
@brentleyjones
Copy link
Contributor Author

@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 Jan 20, 2023
@Wyverald
Copy link
Member

@bazel-io fork 6.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 Jan 23, 2023
ShreeM01 added a commit that referenced this issue Feb 8, 2023
…repo names (#17326)

This also affects Starlark `str(some_label)`.

Fixes #17258

PiperOrigin-RevId: 503413176
Change-Id: I864c3c892233ede19b2478c3d9e1c806e4b43c11

Co-authored-by: Googler <wyv@google.com>
hvadehra pushed a commit that referenced this issue Feb 14, 2023
…repo names

This also affects Starlark `str(some_label)`.

Fixes #17258

PiperOrigin-RevId: 503413176
Change-Id: I864c3c892233ede19b2478c3d9e1c806e4b43c11
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
Projects
None yet
Development

No branches or pull requests

3 participants