Benjamin Peterson
unread,Oct 17, 2018, 10:28:54 AM10/17/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to László Csomor, Ulf Adams, Laurent Le Brun, Christopher Parsons, baze...@googlegroups.com, Dmitry Lomov
On Wed, Oct 17, 2018, at 01:10, László Csomor wrote:
> Benjamin's proposal makes sense to me.
> Agreed with Laurent: the new fields should be meaningful on Windows.
These fields are only "new" in the sense a little more about them is exposed to Starlark under my proposal. One can already create runfiles objects with symlinks and root_symlinks from Starlark; the resulting objects are just not introspectable. This proposal does not change the operational semantics of runfiles on any platform.
>
> Questions: what are runfiles.symlinks and what are root symlinks?
The symlinks attribute lets you put an artifact in runfiles with a name different that its root-relative path. You can think of a "normal" runfile artifact as being a symlink of the form {artifact.short_path: artifact}. By varying the key, you can change the destination path.
root_symlinks are similar but more obscure. They let you place artifacts in the root of the runfiles tree rather than inside the artifact's repository directory. I think the android rules use them to put JNIs in the runfiles tree.
On Wed, Oct 17, 2018, at 01:19, László Csomor wrote:
> And another question: how would a Starlark rule reading the SymlinkEntries
> tell apart empty files (__init__.py) from normal symlinks?
There's a separate attribute on runfiles objects called "empty_files" which contains the empty files.