-
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.
Make Package.Builder own its event handler
Previously there were three mechanisms for reporting events during package building: 1) a list of events/posts on the Package.Builder, which get accumulated until the package is constructed, at which they're replayed on the skyframe environment's eventHandler 2) a separate StoredEventHandler managed by PackageFactory, used for the odd message here and there, but ultimately merged into the Builder's events/posts 3) the StarlarkThread's print() handler, which points to the handler in (2) unknown commit moved the handler in (2) from PackageContext to a field of Package.Builder, but left the initialization and merging of this handler in PackageFactory#executeBuildFileImpl(). This CL closes the loop by making Package.Builder responsible for initializing this handler, and uses it to replace the separate events/posts list. Package.java: - events/posts fields on Builder go away, localEventHandler becomes non-nullable. addEvent[s]/addPosts/getEvents/getPosts accessors also go away, there were very few uses and they can all be replaced using getLocalEventHandler(). PackageFactory.java / WorkspaceFactory.java: - no need to create a StoredEventHandler and associate it with the Builder, or merge it into events/posts when done Event handling machinery: - add replayPostsOn(), for symmetry with replayEventsOn() This CL is *probably* a no-op, but there may be slight differences in error reporting at the margins, e.g. whether a certain type of error triggers Builder.setContainsErrors(). Work toward #19922. PiperOrigin-RevId: 595397832 Change-Id: I09d29dcc58870581a59a8275eff7533fa739be42
- Loading branch information
1 parent
ffc8c15
commit d8d9078
Showing
11 changed files
with
66 additions
and
125 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
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
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
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
Oops, something went wrong.