diff options
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | examples/WORKSPACE | 2 | ||||
-rw-r--r-- | protobuf.bzl | 12 |
3 files changed, 14 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 4cfc5bf0..6e34d45a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,16 +46,8 @@ matrix: env: CONFIG=python_cpp - os: osx env: CONFIG=php5.6_mac - # Xcode versions force a host version of macOS: - # https://docs.travis-ci.com/user/reference/osx/#OS-X-Version - # Force macOS 10.12, the default travis image is going to be - # updated "soon", at which point this came come out: - # https://blog.travis-ci.com/2017-10-16-a-new-default-os-x-image-is-coming - osx_image: xcode8.3 - os: osx env: CONFIG=php7.0_mac - # Same note about macOS version as on the php5.6_mac config. - osx_image: xcode8.3 # ----------------------------------------------------------------- # Linux hosted tests diff --git a/examples/WORKSPACE b/examples/WORKSPACE index bb003107..936f2441 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -5,6 +5,8 @@ http_archive( strip_prefix = "protobuf-master", urls = ["https://github.com/google/protobuf/archive/master.zip"], ) +load("@com_google_protobuf//:protobuf.bzl", "check_protobuf_required_bazel_version") +check_protobuf_required_bazel_version() # This com_google_protobuf_cc repository is required for cc_proto_library # rule. It provides protobuf C++ runtime. Note that it actually is the same diff --git a/protobuf.bzl b/protobuf.bzl index 23380bab..6aed44a4 100644 --- a/protobuf.bzl +++ b/protobuf.bzl @@ -400,3 +400,15 @@ def internal_protobuf_py_tests( srcs=[s], main=s, **kargs) + + +def check_protobuf_required_bazel_version(): + """For WORKSPACE files, to check the installed version of bazel. + + This ensures bazel supports our approach to proto_library() depending on a + copied filegroup. (Fixed in bazel 0.5.4) + """ + expected = apple_common.dotted_version("0.5.4") + current = apple_common.dotted_version(native.bazel_version) + if current.compare_to(expected) < 0: + fail("Bazel must be newer than 0.5.4") |