Upgrade to bazel 6.0.0
In my attempt to migrate to rules_python, I realized that we need a
newer version of bazel. I'm not sure exactly what minimum version we
need, but I've landed various improvements to `target_compatible_with`
since 5.1. The newer version will prevent the rules_python targets
from being evaluated on platforms that don't support Python.
In short, this patch upgrades us to bazel 6. I had to fix a few things
in our code base to accommodate that.
I needed to tweak our WORKSPACE file slightly. We used to load the
external repositories in //debian very early on. That is no longer
possible as newer versions of bazel are pushing folks to use
`rules_pkg` instead of using the builtin `@bazel_tools` repo. That
means we can't use `rules_pkg` before we load it. The WORKSPACE file
now loads `rules_pkg` before the various repositories from //debian
use it. I moved skylib and rules_python because they are dependencies
of rules_pkg.
I also had to update a few abseil targets so that they won't use the
`@bazel_tools` platforms targets that no longer exist.
The syntax for `remote_java_repository` changed as well. The
`exec_compatible_with` attribute has been renamed to
`remote_java_repository`.
Lastly, here's how I packaged the bazel release:
$ wget https://github.com/bazelbuild/bazel/releases/download/6.0.0/bazel-6.0.0-linux-x86_64
$ xz bazel-6.0.0-linux-x86_64
$ mv bazel-6.0.0-linux-x86_64.xz bazel_6.0.0.xz
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I970c4cc97a4af25bbeecc48cecc390db0b5bed57
diff --git a/tools/bazel b/tools/bazel
index 72ca2f8..82a86fe 100755
--- a/tools/bazel
+++ b/tools/bazel
@@ -24,7 +24,7 @@
exec "${BAZEL_OVERRIDE}" "$@"
fi
-readonly VERSION="5.1.1"
+readonly VERSION="6.0.0"
readonly DOWNLOAD_DIR="${HOME}/.cache/bazel"
# Directory to unpack bazel into. This must change whenever bazel changes.