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

Add Starlark support for Symlink actions. #7514

Closed
Tracked by #10005
sergiocampama opened this issue Feb 22, 2019 · 6 comments
Closed
Tracked by #10005

Add Starlark support for Symlink actions. #7514

sergiocampama opened this issue Feb 22, 2019 · 6 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request

Comments

@sergiocampama
Copy link
Contributor

sergiocampama commented Feb 22, 2019

Description of the problem / feature request:

There are multiple benefits for using symlinks in certain actions, especially when creating directory structures or renaming artifacts' basenames. For example, rules_apple requires heavy usage of symlinks.

Given that symlinks are a core foundation of how Bazel works, Starlark should provide an API to register symlink actions, that work both on macOS, Linux and Windows. In native code this already exists, through the SymlinkAction class.

This could be added to the actions interface, something like ctx.actions.symlink(src, dest) where both src and dest are File instances created through ctx.actions.declare_file, for example. Notice that Fileinstances can also represent tree artifacts.

@laurentlb laurentlb added team-Starlark type: feature request P3 We're not considering working on this, but happy to review a PR. (No assignee) labels Feb 22, 2019
Yannic added a commit to Yannic/bazel that referenced this issue Feb 3, 2020
@laurentlb
Copy link
Contributor

@Yannic, thanks for the pull request!

Can you briefly clarify your plans? Do you plan to do followup changes after #10695?

@Yannic
Copy link
Contributor

Yannic commented Feb 4, 2020

@laurentlb I'm planning to investigate allowing symlinks to executables (it's unclear how dangling symlinks interact with them and I don't want to commit to an API yet), and to allow specifying a progress message for these actions (actually, it's not large change so I guess I'll just do it as part of #10695). That said, #10695 can be used by rule authors to create symlinks without any follow-ups.

Yannic added a commit to Yannic/bazel that referenced this issue Feb 18, 2020
Yannic added a commit to Yannic/bazel that referenced this issue Feb 18, 2020
Yannic added a commit to Yannic/bazel that referenced this issue Feb 18, 2020
Yannic added a commit to Yannic/bazel that referenced this issue Feb 18, 2020
bazel-io pushed a commit that referenced this issue Apr 30, 2020
Updates #7514

Closes #10695.

PiperOrigin-RevId: 309248623
@Yannic
Copy link
Contributor

Yannic commented Nov 14, 2020

I think this is implemented and can be closed?

@pauldraper
Copy link
Contributor

pauldraper commented Nov 19, 2020

@thiagohmcruz
Copy link

Got here while reading some things about ctx.actions.symlink, jump bump-ing that apparently this can be closed 👍

@brandjon
Copy link
Member

Thanks, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants