-
-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify source root stripping. (#10543)
Previously we had two parallel rule paths for stripped and unstripped source files. This added a lot of complication: various types could contain either stripped or unstripped sources, and there wasn't always an easy way to know which. This also required a lot of near-duplication of code, to handle each of the two paths. This change simplifies the types and rules, as follows: - Unstripped generic sources are represented by the SourceFiles type. - Stripped generic sources are represented by the StrippedSourceFiles type. - Unstripped Python sources are represented by the PythonSourceFiles type, which wraps a SourceFiles. - Stripped Python sources are represented by the StrippedPythonSourceFiles type, which wraps a StrippedSourceFiles. The only way to get a StrippedSourceFiles is to request via a SourceFiles subject. The only way to get a StrippedPythonSourceFiles is to request it via a PythonSourceFiles subject. The SourceFiles type carries just enough extra information to allow source-root stripping even in a merged snapshot, where the originating target information is lost. As a result, other rules operate primarily on unstripped sources, and strip them just as needed. For example, finding ancestor files operates only on unstripped sources, and no longer needs to implement logic to handle the stripped case. [ci skip-rust] [ci skip-build-wheels]
- Loading branch information
Showing
28 changed files
with
391 additions
and
728 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
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.