Skip to content
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

Modularize manifest python code #384

Merged
merged 3 commits into from
Jul 14, 2021
Merged

Conversation

nacl
Copy link
Collaborator

@nacl nacl commented Jul 14, 2021

The manifest code used in pkg_tar has uses outside of pkg_tar. Let's modularize
it to reduce the number of places it has to be duplicated (it needs to be
duplicated in pkg/private/pkg_files.bzl to be loaded) into starlark.

As a part of this, we create an entry type stringifier for ManifestEntry, and a
collections.namedtuple representing the fields in the entry.

pkg/private/build_tar.py was also opportunistically modified to use all of the
above.

The manifest code used in pkg_tar has uses outside of pkg_tar.  Let's modularize
it to reduce the number of places it has to be duplicated (it needs to be
duplicated in `pkg/private/pkg_files.bzl` to be loaded) into starlark.

As a part of this, we create an entry type stringifier for ManifestEntry, and a
`collections.namedtuple` representing the fields in the entry.

`pkg/private/build_tar.py` was also opportunistically modified to use all of the
above.
Interesting how this didn't show up in Linux or macOS...
Copy link
Collaborator

@aiuto aiuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!
I love the PRs that are trivial to review and make future PRs smaller.
LMK if you are going to merge or you want me to.

@nacl nacl merged commit f8d3d67 into bazelbuild:main Jul 14, 2021
aiuto added a commit to aiuto/rules_pkg that referenced this pull request Jul 15, 2021
aiuto added a commit to aiuto/rules_pkg that referenced this pull request Jul 15, 2021
aiuto added a commit that referenced this pull request Jul 15, 2021
* Initial support for pkg_files* in pkg_zip

- This is a mostly minimal PR to switch to the newer style. That is, only plain files and directories.
- Followup CLs will add links and tree artifacts.

* merge #384
@nacl nacl deleted the topic/manifest-lib branch November 19, 2021 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants