-
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
Show "did you mean" suggestion for unknown repo names #23184
Conversation
If `@boo` is parsed in a context in which only `@foo` is visible, the resulting `RepositoryName` object will show as follows in error messages: ``` @@[unknown repo 'boo' requested from @@ (did you mean 'foo'?)] ```
/** | ||
* If ownerRepoIfNotVisible is not null, this field stores the suffix to be appended to the error | ||
*/ | ||
@Nullable private final String didYouMeanSuffix; |
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.
I could refactor this class into a sealed base class with a single field and a subclass with all three fields. The memory savings wouldn't be that significant (8 bytes per instance, of which there are most likely less than 100,000 even for very large repos).
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! I'll let @Wyverald answer the memory concern, I guess it should be fine.
@bazel-io fork 7.4.0 |
The concern actually isn't new, the new field I added only consumes space previously used for padding. But if we could reduce the field count by two, we could save 8 bytes per instance. |
@Wyverald Friendly ping |
Sorry for the delay -- I agree that the memory concern isn't pressing. |
@bazel-io fork 7.4.0 |
If `@boo` is parsed in a context in which only `@foo` is visible, the resulting `RepositoryName` object will show as follows in error messages: ``` @@[unknown repo 'boo' requested from @@ (did you mean 'foo'?)] ``` Closes bazelbuild#23184. PiperOrigin-RevId: 660678414 Change-Id: Iecb5b1d211ff9e1f04ff0f2189376a98b7b261a9
If `@boo` is parsed in a context in which only `@foo` is visible, the resulting `RepositoryName` object will show as follows in error messages: ``` @@[unknown repo 'boo' requested from @@ (did you mean 'foo'?)] ``` Closes #23184. PiperOrigin-RevId: 660678414 Change-Id: Iecb5b1d211ff9e1f04ff0f2189376a98b7b261a9 Closes #23189 Closes #23239
The changes in this PR have been included in Bazel 7.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. |
If
@boo
is parsed in a context in which only@foo
is visible, the resultingRepositoryName
object will show as follows in error messages: