Skip to content

package_dir attribute is not applied to pkg_mklink #610

@ljessendk

Description

@ljessendk

I'm upgrading from rules_pkg 0.5.2 to rules_pkg 0.7.0 and trying to use the new "package_dir" parameter to add the "./" prefix that was removed as part of (#531).
But it seems that "package_dir" does not work with pkg_mklink.

The following code illustrates the problem:

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

pkg_files(
    name = "myfile_pkg",
    srcs = ["myfile"],
)

pkg_mklink(
    name = "mylink_lnk",
    link_name = "mylink",
    target = "myfile",
)

pkg_tar(
    name = "myarchive",
    srcs = ["myfile_pkg", "mylink_lnk"],
    package_dir = "."
)

Invoking

bazel build myarhive.tar
tar tf bazel-bin/myarchive.tar

Gives:

./myfile
mylink

I would have expected:

./myfile
./mylink

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions