-
-
Notifications
You must be signed in to change notification settings - Fork 584
fix: Fall back to directory based runfiles using relative paths #2621
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the fix @mering . I think this looks fine, but some surrounding changes to make:
|
b5f6f7d
to
cf7f3af
Compare
@rickeylev Thanks for the review. See my answers below:
|
This will also work out of the box when the runfiles tree is packaged into a container image.
cf7f3af
to
d060f57
Compare
Overall LGTM. CI is failing -- that test just needs to be updated. It's assuming the only two ways to find the runfiles root is the environment variables, but we're adding a 3rd attempt to look based upon its own file path.
Thanks for explaining. So basically, copying Yeah, that should work -- the structure is preserved; I don't see why it wouldn't. I've updated the description to reflect this.
What you're probably seeing is the bootstrap will set the RUNFILES_DIR environment variable (or manifest env var, depending on what it figures out). er but -- if the bootstrap is always setting those env vars, how is runfiles not seeing them? |
This makes the runfiles libraries work when they're repackaged and extracted elsewhere.
e.g. a py_binary is packaged using
pkg_tar
, then extracted somewhere else.The
bazel-bin/{BIN,BIN.runfiles}
structure (sans the bazel-bin prefix) is preserved, and then e.g../BIN
is run. This is equivalent to runningbazel-bin/BIN
(i.e nopresumption about environment variables can be made), just the location differs.
This makes it work out of the box when the runfiles tree is packaged into a container image as follows: