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

feat: support raw symlinks from declare_symlink() #930

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rickeylev
Copy link

Using the ctx.actions.declare_symlink() API, rules can create explicit symlinks to arbitrary
paths, which Bazel will keep as symlinks. The packaging logic treats these
as regular files, so tries to read through them and store the content they point to. This
is incorrect for two reasons: they are supposed to be left as symlinks and may be dangling
symlinks from the perspective of packaging.

To fix, introduce a new type of file entry: raw_symlink. These entries mean the src is
a symlink whose stored path should be stored into the destination verbatim, also as a symlink.
Such artifacts are identified using File.is_symlink, a Bazel 8+ API.

Work towards #929

Copy link
Collaborator

@cgrindel cgrindel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants