From 8dc2c57df516f9391555131ecc645c4eab0e2420 Mon Sep 17 00:00:00 2001 From: Richard Woodbury Date: Sat, 26 Feb 2022 18:12:36 -0800 Subject: [PATCH] Move to Bazel 0.23.0. This is the last version of Bazel to support the use of the CROSSTOOL file. The next upgrade migth be a doozy. It was necessary to bump the version of protobuf in order to get past some deprecated usage: https://github.com/bazelbuild/bazel/issues/5827 This further necessitated adding some transitive dependencies. (This is solved more properly in a later version of protobuf, but moving that far came with a number of other challenges.) This also required setting `-Wno-inconsistent-missing-override`; I hope that warning can be restored in the future. --- .bazeliskrc | 2 +- CROSSTOOL | 2 ++ WORKSPACE | 18 ++++++++++++++++-- external/BUILD.libssh | 2 +- external/BUILD.mosh | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.bazeliskrc b/.bazeliskrc index c8c0e91..2d0e551 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=0.20.0 +USE_BAZEL_VERSION=0.23.0 diff --git a/CROSSTOOL b/CROSSTOOL index 169f1e4..e688f2c 100644 --- a/CROSSTOOL +++ b/CROSSTOOL @@ -99,6 +99,8 @@ toolchain { compiler_flag: "-Wall" # All warnings are errors. compiler_flag: "-Werror" + # Protobufs won't build with this warning: + compiler_flag: "-Wno-inconsistent-missing-override" # Would be nice to enable this warning, but then protobufs won't build. #compiler_flag: "-Wunused-parameter" # But disable some that are problematic. diff --git a/WORKSPACE b/WORKSPACE index e16c2c4..f96af55 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -64,13 +64,19 @@ http_archive( ) http_archive( - name = "zlib", + name = "pnacl_zlib", url = "https://gsdview.appspot.com/webports/builds/pepper_49/trunk-785-g807a23e/packages/zlib_1.2.8_pnacl.tar.bz2", sha256 = "99203f49edad39570a3362e72373ea1d63a97b9b1828b75e45d3e856d2832033", strip_prefix = "payload", build_file = "BUILD.zlib", ) +# Needed by `com_google_protobuf`. +bind( + name = "zlib", + actual = "@pnacl_zlib//:zlib", +) + http_archive( name = "glibc_compat", url = "https://gsdview.appspot.com/webports/builds/pepper_49/trunk-785-g807a23e/packages/glibc-compat_0.1_pnacl.tar.bz2", @@ -105,7 +111,15 @@ new_git_repository( git_repository( name = "com_google_protobuf", remote = "https://github.com/google/protobuf.git", - commit = "ce044817c7ba0aea27c3fd8e496635d94d20a755", # tag = "v3.6.0.1" + commit = "582743bf40c5d3639a70f98f183914a2c0cd0680", # tag = "v3.7.0" +) + +# Needed by `com_google_protobuf`. +http_archive( + name = "bazel_skylib", + sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d", + strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b", + urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"], ) git_repository( diff --git a/external/BUILD.libssh b/external/BUILD.libssh index 5803436..752d15f 100644 --- a/external/BUILD.libssh +++ b/external/BUILD.libssh @@ -22,7 +22,7 @@ cc_library( ":pnacl_mode": [ "@glibc_compat//:glibc_compat", "@openssl//:openssl", - "@zlib//:zlib", + "@pnacl_zlib//:zlib", ], "//conditions:default": [ ":local_openssl", diff --git a/external/BUILD.mosh b/external/BUILD.mosh index d77b1f3..abdf1e5 100644 --- a/external/BUILD.mosh +++ b/external/BUILD.mosh @@ -110,7 +110,7 @@ cc_library( deps = [ ":crypto_lib", ":protos_lib", - "@zlib//:zlib", + "@pnacl_zlib//:zlib", ], includes = ["src/network"], )