-
-
Notifications
You must be signed in to change notification settings - Fork 678
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
runfiles.Rlocation library returns relative paths #3376
Comments
Thanks for the report, I submitted #3377 to update the docs. I think it's beneficial for users and devs if we allow relative paths as outputs when they are more convenient, so I just updated the docs. @gonzojive Let me know if you think that this is not a good solution. |
Seems ok. https://github.com/bazelbuild/bazel/blob/master/tools/java/runfiles/Runfiles.java doesn't seem to make paths absolute either. |
Actually, please see the design doc language:
I typically want absolute paths from runfiles so I can be sure they will be found even when the working directory changes. |
The unfortunate situation with runfiles libraries is that the design doc is pretty outdated and not consistent with in-the-wild implementations. The Bazel-provided runfiles libraries all return the same mix of relative and absolute paths as the rules_go one, favoring relative paths if available for improved incidental hermeticity. If you really always want absolute paths, I would recommend adding your own wrapper around the global runfiles object or explicitly passing in the value of |
What version of rules_go are you using?
v0.36.0
What version of gazelle are you using?
n/a
What version of Bazel are you using?
5.3.2
Does this issue reproduce with the latest releases of all the above?
Yes.
What operating system and processor architecture are you using?
Linux amd64.
Any other potentially useful information about your toolchain?
What did you do?
Documentation says "// Rlocation returns the absolute path name of a runfile", but I am getting "bazel-out/k8-opt-exec-2B5CBBC6/bin/bazel/web/targets/plugin/plugin_/plugin.runfiles/bazel/web/targets/protoc-gen-ts-proto."
The Go binary is executing within a genrule, FWIW.
What did you expect to see?
An absolute path in the output.
What did you see instead?
An relative path in the output.
The text was updated successfully, but these errors were encountered: