bazelisk
bazelisk copied to clipboard
USE_BAZEL_VERSION with absolute path results in "invalid version unknown"
When doing this:
% USE_BAZEL_VERSION=$PWD/tmp/bazel/versions/1.0.0-darwin/bin/bazel bazelisk --migrate build //...
2019/10/16 11:41:45 could not get the list of incompatible flags: invalid version unknown
Is this because my bazel binary doesn't have the version in the binary name itself?
USE_BAZEL_VERSION refers to a dotted version, not a path to a local binary.
I'm using bazelisk 1.1.0 https://github.com/bazelbuild/bazelisk/releases/tag/v1.1.0
Hi @keith,
Yes, that’s exactly the problem. Bazelisk currently cannot extract the version number from a given local Bazel binary, which is why it can’t fetch the flags needed to migrate from GitHub when using that feature.
If you or others have ideas how to improve this, I’d love to hear them!
@keith nice, TIL.
Any reason Bazelisk couldn't run your Bazel to get this?
Yeah, we could do that. I guess the format is stable enough that it shouldn’t cause issues.
I recently found out that we have support for bazel --version
, which does not require starting up a Bazel server or extracting the install_base, so it's very fast. We could use that to implement the version detection.