bazel: CI projects are failing with bazel 0.10.0 RC1 due to wrongly identifying the current Bazel version
rules_closure fails to build:
ERROR: /Users/ci/workspace/Global/rules_closure-node=darwin-x86_64/WORKSPACE:6:1: Traceback (most recent call last):
File "/Users/ci/workspace/Global/rules_closure-node=darwin-x86_64/WORKSPACE", line 6
closure_repositories()
File "/Users/ci/workspace/Global/rules_closure-node=darwin-x86_64/closure/repositories.bzl", line 69, in closure_repositories
_check_bazel_version("Closure Rules", "0.4.5")
File "/Users/ci/workspace/Global/rules_closure-node=darwin-x86_64/closure/repositories.bzl", line 172, in _check_bazel_version
fail(("%s requires Bazel >=%s but was...)))
Closure Rules requires Bazel >=0.4.5 but was 0.10.0rc1
ERROR: Error evaluating WORKSPACE file
ERROR: error loading package 'external': Package 'external' contains errors
INFO: Elapsed time: 0.522s
FAILED: Build did NOT complete successfully (0 packages loaded)
The console output is here.
This is blocking the 0.10.0 release (#3958).
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 51 (43 by maintainers)
Commits related to this issue
- Parse the Bazel version as a tuple of ints instead of strings This fixes the tuple comparison in `check_bazel_version`, as seen in the incorrect version comparisons in https://github.com/bazelbuild/b... — committed to bazelbuild/bazel-integration-testing by jin 6 years ago
- Modify `_parse_bazel_version` to return a tuple of ints rather than a tuple of strings. (#16015) Bazel is updating its version to 0.10.0, and this will break the version check. Applying suggested fix... — committed to tensorflow/tensorflow by frankchn 6 years ago
- Upgrade Closure Rules dependencies (Java 8) Many of these jars were built for Java 8+ runtime environments. After this change Closure Rules can no longer provide support for Java 7 runtime environmen... — committed to bazelbuild/rules_closure by jart 6 years ago
- Merge pull request #58219 from ixdy/bazel-skylib-check-version Automatic merge from submit-queue (batch tested with PRs 58216, 58193, 53033, 58219, 55921). If you want to cherry-pick this change to a... — committed to kubernetes/kubernetes by deleted user 6 years ago
- Bazel: Use version check function from bazel-skylib repository Since version 0.10.0rc1 Bazel started to include version in release candidate and this broke version check in Bazel Gerrit CI: [1]. baz... — committed to GerritCodeReview/gerrit by davido 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like https://github.com/bazelbuild/bazel/issues/4425 PiperOrigin-RevId: 182085505 — committed to sb2nov/tensorflow by deleted user 6 years ago
- Update java_import_external best practices Our best practices have evolved to recommend HTTP. There's also now a note that should help maintainers do the right thing. https://github.com/bazelbuild/b... — committed to jart/bazel by jart 6 years ago
- Bazel: Use rules_closure from HEAD The latest rules_closure changes updated closure compiler version and remove stale bazel version check, that broke Bazel CI for gerrit: [1]. It turns out that the ... — committed to openstack-infra/gerrit by davido 6 years ago
- Upgrade Protobuf and Closure Rules deps (#883) This unfortunately adds about 30 seconds of build time. This same change was recently made in https://github.com/tensorflow/tensorflow/pull/16157 and is... — committed to tensorflow/tensorboard by jart 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like https://github.com/bazelbuild/bazel/issues/4425 PiperOrigin-RevId: 182085505 — committed to propelml/tensorflow by deleted user 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like https://github.com/bazelbuild/bazel/issues/4425 PiperOrigin-RevId: 182085505 — committed to propelml/tensorflow by deleted user 6 years ago
- Bazel: Use rules_closure from HEAD The latest rules_closure changes updated closure compiler version and remove stale bazel version check, that broke Bazel CI for gerrit: [1]. It turns out that the ... — committed to openstack-infra/gerrit by davido 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like bazelbuild/bazel#4425 PiperOrigin-RevId: 182085505 — committed to MarkDaoust/tensorflow by MarkDaoust 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like bazelbuild/bazel#4425 PiperOrigin-RevId: 182085505 — committed to MarkDaoust/tensorflow by MarkDaoust 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like https://github.com/bazelbuild/bazel/issues/4425 PiperOrigin-RevId: 182085505 — committed to MarkDaoust/tensorflow by deleted user 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like https://github.com/bazelbuild/bazel/issues/4425 PiperOrigin-RevId: 182085505 — committed to angerson/tensorflow by deleted user 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like https://github.com/bazelbuild/bazel/issues/4425 PiperOrigin-RevId: 182085505 — committed to tensorflow/tensorflow by deleted user 6 years ago
- Have _check_bazel_version_at_least compare versions as ints, not strings. This prevents issues like https://github.com/bazelbuild/bazel/issues/4425 PiperOrigin-RevId: 182085505 — committed to SymbioticLab/tensorflow-salus by deleted user 6 years ago
- Upgrade Closure Rules dependencies (Java 8) Many of these jars were built for Java 8+ runtime environments. After this change Closure Rules can no longer provide support for Java 7 runtime environmen... — committed to ptmphuong/rules_closure by jart 6 years ago
What should projects that use bazel do in the face of this bug? We’re seeing this behavior now that 0.10.0 is out in the wild: https://github.com/PAIR-code/facets/issues/107
If you’re updating bazel-skylib for this check, make sure to update to bazelbuild/bazel-skylib#14. There was a small bug in bazelbuild/bazel-skylib#13 that caused the version check to fail for source builds of Bazel. It shouldn’t affect official releases or RCs though.
Gerrit Code Review was fixed: https://gerrit-review.googlesource.com/#/c/gerrit/+/152290.
The CL above was merged, so that Gerrit job on Bazel-CI should be green again.
@jin @gunan suggested not adding a new dependency for parsing.
I can update https://github.com/bazelbuild/bazel-integration-testing/blob/master/bazel_version.bzl to use @jayconrod’s function, and have that file bundled in
bazelbuild/bazel-skylib
as the canonical version. What does everyone think?e.g. in
WORKSPACE
I propose the function below:
Find the first character in the version string which is not a digit or ‘.’, and ignore that character and everything after. Split the remaining string on ‘.’, and convert the pieces to integer.