Skip to content

Provide a tiny tar utility for use in tests #11183

Closed as not planned
Closed as not planned

Description

@aiuto

Proposal: Create a rule(s) that can create a zip/tar archives from a set of sources. This would not be available at Bazel runtime as part of @tools (even though the source might go in //tools for lack of a better place). The capabilities would be to bundle up a list of sources and rename some files along the way. It would be stripped down version of the rules from pkg_tar.

Need:

  1. Some workspace tests often require building a tar archive as part of the test. These currently depend on pkg_tar from @tools/build_defs/pkg, which is going away (move rules_pkg out of Bazel #8857 ). https://github.com/bazelbuild/bazel/search?q=bazel_tools/tools/build_defs/pkg&unscoped_q=pkg_tar
    Rewriting them to depend on the rules_pkg distribution is possible, but introduces an external dependency buried in code. The package checksum ends up appearing in Java test code that is writing a WORKSPACE file. This is extremely ugly.
  2. Building the Bazel distribution makes frequent use of pkg_tar to bundle up some things. We currently depend on bazelbuild/rules_pkg for this. It looks like we could use the mini tool to eliminate an upstream dependency.

As an alternative, we could minimize chance of drift between rules_pkg in the build and tests by reusing the imported repo.

  • re-export the rules_pkg.tar.gz that we import into the Bazel WORKSPACE. (maybe an http_file duplicating the http_archive)
  • tests which need to import @rules_pkg into the WORKSPACE files they write will add a dep on this tarball.

Activity

  1. added
    area-EngProd
    on Apr 22, 2020
  2. added
    team-OSS
    on Jun 15, 2020
  3. added
    untriaged
    on Oct 28, 2020
  4. added
    P3
    and removed
    untriaged
    on Dec 8, 2020
  5. changed the title [-]Provide a tiny zip/tar utility for use in tests and packaging.[/-] [+]Provide a tiny zip/tar utility for use in tests[/+] on Apr 14, 2021
  6. aiuto commented on Jun 3, 2021

    @aiuto
    Author

    My thinking as of late is to remove all the extra features from the internal pkg_tar and let it become the mini-tar.
    Users of the esoteric ones will have to do the easy migration to rules_pkg

  7. self-assigned this
    on Mar 2, 2022
  8. aiuto commented on Mar 2, 2022

    @aiuto
    Author

    I picked this up again for now. Rough plan:

    • PR 1: create mini_tar using the remains of pkg_tar. Same build_tar, but few attributes.
    • migrate google off of bazel's pkg_tar to rules_pkg.pkg_tar
    • PR 2: drop more attributes from pkg_tar
    • PR 3: delete pkg.bzl
    • PR 4: consolidate archive.py into build_tar.py
    • PR 5: get rid of the shell tests.

    It is very back burner, so it may take a few months.

  9. changed the title [-]Provide a tiny zip/tar utility for use in tests[/-] [+]Provide a tiny tar utility for use in tests[/+] on Mar 6, 2022
  10. github-actions commented on Nov 25, 2023

    @github-actions

    Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

  11. added
    stale
    on Nov 25, 2023
  12. removed
    stale
    on Jan 18, 2024
  13. github-actions commented on Mar 23, 2025

    @github-actions

    Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

  14. added
    stale
    on Mar 23, 2025
  15. github-actions commented on Jun 21, 2025

    @github-actions

    This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post @bazelbuild/triage in a comment here and we'll take a look. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area-EngProdstaleteam-OSStype: feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions