-
Notifications
You must be signed in to change notification settings - Fork 4k
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
.bazelversion
blocks query of 'bazel version' and bazel info release
#11346
Comments
That's a fun one. The behavior is both reasonably correct and blindingly stupid. The same thing happens for |
Hi, This is my first time working on the Bazel project. I wanted to ask some clarifying questions before I took on this issue. I was able to reproduce the problem as mentioned by psigen on OSX. I added an incompatible version string (i.e. 5.0.0) and I am unable to make queries like bazel version and bazel info release. I downloaded the sample project from the "Introduction to Bazel: Building a Java Project" page and tried bazel version. This is what I got:
Do we want to check if the version string is invalid in the .bazelversion, and then send a proper output, with the most current build label? Edit* I tried using the version string 3.1.0, and I got a similar error. I assume this is because I don't have bazel 3.1.0 installed. Is this the expected result? |
Hi, I was able to get some clarification regarding what the output should be from psigen. I will take a look at how I can modify./scripts/packages/bazel.sh. Based on psigen's clarification, I will try to get the output to be similar to the output when there is no .bazelversion file at all. -- Nikhil Pothuru |
Thank you for your thoughts on this. Unfortunately I don't understand what your expected behavior is. The output The error message seems sensible to me and I fail to see how you could end up with an "invalid" |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
Would it be possible to amend the error message to include meta-information about available versions of bazel? Also I am a bit unclear, is this message coming from bazel or from bazelisk? Maybe this issue need to be moved there? Many other compilers and packaging systems have benefited from adding hints around valid values into their error messages. It could be similarly helpful here. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post |
Description of the problem / feature request:
The presence of a
.bazelversion
file that defines any non-matching version at the root of a directory structure prevents bazel from intepreting any commands in any subdirectory, includingbazel version
,help
,info
.However, these are the commands needed to debug why
.bazelversion
is not satisfied, or to query non-build-related help information. For example,bazel info
can only be run from a workspace.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
.bazelversion
WORKSPACE
.bazelversion
, put a clearly incompatible version string, e.g.5.0.0
.bazel version
within this directory. Instead of returning the version, bazel will print:.bazelversion
file or debug a pathing issue (e.g. if a wrong installation of bazel is being used).(As an interesting side note, while testing I accidentally created a blank
WORKSPACE
and incompatible.bazelversion
file in my user home directory-- this blocked me from running bazel commands in any subdirectory that was not a workspace itself.)What operating system are you running Bazel on?
Ubuntu 18.04 (also observed on OSX).
What's the output of
bazel info release
?Have you found anything relevant by searching the web?
Mentioned in #11264, which focuses on missing documentation for
.bazelversion
. It's fine to close this as a duplicate, I just wanted to specifically describe the usability issue.The text was updated successfully, but these errors were encountered: