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

fix: Not all runfiles are single files #860

Merged
merged 3 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/private/pkg_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def add_from_default_info(
_check_dest(mapping_context.content_map, d_path, rf, src.label, mapping_context.allow_duplicates_with_different_content)
mapping_context.content_map[d_path] = _DestFile(
src = rf,
entry_type = ENTRY_IS_FILE,
entry_type = ENTRY_IS_TREE if rf.is_directory else ENTRY_IS_FILE,
origin = src.label,
mode = fmode,
user = mapping_context.default_user,
Expand Down
38 changes: 38 additions & 0 deletions tests/tar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -710,3 +710,41 @@ verify_archive_test(
"new/base/something/this": "that",
},
)
fake_artifact(
name = "program_with_dir_runfiles",
files = ["//tests:testdata/executable.sh"],
runfiles = [
":generate_tree",
],
)

pkg_tar(
name = "program_with_dir_runfiles_tar",
srcs = [
":program_with_dir_runfiles",
],
include_runfiles = True,
)

verify_archive_test(
name = "program_with_dir_runfiles_test",
must_contain = [
"program_with_dir_runfiles.runfiles",
"program_with_dir_runfiles.runfiles/_main",
"program_with_dir_runfiles.runfiles/_main/tests",
"program_with_dir_runfiles.runfiles/_main/tests/tar",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/a",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/a/a",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/a/b",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/a/b/c",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/b",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/b/c",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/b/c/d",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/b/d",
"program_with_dir_runfiles.runfiles/_main/tests/tar/generate_tree/b/e",
"executable.sh",
"program_with_dir_runfiles",
],
target = ":program_with_dir_runfiles_tar",
)