bazelbuild / bazelbuild/rules_pkg

pkg_files -> pkg_tar -> pkg_tar loses owner/group

Open
#646 2 comments 0 reactions 0 assignees View on GitHub
p4 wontfix
Dominant language
Starlark
Stars
253
Forks
221
Avg merge
10h 33m
Merged PRs (30d)
1

Description

I'm in the process of migrating a ton of `pkg_tar` rules to `pkg_files`. I'm trying to do it incrementally to stay sane. I would expect the following two to be equivalent.

```
pkg_files(
name = "shell_history",
srcs = [
".zsh_history",
],
attributes = pkg_attributes(
group = "1000",
mode = "0600",
user = "1000",
),
prefix = "/home/debian",
visibility = ["//brt/vpu:__subpackages__"],
)
pkg_tar(
name = "bin_files",
srcs = [":shell_history"]
deps = [":more_pkg_tar_targets"],
symlinks = symlinks,
)
```
and
```
pkg_tar(
name = "shell_history",
srcs = [
".zsh_history",
],
mode = "0600",
owner = "1000.1000",
package_dir = "/home/debian",
visibility = ["//brt/vpu:__subpackages__"],
)
pkg_tar(
name = "bin_files",
deps = [":more_pkg_tar_targets", ":shell_history"],
symlinks = symlinks,
)
```

And finally for both:
```
pkg_tar(
name = "installed_binaries",
symlinks = {
"/etc/systemd/system/multi-user.target.wants/startup.service": "../startup.service",
},
tags = [
"no-remote",
],
deps = [
":bin_files",
],
)
```

When I inspect `bin_files.tar`, I see that `.zsh_history` is owned by `1000.1000`. Inside `installed_binaries`, I see it owned by `0.0`. With the `pkg_tar` rules for all steps, I see ownership properly tracked.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.