bazelbuild / rules_testing

Starlark testing framework and utility libraries
https://rules-testing.readthedocs.io/
Apache License 2.0
22 stars 5 forks source link

[Bazel CI] Error no such target '@@rules_java//toolchains:bootstrap_runtime_toolchain_type': target 'bootstrap_runtime_toolchain_type' not declared in package 'toolchains' defined #106

Closed sgowroji closed 4 weeks ago

sgowroji commented 1 month ago

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4128#0191f902-6d77-40a5-a959-8804174bbd09

Platform: MacOS

Logs:

ERROR: /private/var/tmp/_bazel_buildkite/70589703ab43ea5d9fd68734d4a21119/external/rules_java/toolchains/BUILD: no such target '@@rules_java//toolchains:bootstrap_runtime_toolchain_type': target 'bootstrap_runtime_toolchain_type' not declared in package 'toolchains' defined by /private/var/tmp/_bazel_buildkite/70589703ab43ea5d9fd68734d4a21119/external/rules_java/toolchains/BUILD
ERROR: /private/var/tmp/_bazel_buildkite/70589703ab43ea5d9fd68734d4a21119/external/remote_jdk8_linux_aarch64_toolchain_config_repo/BUILD.bazel:27:10: no such target '@@rules_java//toolchains:bootstrap_runtime_toolchain_type': target 'bootstrap_runtime_toolchain_type' not declared in package 'toolchains' defined by /private/var/tmp/_bazel_buildkite/70589703ab43ea5d9fd68734d4a21119/external/rules_java/toolchains/BUILD and referenced by '@@remote_jdk8_linux_aarch64_toolchain_config_repo//:bootstrap_runtime_toolchain'
ERROR: /private/var/tmp/_bazel_buildkite/70589703ab43ea5d9fd68734d4a21119/external/io_bazel_stardoc/src/main/java/com/google/devtools/build/skydoc/renderer/BUILD:17:12: Analysis failed
ERROR: Analysis of target '//docgen:docs_build_test' failed; build aborted: Analysis failed
ERROR: Build did NOT complete successfully

Culprit:

Steps:

 git clone https://github.com/bazelbuild/rules_testing
git reset caa0cb0d8fcf1fe9417e231e922610f300e20efa  --hard
export USE_BAZEL_VERSION=7b8d07253adf84d5e3d46ac915a1440e518fab3c
bazel build ... 

CC Greenteam @comius

sgowroji commented 1 month ago

Error logs on Windows :  

(04:20:37) ERROR: Skipping '//...': error loading package under directory '': error loading package 'testdata': at C:/b/bk-windows-3cjv/bazel-org-repo-root/rules_webtesting/web/web.bzl:45:6: Unable to find package for @@[unknown repo 'bazel_skylib' requested from @@]//lib:types.bzl: The repository '@@[unknown repo 'bazel_skylib' requested from @@]' could not be resolved: No repository visible as '@bazel_skylib' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration..
(04:20:37) ERROR: error loading package under directory '': error loading package 'testdata': at C:/b/bk-windows-3cjv/bazel-org-repo-root/rules_webtesting/web/web.bzl:45:6: Unable to find package for @@[unknown repo 'bazel_skylib' requested from @@]//lib:types.bzl: The repository '@@[unknown repo 'bazel_skylib' requested from @@]' could not be resolved: No repository visible as '@bazel_skylib' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration..
(04:20:37) INFO: Elapsed time: 1.061s
(04:20:37) INFO: 0 processes.
(04:20:37) ERROR: Build did NOT complete successfully

Error logs on MacOS:

(06:02:40) ERROR: Skipping '//...': error loading package under directory '': error loading package 'go/wtl/service/sauce': Unable to find package for @@[unknown repo 'io_bazel_rules_go' requested from @@]//go:def.bzl: The repository '@@[unknown repo 'io_bazel_rules_go' requested from @@]' could not be resolved: No repository visible as '@io_bazel_rules_go' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration..
(06:02:40) ERROR: error loading package under directory '': error loading package 'go/wtl/service/sauce': Unable to find package for @@[unknown repo 'io_bazel_rules_go' requested from @@]//go:def.bzl: The repository '@@[unknown repo 'io_bazel_rules_go' requested from @@]' could not be resolved: No repository visible as '@io_bazel_rules_go' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration..
(06:02:40) INFO: Elapsed time: 4.078s
(06:02:40) INFO: 0 processes.
(06:02:40) ERROR: Build did NOT complete successfully
rickeylev commented 4 weeks ago

repro note: requires workspace. USE_BAZEL_VERSION=last_green bazel build ... --enable_bzlmod=false --enable_workspace=true

rickeylev commented 4 weeks ago

Figured out the issue: https://github.com/bazelbuild/rules_java/issues/128

We just need to update the rules_java used for workspace. bzlmod automatically picked up 7.11.1. Workspace was using something much earlier (5-something I think I saw).

rickeylev commented 4 weeks ago

Well, upgrading the java version fixes part of it, but now there are errors about finding toolchains. (this is all with bazel@head). I guess that's a separate issue, though.