Skip to content

Test patched tar_writer against rules_pkg tests#1060

Draft
aiuto wants to merge 4 commits intobazelbuild:mainfrom
aiuto:dd_abld_457
Draft

Test patched tar_writer against rules_pkg tests#1060
aiuto wants to merge 4 commits intobazelbuild:mainfrom
aiuto:dd_abld_457

Conversation

@aiuto
Copy link
Copy Markdown
Collaborator

@aiuto aiuto commented Apr 27, 2026

Test a Go implementation of tar_writer against rules_pkg tests.

  • copy from datadog-agent repo
  • patch pkg_tar to use our new version
  • run the unit tests.
    • We had to fix the compression tester because the python and Go implementations of gz and xz vary.

Do not submit. This is only to prove that a patch would pass tests.

aiuto added 4 commits April 27, 2026 16:22
- copy from datadog-agent repo
- patch `pkg_tar` to use our new version
- run the unit tests.
  - We had to fix the compression tester because the python and Go implementations of gz and xz vary.
aiuto added a commit to DataDog/datadog-agent that referenced this pull request Apr 28, 2026
This change creates an enhanced version of tar_writer from rules_pkg.
- drop in replacement for the original, generated from the original source as an input
- with the added capability to produce an md5sums file
- written in Go for increased compression speed
- patch rules_pkg to use our writer instead of the default.

This is step 1 of several PRs to follow.  Some of these may merge if they are small enough.
- Create a pkg_deb wrapper which uses this
- Apply the wrapper to all the rules in //packages/...

**Testing**

Patch this back into upstream rules_pkg and see that tests pass
- https://github.com/aiuto/rules_pkg/tree/dd_abld_457
- bazelbuild/rules_pkg#1060

**Alternatives considered**

1. upstream this capability to rules_pkg
   - that requires too much work.  The maintainers (me) won't accept this limited fix.
     - it is a pkg_tar solution only. we would have to do pkg_zip.
     - it introduces go as a development language. That is a full on breaking change.
       We would have to first discuss and agree on a technique where the non-python
       version could be optional. The user would select it as a repo-rule.
     - an intermediate step would be to refactor pkg_tar so one could write their own,
       using the guts of pkg_tar_impl.
2. fork our own copy to a new repository
   - this is feasible. It is heavyweight right now, but we can consider it if other
     DataDog repos want to use this.
3. write it in Rust instead of Go?
   - distinctly possible, and we can do it at any time in the future
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.

1 participant