Description
I was writing some repository rules and I just couldn't get why the PATH
variable stored only the path to the Bazel binary, no matter what combination of --action_env
s or --repo_env
s I used (and now I know they don't even matter in the case of repository rules and PATH
).
After some time of feeling hopeless, my mind was struck by the idea of executing Bazel directly, not by Bazelisk. And... this timePATH
was the same as the system one. That gave me just a little bit of hope that I'm not actually going insane.
So after that, I decided to try the previous version of Bazelisk, 1.5.0
, and PATH
was also the same as the system one.
Patch notes for 1.6.0
say:
Bazelisk now runs Bazel with a $PATH set so that running the bazel command resolves to the correct Bazel version. For example, this is useful if you have shell scripts or tests that invoke bazel - these will now pick the right version of Bazel. Thanks for the contribution @coeuvre! (#111)
and #111 says:
Bazelisk subprocesses should prepend the correct bazel to the $PATH
So it seems that instead of prepending, Bazelisk is overwriting PATH
. Or I'm misunderstanding something.
I'm on Windows btw.
Activity
philwo commentedon Aug 15, 2020
@coeuvre Could you have a look please?
coeuvre commentedon Aug 17, 2020
I have tested with following setup in
linux
andmac
and it works as expected. Will test it onwindows
soon.Can you also provide steps to reproduce the bug? Thanks!
spietras commentedon Aug 17, 2020
Ok, I also tested it on Linux and it seems to work there. It's just not working on Windows:
defs.bzl
:WORKSPACE
:BUILD
:Now try
bazelisk build test
and compare withecho %PATH%
.Maybe it's some issue with path separators or slashes?