From 0e1f6bc5facaa41e00ba93c035123fbba5336772 Mon Sep 17 00:00:00 2001 From: pcloudy Date: Wed, 20 May 2026 01:08:29 -0700 Subject: [PATCH 1/5] Disable sandbox tests on RBE Those tests are failing since we migrated to ubuntu2404 for RBE Fixes https://buildkite.com/bazel/bazel-bazel/builds/35546 PiperOrigin-RevId: 918287393 Change-Id: Ifa81d0d990a692d6aaa0f0363cd2fe2060645b48 --- .bazelci/postsubmit.yml | 6 ++++++ .bazelci/presubmit.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 84fa4f52dfe174..895d647ef65187 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -336,6 +336,12 @@ tasks: - "-//src/test/shell/bazel:verify_workspace" # Disable some Android tests since we are moving Android rules out of the Bazel repo. - "-//src/test/shell/bazel:bazel_android_tools_test" + # Disable tests that fail on RBE due to sandboxing/mount restrictions + - "-//src/test/shell/integration:sandboxing_test" + - "-//src/test/java/com/google/devtools/build/lib/shell:CommandUsingLinuxSandboxTest" + - "-//src/test/shell/bazel:bazel_spawnstats_test" + - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" + - "-//src/test/shell/integration:test_test" include_json_profile: - build - test diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 2a48f265ccbbb5..d4f8c496095d50 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -362,6 +362,12 @@ tasks: - "-//src/test/shell/bazel:bazel_sandboxing_networking_test" # Disable some Android tests since we are moving Android rules out of the Bazel repo. - "-//src/test/shell/bazel:bazel_android_tools_test" + # Disable tests that fail on RBE due to sandboxing/mount restrictions + - "-//src/test/shell/integration:sandboxing_test" + - "-//src/test/java/com/google/devtools/build/lib/shell:CommandUsingLinuxSandboxTest" + - "-//src/test/shell/bazel:bazel_spawnstats_test" + - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" + - "-//src/test/shell/integration:test_test" include_json_profile: - build - test From ceb305b34dcbef0a10801e4ba42f3ddf0a9a47e1 Mon Sep 17 00:00:00 2001 From: Chi Wang Date: Wed, 13 May 2026 03:21:32 -0700 Subject: [PATCH 2/5] ci(rbe): upgrade to ubuntu2404. (https://github.com/bazelbuild/bazel/pull/29529) Closes #29529. PiperOrigin-RevId: 914759633 Change-Id: Iac184bef4dd0e50b64bd71a5c812826d69c989c2 --- .bazelci/postsubmit.yml | 4 ++-- .bazelci/presubmit.yml | 4 ++-- .bazelrc | 16 +++++++--------- BUILD | 2 +- MODULE.bazel | 4 ++-- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 895d647ef65187..db6a315c6efc84 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -282,8 +282,8 @@ tasks: - "//src:bazel_nojdk.exe" include_json_profile: - build - rbe_ubuntu2004: - platform: ubuntu2004 + rbe_ubuntu2404: + platform: ubuntu2404 name: "RBE" build_flags: - "--config=remote" diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index d4f8c496095d50..ae80faa344de61 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -305,8 +305,8 @@ tasks: - "//src:bazel_nojdk.exe" include_json_profile: - build - rbe_ubuntu2004: - platform: ubuntu2004 + rbe_ubuntu2404: + platform: ubuntu2404 name: "RBE" build_flags: - "--config=remote" diff --git a/.bazelrc b/.bazelrc index a9c3518b091d04..6a59a439241ed9 100644 --- a/.bazelrc +++ b/.bazelrc @@ -11,17 +11,15 @@ build:remote_shared --action_env=PATH=/bin:/usr/bin:/usr/local/bin build:remote_shared --java_runtime_version=rbe_jdk build:remote_shared --tool_java_runtime_version=rbe_jdk -# Configuration to build and test Bazel on RBE on Ubuntu 18.04 with Java 11 -build:ubuntu2004 --extra_toolchains=@rbe_ubuntu2004//java:all -build:ubuntu2004 --crosstool_top=@rbe_ubuntu2004//cc:toolchain -build:ubuntu2004 --extra_toolchains=@rbe_ubuntu2004//config:cc-toolchain -build:ubuntu2004 --extra_execution_platforms=//:rbe_ubuntu2004_platform,//:rbe_ubuntu2004_highcpu_platform -build:ubuntu2004 --host_platform=//:rbe_ubuntu2004_platform -build:ubuntu2004 --platforms=//:rbe_ubuntu2004_platform -build:ubuntu2004 --config=remote_shared +# Configuration to build and test Bazel on RBE on Ubuntu 20.04 +common:ubuntu2404 --extra_toolchains=@rbe_ubuntu2404//config:cc-toolchain +common:ubuntu2404 --extra_execution_platforms=//:rbe_ubuntu2404_platform,//:rbe_ubuntu2404_highcpu_platform +common:ubuntu2404 --host_platform=//:rbe_ubuntu2404_platform +common:ubuntu2404 --platforms=//:rbe_ubuntu2404_platform +common:ubuntu2404 --config=remote_shared # Alias -build:remote --config=ubuntu2004 +common:remote --config=ubuntu2404 build:macos --macos_minimum_os=10.13 diff --git a/BUILD b/BUILD index 96536fc048ab36..a9c51c7cfebcfb 100644 --- a/BUILD +++ b/BUILD @@ -289,7 +289,7 @@ platform( ], ) -REMOTE_PLATFORMS = ("rbe_ubuntu2004",) +REMOTE_PLATFORMS = ("rbe_ubuntu2404",) [ platform( diff --git a/MODULE.bazel b/MODULE.bazel index add40a64ee78b2..2ed7a5c74a3bcf 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -400,8 +400,8 @@ bazel_dep(name = "wabt", version = "1.0.37") rbe_preconfig = use_repo_rule("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig") rbe_preconfig( - name = "rbe_ubuntu2004", - toolchain = "ubuntu2004", + name = "rbe_ubuntu2404", + toolchain = "ubuntu2404", ) list_source_repository = use_repo_rule("//src/test/shell/bazel:list_source_repository.bzl", "list_source_repository") From 84f04e28638cdf7bee3dfe58eaf1d00066dc096f Mon Sep 17 00:00:00 2001 From: "Ian (Hee) Cha" Date: Wed, 20 May 2026 14:16:37 -0700 Subject: [PATCH 3/5] Update .bazelrc --- .bazelrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bazelrc b/.bazelrc index 6a59a439241ed9..3e356218b7723f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -12,6 +12,7 @@ build:remote_shared --java_runtime_version=rbe_jdk build:remote_shared --tool_java_runtime_version=rbe_jdk # Configuration to build and test Bazel on RBE on Ubuntu 20.04 +common:ubuntu2404 --extra_toolchains=@rbe_ubuntu2404//java:all common:ubuntu2404 --extra_toolchains=@rbe_ubuntu2404//config:cc-toolchain common:ubuntu2404 --extra_execution_platforms=//:rbe_ubuntu2404_platform,//:rbe_ubuntu2404_highcpu_platform common:ubuntu2404 --host_platform=//:rbe_ubuntu2404_platform From db64df82170a01a7fdf3f016b3842a121d7a88a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C3=B9d=C5=8Dng=20Y=C3=A1ng?= Date: Thu, 21 May 2026 10:26:51 -0400 Subject: [PATCH 4/5] disable more RBE tests failing on 8.x --- .bazelci/postsubmit.yml | 2 ++ .bazelci/presubmit.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index db6a315c6efc84..279cb8f60dad82 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -342,6 +342,8 @@ tasks: - "-//src/test/shell/bazel:bazel_spawnstats_test" - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - "-//src/test/shell/integration:test_test" + - "-//src/test/tools:daemonize_test" + - "-//src/test/tools:linux-sandbox_test" include_json_profile: - build - test diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index ae80faa344de61..9c75cdc676121e 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -368,6 +368,8 @@ tasks: - "-//src/test/shell/bazel:bazel_spawnstats_test" - "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_test" - "-//src/test/shell/integration:test_test" + - "-//src/test/tools:daemonize_test" + - "-//src/test/tools:linux-sandbox_test" include_json_profile: - build - test From 5d9293a8c2895f373201fba1f268100f5c0c5923 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Tue, 19 Aug 2025 12:53:02 -0700 Subject: [PATCH 5/5] Replace Ubuntu 22.04 with 24.04 in CI The order of fields in gcov's JSON output changed, which requires switching to JSON-aware matching via jq rather than a simple grep. Work towards #22553 Closes #26787. PiperOrigin-RevId: 796985639 Change-Id: I2b3feb5b5747143751127b6d69a1c295cc621773 --- .bazelci/build_bazel_binaries.yml | 5 +- .bazelci/postsubmit.yml | 2 +- .bazelci/presubmit.yml | 2 +- scripts/BUILD | 1 + src/test/shell/bazel/BUILD | 8 +- .../bazel/bazel_cc_code_coverage_test.sh | 219 ++++++++++++++++-- 6 files changed, 217 insertions(+), 20 deletions(-) diff --git a/.bazelci/build_bazel_binaries.yml b/.bazelci/build_bazel_binaries.yml index 38aaa3e77822ee..0fba1b7a810d9d 100644 --- a/.bazelci/build_bazel_binaries.yml +++ b/.bazelci/build_bazel_binaries.yml @@ -31,7 +31,10 @@ platforms: build_flags: - "-c" - "opt" - ubuntu2204: + # https://github.com/bazelbuild/continuous-integration/issues/2353 + - "--linkopt=-Wl,--no-fix-cortex-a53-843419" + - "--host_linkopt=-Wl,--no-fix-cortex-a53-843419" + ubuntu2404: build_targets: - "//src:bazel" - "//src:bazel_nojdk" diff --git a/.bazelci/postsubmit.yml b/.bazelci/postsubmit.yml index 279cb8f60dad82..08b60d14443364 100644 --- a/.bazelci/postsubmit.yml +++ b/.bazelci/postsubmit.yml @@ -56,7 +56,7 @@ tasks: include_json_profile: - build - test - ubuntu2204: + ubuntu2404: shell_commands: - rm -rf $HOME/bazeltest - mkdir $HOME/bazeltest diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 9c75cdc676121e..51b518419f2037 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -75,7 +75,7 @@ tasks: include_json_profile: - build - test - ubuntu2204: + ubuntu2404: shards: 4 shell_commands: - rm -rf $HOME/bazeltest diff --git a/scripts/BUILD b/scripts/BUILD index 2d479f531fdb38..810362da213ab1 100644 --- a/scripts/BUILD +++ b/scripts/BUILD @@ -54,6 +54,7 @@ filegroup( "@platforms//os:macos": [":jq_macos"], "@platforms//os:windows": ["@jq_windows_amd64//file"], }), + visibility = ["//src/test:__subpackages__"], ) sh_test( diff --git a/src/test/shell/bazel/BUILD b/src/test/shell/bazel/BUILD index 078c867be1ba10..aed4bd02fb52c8 100644 --- a/src/test/shell/bazel/BUILD +++ b/src/test/shell/bazel/BUILD @@ -656,7 +656,13 @@ sh_test( sh_test( name = "bazel_cc_code_coverage_test", srcs = ["bazel_cc_code_coverage_test.sh"], - data = [":test-deps"], + data = [ + ":test-deps", + "//scripts:jq", + ], + env = { + "JQ_RLOCATIONPATH": "$(rlocationpath //scripts:jq)", + }, tags = [ # C++ coverage is not supported on macOS yet. "no_macos", diff --git a/src/test/shell/bazel/bazel_cc_code_coverage_test.sh b/src/test/shell/bazel/bazel_cc_code_coverage_test.sh index 31798e6db88069..658aa456357286 100755 --- a/src/test/shell/bazel/bazel_cc_code_coverage_test.sh +++ b/src/test/shell/bazel/bazel_cc_code_coverage_test.sh @@ -23,6 +23,9 @@ source "${CURRENT_DIR}/../integration_test_setup.sh" \ source "${CURRENT_DIR}/coverage_helpers.sh" \ || { echo "coverage_helpers.sh not found!" >&2; exit 1; } +JQ="$(rlocation "$JQ_RLOCATIONPATH")" +[[ ! -x "$JQ" ]] && fail "jq not found at $JQ ($JQ_RLOCATIONPATH)" + # Check if all the tools required by CC coverage are installed. [[ -z $( which gcov ) ]] && fail "gcov not installed. Skipping test" && exit 0 [[ -z $( which g++ ) ]] && fail "g++ not installed. Skipping test" && exit 0 @@ -254,12 +257,58 @@ lcount:5,1" function assert_gcov_coverage_srcs_a_cc_json() { local output_file="${1}"; shift - # The expected coverage result for coverage_srcs/a.cc in gcov format. + local file_name="coverage_srcs/a.cc" cat > expected_gcov_result_a_cc < actual_gcov_result_a_cc + diff -u expected_gcov_result_a_cc actual_gcov_result_a_cc \ + || fail "Coverage result for $file_name in gcov format is different than expected" } @@ -270,34 +319,172 @@ local expected_gcov_result_a_cc=$(cat expected_gcov_result_a_cc | tr -d '\n') function assert_gcov_coverage_srcs_t_cc_json() { local output_file="${1}"; shift - # The expected coverage result for coverage_srcs/t.cc in gcov format. + local file_name="coverage_srcs/t.cc" cat > expected_gcov_result_t_cc < actual_gcov_result_t_cc + diff -u expected_gcov_result_t_cc actual_gcov_result_t_cc \ + || fail "Coverage result for $file_name in gcov format is different than expected" } function assert_gcov_coverage_srcs_b_h_json() { local output_file="${1}"; shift - # The expected coverage result for coverage_srcs/b.h in gcov format. + local file_name="coverage_srcs/b.h" cat > expected_gcov_result_b_h < actual_gcov_result_b_h + diff -u expected_gcov_result_b_h actual_gcov_result_b_h \ + || fail "Coverage result for $file_name in gcov format is different than expected" } function assert_gcov_coverage_srcs_d_a_cc_json() { local output_file="${1}"; shift - # The expected coverage result for coverage_srcs/different/a.cc in gcov format. + local file_name="coverage_srcs/different/a.cc" cat > expected_gcov_result_d_a_cc < actual_gcov_result_d_a_cc + diff -u expected_gcov_result_d_a_cc actual_gcov_result_d_a_cc \ + || fail "Coverage result for $file_name in gcov format is different than expected" } function test_cc_test_coverage_gcov() {