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

docs: Avoid use of rules_pkg #765

Open
jfirebaugh opened this issue Jan 22, 2025 · 2 comments
Open

docs: Avoid use of rules_pkg #765

jfirebaugh opened this issue Jan 22, 2025 · 2 comments
Labels
cleanup Address tech debt

Comments

@jfirebaugh
Copy link

jfirebaugh commented Jan 22, 2025

I'd like to propose that rules_oci avoid explicit or implicit endorsement of rules from rules_pkg, particularly pkg_tar. Where documentation and examples currently refer to pkg_tar, use the tar rule from bazel-lib instead.

Rationale: in addition to the advantages of tar listed in the bazel-lib documentation, rules_pkg is poorly maintained and has surprising behaviors such as flattening directory trees and omitting runfiles by default, which seem unlikely to ever be fixed.

@thesayyn
Copy link
Collaborator

This sounds fine, irony is that i was the one started bazel-lib tar :) but somehow left rules_pkg usage here intact. I'd be happy to review a PR, if this is something you feel like doing.

@thesayyn thesayyn added the cleanup Address tech debt label Jan 22, 2025
@sfc-gh-mhazy
Copy link
Contributor

This probably should be a separate issue, but wanted to leave a comment about a problem I experienced with aspect's tar.

  • tar is a macro that declares two rules: mtree_spec and tar_rule
  • mtree_spec produces a map of filepaths that is later consumed by tar_rule.
  • Since these are 2 separate rules, there is no guarantee on where these are executed, unlike if these were 2 actions of a single rule.
  • I think this caused us a cache poisoning when executing remotely. mtree_spec results assumed some file paths, which were different when executing tar_rule.
  • in rules_pkg the mapping context is created as part of pkg_tar rule implementation, which avoids problems mentioned above.

Sorry for distraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Address tech debt
Projects
None yet
Development

No branches or pull requests

3 participants