-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move workspaceName out of Metadata, and isRepoRulePackage into Metadata
A previous CL attempted to make Package.Metadata hold only immutable data known prior to Starlark evaluation. However, the workspace name is only known ahead of time for BUILD files. For WORKSPACE files, it is initialized to a starter value and then possibly modified by the `workspace()` Starlark function. This CL solves the problem by replacing the field with two fields in Package and Package.Builder. The builder holds the initial, possibly mutated value, while the Package holds the final result known by the time `finishInit()` is called. In addition, the static helper method `isRepoRulePackage()`, which depends on the package identifier and workspace name, is replaced by adding a field to Metadata initiailized in the builder's constructor. This better reflects how the determination of whether we're a repo rule package happens up front, regardless of how the workspace name is mutated, and allows us to keep this information in the Metadata. Work toward #19922. PiperOrigin-RevId: 676388171 Change-Id: I9efc1996bb237c92415b0a378ed40c3e38125b61
- Loading branch information
1 parent
b3171ff
commit 61751b3
Showing
2 changed files
with
43 additions
and
35 deletions.
There are no files selected for viewing
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
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