-
Notifications
You must be signed in to change notification settings - Fork 179
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
First cut at runfiles support in pkg_* rules #605
Conversation
So I've tried this with the most recent rules_python to package a Python binary runfiles, and here's the problem I'm encountering: there's
So here's a suggestion: perhaps this should take |
That's going to have to be a second pass.
When we start doing symlinks instead of files, it's not obvious what is
correct:
- create symlink and hope the file is there
- copy the file to the expected place and create the link
- copy the target to the location of the symlink and make it a real file.
The first choice is probably wrong.
If the second choice, what if the expected place is outside the workspace?
The third one seems right, and yet still wrong.
It's going to take some poking about to cover all the issues.
…On Tue, Sep 13, 2022 at 8:10 PM depthwise ***@***.***> wrote:
So I've tried this with the most recent rules_python to package a Python
binary runfiles, and here's the problem I'm encountering: there's
DefaultInfo.default_runfiles.root_symlinks that rules_pkg doesn't seem
take into account. This breaks py_binary in 2 ways:
1. bazel_tools/tools/python/py3wrapper.sh is missing (although it is
present under external, just not directly at root)
2. Python bootstrap expects the various external PIP modules to be in
runfiles root (they are symlinked when building in bazel), but because
these are, well, root_symlinks, they're missing too.
So here's a suggestion: perhaps this should take root_symlinks into
account? I know this property is undocumented, but it is very much a thing.
—
Reply to this email directly, view it on GitHub
<#605 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHBYFRBCC7GIG2TVZ2TV6EJXLANCNFSM54UOACZA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM all things considered, but I think the commit message heading could be made more specific and call out exactly what happened.
BTW, it looks like pkg_zip
doesn't even support include_runfiles
as an attribute, so that may need to be added in and tested.
Add include_runfiles support to the manifest builder used by pkg_tar and pkg_zip. This pulls in runfiles in the same layout as bazel does. This is not a great layout, but it is understandable. For example, an executable with a
data
dep might look likeNote the duplication of an_executable. That could be expensive, so we will eventually want a way to suppress that.
Next steps:
pkg_tar
andpkg_zip
.include_runfiles
topkg_files
.See #153 for overall design and features to be implemented.