Skip to content

pkg_files ignores included pkg_mklinks #980

@aiuto

Description

@aiuto

GoaI

I want to construct a tree like

/lib/foo.so.1.2.3
/lib/foo.so -> foo.so.1.2.3

I would produce foo.so.1.2.3 with a cc_shared_library or cc_binary. I use pkg_files to locate that .so file into the image in /lib. I create the symlink with pkg_mklink. I want to include the link in the pkg_files target, and have both exist in lib. E.g.

fake_artifact(
    name = "fake.so.1.2.3",
)

pkg_mklink(
    name = "relative_link",
    link_name = "so_by_another_name",
    target = "fake.so.1.2.3",
)

pkg_files(
    name = "fake_so_in_lib",
    srcs = [
         ":fake.so.1.2.3",
         ":relative_link",      # THIS GETS LOST.
   ],
    prefix = "/lib",
)

I have to fake it with

pkg_mklink(
    name = "absolute_link",
    link_name = "/lib/fake.so.1",
    target = "fake.so.1.2.3",
)

and including absolute_link in my final pkg_{tar|rpm|install}.

posible solutions

  1. Make it work with no surprises.
  2. Add prefix to pkg_mklink.

But I am thinking that we need both. Put the prefix in the provider and have pkg_files rewrite the provider with the new link.

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