Check bazel version: print a warning if version not in range #1277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR for issue #741
As discussed on slack, we don't to fail if the actual bazel version is not the expected one, we prefer to issue a warning. As a consequence, the code doesn't write anything if it cannot find the version (don't want to issue a warning about a possible warning..).
For a reason detailed here: bazelbuild/bazel#8305 checking bazel's version cannot be done anywhere, that is why it is done in haskell/repositories.bzl.
I did not find a preferred way how to issue a warning message, so I'm simply using Starlark's
print
function for our messages, please reconsider this.Tests
In
rules_haskell/tutorial
, with bazel from APTAt the repo's root, with bazel from nix-shell
Then with a modified
nixkpgs/default.nix
, to have bazel2.1.0
: