Uh oh!
There was an error while loading. Please reload this page.
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.
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 doc. Yeah, this is kind of confusing. We pass the canonical name, but it later gets "reparsed" into a slightly different string by the generated requirements.bzl, so it'll get re-evaluated in (potentially) another context.
Since we're dealing with canonical names, that re-evaluation shouldn't matter much.
Well, sort of. IIUC, resolution happens when Label() is called. This occurs when Label() is called manually or when a string is passed to a label attribute (i.e. rule invocation). When it occurs, it'll use the context of the current repo to resolve it. e.g. when repo A calls a macro in repo B, and passes a string label, then the string gets resolved with repo B's mappings. If repo A calls Label() before passing to repo B, then it'll use A's mappings.