* Reproduction for mtree_spec behaving different in other repo * Fix the bug (but not the test) * Fix the test * Rename mtree_spec e2e dir to tar * Fix bzlmod tests * Remove unnecessary skylib dependency from e2e repos * Add e2e tests to matrix * Replace e2e test with a normal test To do this, we somewhat abuse the skylib dependency, but that's probalby OK.
This commit is contained in:
parent
30a5725ef4
commit
2ce45746dd
|
@ -1,5 +1,7 @@
|
|||
"Implementation of tar rule"
|
||||
|
||||
load("//lib:paths.bzl", "to_repository_relative_path")
|
||||
|
||||
TAR_TOOLCHAIN_TYPE = "@aspect_bazel_lib//lib:tar_toolchain_type"
|
||||
|
||||
# https://www.gnu.org/software/tar/manual/html_section/Compression.html
|
||||
|
@ -182,7 +184,7 @@ def _to_rlocation_path(file, workspace):
|
|||
else:
|
||||
return workspace + "/" + file.short_path
|
||||
|
||||
def _expand(file, expander, transform = lambda f: f.short_path):
|
||||
def _expand(file, expander, transform = to_repository_relative_path):
|
||||
expanded = expander.expand(file)
|
||||
lines = []
|
||||
for e in expanded:
|
||||
|
|
|
@ -279,3 +279,21 @@ assert_tar_listing(
|
|||
"-rwxr-xr-x 0 1000 500 21 Jan 1 2023 lib/tests/tar/src_file",
|
||||
],
|
||||
)
|
||||
|
||||
# Case 9: Files from a different repository (#697)
|
||||
# Note: This test uses an exported file from skylib, so we do not need to create
|
||||
# an additional workspace just for this test.
|
||||
|
||||
tar(
|
||||
name = "tar_different_repo",
|
||||
srcs = ["@bazel_skylib//:LICENSE"],
|
||||
out = "9.tar",
|
||||
)
|
||||
|
||||
assert_archive_contains(
|
||||
name = "test_different_repo",
|
||||
archive = "9.tar",
|
||||
expected = [
|
||||
"LICENSE",
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue