Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checked in config needed for Bazel 4.1.0 #958

Closed
davido opened this issue May 21, 2021 · 2 comments
Closed

Checked in config needed for Bazel 4.1.0 #958

davido opened this issue May 21, 2021 · 2 comments

Comments

@davido
Copy link

davido commented May 21, 2021

We cannot build Gerrit on RBE with new and shiny Bazel 4.1.0 release yet (released earlier today):

  $ bazel build --config=remote --remote_instance_name=<RBE-Project>  :gerrit
INFO: Invocation ID: 8efa7885-f3ed-4425-ac7c-861071de4b7d
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=159
INFO: Reading rc options for 'build' from /home/davido/projects/gerrit/.bazelrc:
  'build' options: --workspace_status_command=python3 ./tools/workspace_status.py --repository_cache=~/.gerritcodereview/bazel-cache/repository --action_env=PATH --disk_cache=~/.gerritcodereview/bazel-cache/cas --java_toolchain=//tools:error_prone_warnings_toolchain_java11 --incompatible_strict_action_env --announce_rc
INFO: Reading rc options for 'build' from /home/davido/.bazelrc:
  'build' options: --experimental_generate_json_trace_profile --experimental_profile_cpu_usage
INFO: Found applicable config definition build:remote in file /home/davido/projects/gerrit/tools/remote-bazelrc: --jobs=200 --disk_cache= --host_javabase=@rbe_jdk11//java:jdk --javabase=@rbe_jdk11//java:jdk --crosstool_top=@rbe_jdk11//cc:toolchain --extra_toolchains=@rbe_jdk11//config:cc-toolchain --extra_execution_platforms=@rbe_jdk11//config:platform --host_platform=@rbe_jdk11//config:platform --platforms=@rbe_jdk11//config:platform --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 --define=EXECUTOR=remote --remote_cache=remotebuildexecution.googleapis.com --remote_executor=remotebuildexecution.googleapis.com --remote_timeout=3600 --google_default_credentials
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14: 
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:125:14: rbe_jdk11 not using checked in configs; Bazel version 4.1.0 was picked/selected but no checked in config was found in map {"0.20.0": ["8.0.0"], "0.21.0": ["8.0.0"], "0.22.0": ["8.0.0", "9.0.0"], "0.23.0": ["8.0.0", "9.0.0"], "0.23.1": ["8.0.0", "9.0.0"], "0.23.2": ["9.0.0"], "0.24.0": ["9.0.0"], "0.24.1": ["9.0.0"], "0.25.0": ["9.0.0"], "0.25.1": ["9.0.0"], "0.25.2": ["9.0.0"], "0.26.0": ["9.0.0"], "0.26.1": ["9.0.0"], "0.27.0": ["9.0.0"], "0.27.1": ["9.0.0"], "0.28.0": ["9.0.0"], "0.28.1": ["9.0.0"], "0.29.0": ["9.0.0"], "0.29.1": ["9.0.0", "10.0.0"], "1.0.0": ["9.0.0", "10.0.0"], "1.0.1": ["10.0.0"], "1.1.0": ["10.0.0"], "1.2.0": ["10.0.0"], "1.2.1": ["10.0.0"], "2.0.0": ["10.0.0"], "2.1.0": ["10.0.0"], "2.1.1": ["10.0.0", "11.0.0"], "2.2.0": ["11.0.0"], "3.0.0": ["11.0.0"], "3.1.0": ["11.0.0"], "3.2.0": ["11.0.0"], "3.3.0": ["11.0.0"], "3.3.1": ["11.0.0"], "3.4.1": ["11.0.0"], "3.5.0": ["11.0.0"], "3.5.1": ["11.0.0"], "3.6.0": ["11.0.0"], "3.7.0": ["11.0.0"], "3.7.1": ["11.0.0"], "3.7.2": ["11.0.0"], "4.0.0": ["11.0.0"]}
INFO: Repository rbe_jdk11 instantiated at:
  /home/davido/projects/gerrit/WORKSPACE:48:15: in <toplevel>
  /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo.bzl:1217:20: in rbe_autoconfig
Repository rule _rbe_autoconfig defined at:
  /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo.bzl:654:34: in <toplevel>
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_toolchains/rules/rbe_repo.bzl:492:10: Bazel 4.1.0 is used in rbe_jdk11.
ERROR: An error occurred during the fetch of repository 'rbe_jdk11':

@philwo

Can we automate it? Or add a TODO to the Bazel release process, to avoid the delay?

@davido
Copy link
Author

davido commented May 22, 2021

I figured, there is a workaround:

diff --git a/WORKSPACE b/WORKSPACE
index 0caf8c3d20..f7db0158c0 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -47,6 +47,7 @@ load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
 # Creates a default toolchain config for RBE.
 rbe_autoconfig(
     name = "rbe_jdk11",
+    bazel_version = "4.0.0",
     java_home = "/usr/lib/jvm/11.29.3-ca-jdk11.0.2/reduced",
     use_checked_in_confs = "Force",
 )

It works and the I see this log output:

DEBUG: /home/davido/.cache/bazel/_bazel_davido/5c01f4f713b675540b8b424c5c647f63/external/bazel_toolchains/rules/rbe_repo.bzl:492:10: Bazel 4.0.0 is used in rbe_jdk11.

@philwo
Copy link
Member

philwo commented May 22, 2021

@davido Sorry, bazel-toolchains 4.x and the rbe-ubuntu1604 container are no longer maintained. Your workaround looks fine to me! While you're on 4.x, I would recommend to bump your version to bazel-toolchains 4.1.0 to avoid hitting another incompatibility that we found.

Context:

We're also currently researching and figuring out how to make it easy to switch to bazel-toolchains 5.x, but I'm about to go on vacation for two weeks, so I'll follow up on that when I'm back.

@philwo philwo closed this as completed May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants