Upgrade bazel to 5.0.0

These are the commands I used to generate the bazel xz file:

    $ wget 'https://github.com/bazelbuild/bazel/releases/download/5.0.0/bazel-5.0.0-linux-x86_64'
    $ xz bazel-5.0.0-linux-x86_64
    $ mv bazel-5.0.0-linux-x86_64.xz bazel_5.0.0.xz

I had to tweak `.bazelrc` a bit because some options were promoted
from experimental status to non-experimental status. A couple of
incompatible flags are gone now too.

I had to change some of our Java setup as per
https://github.com/bazelbuild/bazel/issues/7849. It's not obvious to
me that I did it correctly, but bazel doesn't seem to complain about
the new options I added.

The `--watchfs` in `tools/ci/buildkite.yaml` was generating this
error:

    ERROR: --watchfs as startup option is deprecated, replace it with the equivalent command option. For example, instead of 'bazel --watchfs build //foo', run 'bazel build --watchfs //foo'.

As far as I can tell, the `common --watchfs` option in our `.bazelrc`
should cover this. So I deleted the option from our buildkite config.

Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Ie85e68a1437c924d6dd4e7c4089e7d3d4e4cab90
diff --git a/WORKSPACE b/WORKSPACE
index 1ea9cce..6ed6b7e 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -2,6 +2,7 @@
 
 load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
+load("@bazel_tools//tools/jdk:remote_java_repository.bzl", "remote_java_repository")
 load(
     "//debian:python.bzl",
     python_debs = "files",
@@ -614,20 +615,19 @@
 )
 
 # Java9 JDK.
-http_archive(
+remote_java_repository(
     name = "openjdk_linux_archive",
-    build_file_content = """
-java_runtime(
-    name = 'jdk',
-    srcs = glob(['**']),
-    visibility = ['//visibility:public'],
-)
-""",
+    exec_compatible_with = [
+        "@platforms//cpu:x86_64",
+        "@platforms//os:linux",
+    ],
+    prefix = "openjdk",
     sha256 = "f27cb933de4f9e7fe9a703486cf44c84bc8e9f138be0c270c9e5716a32367e87",
     strip_prefix = "zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules",
     urls = [
         "https://www.frc971.org/Build-Dependencies/zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules.tar.gz",
     ],
+    version = "9",
 )
 
 local_repository(