Bazel: Version check fails for version 0.10.0

Created on 5 Feb 2018  路  9Comments  路  Source: bazelbuild/bazel

ATTENTION! Please read and follow:

Description of the problem / feature request:

When checking for version requirements, Bazel doesn't qualify 0.10.0 as >= 0.4.5

WARNING: ignoring http_proxy in environment.
ERROR: /home/pranay/tensorflow/WORKSPACE:15:1: Traceback (most recent call last):
        File "/home/pranay/tensorflow/WORKSPACE", line 15
                closure_repositories()
        File "/home/pranay/.cache/bazel/_bazel_pranay/3d0247d75aecbc8cc70ab370b28b868d/external/io_bazel_rules_closure/closure/repositories.bzl", line 69, in closure_repositories
                _check_bazel_version("Closure Rules", "0.4.5")
        File "/home/pranay/.cache/bazel/_bazel_pranay/3d0247d75aecbc8cc70ab370b28b868d/external/io_bazel_rules_closure/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.0
ERROR: Error evaluating WORKSPACE file
ERROR: /home/pranay/tensorflow/WORKSPACE:41:1: Traceback (most recent call last):
        File "/home/pranay/tensorflow/WORKSPACE", line 41
                tf_workspace()
        File "/home/pranay/tensorflow/tensorflow/workspace.bzl", line 48, in tf_workspace
                check_version("0.5.4")
        File "/home/pranay/tensorflow/tensorflow/workspace.bzl", line 38, in check_version
                fail("\nCurrent Bazel version is {}, ...))

Current Bazel version is 0.10.0, expected at least 0.5.4
ERROR: Error evaluating WORKSPACE file
ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': error loading package 'external': Package 'external' contains errors
WARNING: Target pattern parsing failed.
ERROR: error loading package 'external': Package 'external' contains errors
INFO: Elapsed time: 0.056s
FAILED: Build did NOT complete successfully (0 packages loaded)

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

_check_bazel_version("Closure Rules", "0.4.5")
on Bazel version 0.10.0

What operating system are you running Bazel on?

ubuntu 16.04

What's the output of bazel info release?

WARNING: ignoring http_proxy in environment.
release 0.10.0
P2 bug

All 9 comments

I see exactly the same breakage with rules_closure. The workaround is to upgrade rules_closure
to HEAD, as they removed this check altogether.

@iirina I remember we saw this during the release candidates for 0.10.0, but I'm not sure what the fix was...?

@philwo Have you missed my comment above? I already said what the solution is. The problem was fixed in this commit in rules_closure. TF would need to upgrade to newer version of rules_closure, like I did in gerrit code review recently in this CL.

@davido Yes, but the problem here is not just rules_closure, the TensorFlow that @pranaypratyush is trying to build also seems to use the broken version check:

ERROR: /home/pranay/tensorflow/WORKSPACE:41:1: Traceback (most recent call last):
        File "/home/pranay/tensorflow/WORKSPACE", line 41
                tf_workspace()
        File "/home/pranay/tensorflow/tensorflow/workspace.bzl", line 48, in tf_workspace
                check_version("0.5.4")
        File "/home/pranay/tensorflow/tensorflow/workspace.bzl", line 38, in check_version
                fail("\nCurrent Bazel version is {}, ...))

Current Bazel version is 0.10.0, expected at least 0.5.4

I'm not sure what our recommended fix for that is - is there a TensorFlow release that has the fix for the version check? Maybe it's in the 1.6.0-rc1 release, because the latest stable 1.5.0 still has the broken one. Or would @pranaypratyush have to downgrade Bazel in order to build TensorFlow?

Ah, right, it was addressed in this issue: https://github.com/bazelbuild/bazel/issues/4425. This TF commit has the fix: https://github.com/sb2nov/tensorflow/commit/6fcfab770c2672e2250e0f5686b9545d99eb7b2b. The OP should upgrade and that should fix his problem.

@davido yeah I am not on head but the last stable tag.

@pranaypratyush If you cannot upgrade to TF head, you would need to downgrade Bazel, as pointed out by @philwo in previous comment.

Closing as we can't do anything about it - TensorFlow has to update their version check.

A dirty fix to this is to change the version check in the bazel cache file.

Was this page helpful?
0 / 5 - 0 ratings