Clear runfiles environment variables for bazel run#17690
Clear runfiles environment variables for bazel run#17690fmeum wants to merge 1 commit intobazelbuild:masterfrom
bazel run#17690Conversation
a66283c to
29eca80
Compare
29eca80 to
144403d
Compare
|
@linzhp Could you test that this is working as expected in your use case? |
|
@meteorcloudy This is ready for review. I didn't find a way to e2e test the new behavior as the test framework itself relies on runfiles variables to find |
|
It works! Thanks for fixing it |
da9d5a7 to
06f1788
Compare
|
I added a test for the |
5a3130f to
cc84d31
Compare
|
@fmeum We are having some trouble importing this PR. @sgowroji We can re-import this PR when the issue is fixed. |
When an environment variable such as `RUNFILES_DIR` is set in the client environment when a target using runfiles libraries is run via `bazel run`, the libraries can't look up the runfiles directory or manifest. This is fixed by clearing the runfiles-related environment variables from the env in which the target is executed.
cc84d31 to
ef19a29
Compare
|
@meteorcloudy I moved the test. |
When an environment variable such as `RUNFILES_DIR` is set in the client environment when a target using runfiles libraries is run via `bazel run`, the libraries can't look up the runfiles directory or manifest. This is fixed by clearing the runfiles-related environment variables from the env in which the target is executed. Fixes bazelbuild#17571 Closes bazelbuild#17690. PiperOrigin-RevId: 516474822 Change-Id: Ia5201d4334b286b36ba2e476e850b98992ca0ffa
|
@bazel-io flag |
|
This also helps with bazel-in-bazel invocations, which are common with |
|
@bazel-io fork 6.4.0 |
|
@fmeum @meteorcloudy @Wyverald I tried to cherry-pick this to release-6.4.0, but looks like there are some conflicts.
cc: @bazelbuild/triage |
When an environment variable such as `RUNFILES_DIR` is set in the client environment when a target using runfiles libraries is run via `bazel run`, the libraries can't look up the runfiles directory or manifest. This is fixed by clearing the runfiles-related environment variables from the env in which the target is executed. Fixes bazelbuild#17571 Closes bazelbuild#17690. PiperOrigin-RevId: 516474822 Change-Id: Ia5201d4334b286b36ba2e476e850b98992ca0ffa
|
@iancha1992 I submitted a manual cherry-pick in #19606. |
When an environment variable such as `RUNFILES_DIR` is set in the client environment when a target using runfiles libraries is run via `bazel run`, the libraries can't look up the runfiles directory or manifest. This is fixed by clearing the runfiles-related environment variables from the env in which the target is executed. Fixes #17571 Closes #17690. PiperOrigin-RevId: 516474822 Change-Id: Ia5201d4334b286b36ba2e476e850b98992ca0ffa Closes #19596
When an environment variable such as
RUNFILES_DIRis set in the client environment when a target using runfiles libraries is run viabazel run, the libraries can't look up the runfiles directory or manifest.This is fixed by clearing the runfiles-related environment variables from the env in which the target is executed.
Fixes #17571