Repository navigation
Fix: ensure full package and subincludes are parsed for export #3621
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
Merged
toastwaffle
merged 10 commits into
thought-machine:master
from
DuBento:notrim-missing-target
Sep 30, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0ca23eb
purge ForceParseEntirePackage dead code
665c6e6
regression test for parsing the entire package
33261e8
ensure parse of entire package and subincludes
9593cfe
fix export monitor last print
e2ef887
yield on AllBuildInputs
aed960c
Parse entire package if ParseMetadata is set
eb346ef
redundant target string in error
f44560e
remove int form iterator
a1cf900
clarifying comments
3b2914a
fix AllBuildInputs single variable
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| subinclude("//test/export:export_e2e_test_build_def") | ||
|
|
||
| # Test --notrim exports adjacent targets and dependencies from packages that would not have been | ||
| # included in the original parse. This is a regression test to make sure we enforce entire package | ||
| # parsing when using the export command. | ||
| please_export_e2e_test( | ||
| name = "export_notrim_parse_entire_package", | ||
| enforce_different_repos = False, | ||
| export_targets = ["//:target1"], | ||
| flags = "--notrim", | ||
| ) |
3 changes: 3 additions & 0 deletions
3
test/export/test_notrim_parse_entire_package/expected_repo/.plzconfig
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [Parse] | ||
|
|
||
| BuildFileName = BUILD_FILE |
9 changes: 9 additions & 0 deletions
9
test/export/test_notrim_parse_entire_package/expected_repo/BUILD_FILE
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| genrule( | ||
| name = "target1", | ||
| srcs = [ | ||
| "file1.txt", | ||
| "//intermediate:lib", | ||
| ], | ||
| outs = ["out1.txt"], | ||
| cmd = "cat $SRCS > $OUT", | ||
| ) |
1 change: 1 addition & 0 deletions
1
test/export/test_notrim_parse_entire_package/expected_repo/file1.txt
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| file1 |
17 changes: 17 additions & 0 deletions
17
test/export/test_notrim_parse_entire_package/expected_repo/intermediate/BUILD_FILE
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| genrule( | ||
| name = "lib", | ||
| srcs = ["lib.txt"], | ||
| outs = ["out_lib.txt"], | ||
| cmd = "cat $SRCS > $OUT", | ||
| visibility = ["PUBLIC"], | ||
| ) | ||
|
|
||
| genrule( | ||
| name = "adjacent", | ||
| srcs = [ | ||
| "adjacent.txt", | ||
| "//other_package:other_target", | ||
| ], | ||
| outs = ["out_adjacent.txt"], | ||
| cmd = "cat $SRCS > $OUT", | ||
| ) |
1 change: 1 addition & 0 deletions
1
test/export/test_notrim_parse_entire_package/expected_repo/intermediate/adjacent.txt
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| adjacent content |
1 change: 1 addition & 0 deletions
1
test/export/test_notrim_parse_entire_package/expected_repo/intermediate/lib.txt
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lib content |
Oops, something went wrong.
Oops, something went wrong.
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.
What exactly are we trying to solve here? At this point the package is parsed, and all its subincludes must be parsed for
AllSubincludesto work? (or fundamentally for it to have finished parsing)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.
The intention is to parse any adjacent targets. In a --notrim implementation, we expect the entire package to be exported. For example,
subinclude(//lib:a)we'll want to parse the entire //lib:all for any other targets, such as //lib:b.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.
Ah I gotcha, thanks