Skip to content

remap_paths in pkg_tar is not applied to deps #955

Open
@mering

Description

@mering

Reproduction example:

# BUILD.bazel

load("@rules_pkg//:pkg.bzl", "pkg_tar")

pkg_tar(
    name = "pkg",
    srcs = ["//foo:file.txt"],  # results in bar/file.txt
    remap_paths = {
        "foo": "bar",
    },
    strip_prefix = "/",
    deps = ["//foo"],  # results in foo/file.txt
)


# foo/BUILD.bazel

load("@rules_pkg//:pkg.bzl", "pkg_tar")

exports_files(["file.txt"])

pkg_tar(
    name = "foo",
    srcs = [":file.txt"],
    strip_prefix = "/",
    visibility = ["//visibility:public"],
)
$ bazel build //:pkg.tar && tar tvf bazel-bin/pkg.tar
drwxr-xr-x 0/0               0 2000-01-01 00:00 bar/
-r-xr-xr-x 0/0               0 2000-01-01 00:00 bar/file.txt
drwxr-xr-x 0/0               0 2000-01-01 00:00 foo/
-r-xr-xr-x 0/0               0 2000-01-01 00:00 foo/file.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions