Export: trimming enhancements#3530
Open
DuBento wants to merge 109 commits into
Open
Conversation
added 30 commits
April 29, 2026 19:28
setting subincludes at package level instead of at target level
- register subinclude statements in the package metadata - filter subincludes label - export all non build_target related statements
…dary build def with sources the updated test uses non-standard child naming to validate new trimming logic
e584818 to
6b9f0c4
Compare
added 11 commits
June 10, 2026 19:08
- comments - rename structs, files and interfaces - package parsing - notrim testing
…by build_defs + test cases
previous implementation was append only meaning that it would mark a subinclude as required if it was visited before even if not exported.
f6fbf1a to
7152109
Compare
added 16 commits
June 17, 2026 18:27
…a to also avoid tracking inside subincludes
…Parser is set. This wasn't an issue before since we would force close all the channels and fail during the first parse, but now we will attempt to wait for parsed package during an export.
…ents (including non-target generators). The reason for pivoting is that the previous implementation failed to identify necessary subincludes for variable declarations or other builtin methods (string join)
…ls to interpretStatements with the package level scope (e.g. for loop)
…y if blocks that have interpreted stmts (var redeclaration)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enhancements to plz export, moving from a basic target-level trimming (using gc.RewriteFile) to build statement-level trimming, including only the required build rules and subincludes.
For consistency, we format all the exported BUILD files.
Changelog:
src/export/export.goto enforce better separation of the DefaultExporter (for trimming) and NoTrimExporter.