aspect-build / bazel-lib

Common useful functions for writing BUILD files and Starlark macros/rules
https://docs.aspect.build/rules/aspect_bazel_lib
Apache License 2.0
128 stars 75 forks source link

feat(tar): add ergonomic way to strip_prefix #829

Closed alexeagle closed 1 month ago

alexeagle commented 1 month ago

The genrule we used was too complex to ask users to copy-paste it

This is a partial step to exposing a rules_pkg pkg_tar compatible API.


Changes are visible to end-users: yes

The tar package now provides a new mtree_mutate macro which allows a more ergonomic equivalent of pkg_tar attributes like strip_prefix, uid, and more.

Test plan

aspect-workflows[bot] commented 1 month ago

Test

4 test targets passed

Targets
//docs:update_11_test [k8-opt]                         120ms
//lib/tests/copy_to_directory_bin_action:test [k8-opt] 29ms
//lib/tests/jq:check_stamped [k8-opt]                  28ms
//lib/tests/yq:check_stamped [k8-opt]                  32ms

Total test execution time was 209ms. 225 tests (98.3%) were fully cached saving 38s.


Test

e2e/copy_to_directory

All tests were cache hits

6 tests (100.0%) were fully cached saving 660ms.


Test

e2e/coreutils

All tests were cache hits

4 tests (100.0%) were fully cached saving 578ms.


Test

e2e/external_copy_to_directory

All tests were cache hits

1 test (100.0%) was fully cached saving 52ms.


Test

e2e/smoke

All tests were cache hits

6 tests (100.0%) were fully cached saving 1s.


Buildifier      Format      Gazelle