-
-
Notifications
You must be signed in to change notification settings - Fork 669
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 library should provide environment variables for subprocesses #2423
Comments
Please fill out the issue template and describe the specific problem you're having. Shouldn't subprocesses already see |
This is essentially #2359 combined with https://docs.bazel.build/versions/master/skylark/rules.html#tools-depending-on-tools "To simplify subtool tool logic, it’s recommended that each subtool optionally accept its runfiles root as a parameter (via environment or command line argument/flag). A root tool can thus pass the correct canonical runfiles root to any of its subtools." and the reasoning given at https://github.com/bazelbuild/bazel/blob/master/tools/cpp/runfiles/runfiles_src.h#L58.
These variables are only set when using |
Thanks, that makes more sense. Marking as a feature request. |
If a Bazel-built binary wants to launch another Bazel-built binary, it needs to tell the latter binary where to find the runfiles, because
argv[0]
for the latter binary will be different (or, in case of scripts, entirely unavailable). Other languages provide a function that returnsRUNFILES_DIR
andRUNFILES_MANIFEST
environment variables (see https://github.com/bazelbuild/bazel/blob/master/tools/cpp/runfiles/runfiles_src.h#L159 for C++), and runfiles.go should provide the same:The text was updated successfully, but these errors were encountered: