refactor: introduce helper for defining distribution filegroups - #4152
Open
rickeylev wants to merge 3 commits into
Open
refactor: introduce helper for defining distribution filegroups#4152rickeylev wants to merge 3 commits into
rickeylev wants to merge 3 commits into
Conversation
Previously, distribution filegroups required manually enumerating each direct subpackage's distribution target in `srcs`. This created repetitive boilerplate across BUILD files and risked omitting newly added subpackages from release distributions. Introduce the `distribution_filegroup` macro to automatically glob package files and discover direct subpackages using `native.subpackages()`, with support for an `exclude` list. * Also updates BUILD files across the repository to use the new macro
The root distribution archive omitted tools/build_defs/python/private because native.subpackages(include = ["*"]) in tools/BUILD.bazel only discovers direct subpackages. Without an intermediate package boundary, the nested tools/build_defs/python package was skipped. Add distribution_filegroup targets to tools/build_defs/BUILD.bazel and tools/build_defs/python/BUILD.bazel so the distribution filegroup chain recursively reaches tools/build_defs/python/private.
Downstream packaging fails because //tools/publish loads //tools/private:publish_deps.bzl. Remove the exclude list so that tools/private is included in distribution archives.
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.
Previously, distribution filegroups required manually enumerating each
direct subpackage's distribution target in
srcs. This createdrepetitive boilerplate across BUILD files and risked omitting newly
added subpackages from release distributions.
Introduce the
distribution_filegroupmacro to automatically globpackage files and discover direct subpackages using
native.subpackages(), with support for anexcludelist.