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

Bazel CI: Downstream projects broken due to the change to StarlarkToolchainContext #13320

Closed
coeuvre opened this issue Apr 9, 2021 · 8 comments
Assignees

Comments

@coeuvre
Copy link
Member

coeuvre commented Apr 9, 2021

https://buildkite.com/bazel/bazel-auto-sheriff-face-with-cowboy-hat/builds/486

Caused by 627c16e.

rules_docker:

(04:11:03) ERROR: /private/var/tmp/_bazel_buildkite/d16edac135ada185adb868f6f07ba938/external/io_bazel_rules_scala_scala_compiler/BUILD:9:13: in @io_bazel_rules_scala//scala/private:coverage_replacements_provider.bzl%_aspect aspect on scala_import rule @io_bazel_rules_scala_scala_compiler//:io_bazel_rules_scala_scala_compiler:
--
  | Traceback (most recent call last):
  | File "/private/var/tmp/_bazel_buildkite/d16edac135ada185adb868f6f07ba938/external/io_bazel_rules_scala/scala/private/coverage_replacements_provider.bzl", line 62, column 42, in _aspect_impl
  | if JavaInfo in target and _is_enabled(ctx):
  | File "/private/var/tmp/_bazel_buildkite/d16edac135ada185adb868f6f07ba938/external/io_bazel_rules_scala/scala/private/coverage_replacements_provider.bzl", line 74, column 58, in _is_enabled
  | if "@io_bazel_rules_scala//scala:toolchain_type" not in ctx.toolchains:
  | Error: unsupported binary operation: string in ToolchainContext

rules_go:

(02:14:39) ERROR: /var/lib/buildkite-agent/builds/bk-docker-6srk/bazel-downstream-projects/rules_go/BUILD.bazel:88:17: in cgo_context_data rule //:cgo_context_data:
--
  | Traceback (most recent call last):
  | File "/var/lib/buildkite-agent/builds/bk-docker-6srk/bazel-downstream-projects/rules_go/go/private/context.bzl", line 549, column 38, in _cgo_context_data_impl
  | cc_toolchain = find_cpp_toolchain(ctx)
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/8b9e23cec74ccc4b522bce6ef631e745/external/bazel_tools/tools/cpp/toolchain_utils.bzl", line 39, column 57, in find_cpp_toolchain
  | if not "@bazel_tools//tools/cpp:toolchain_type" in ctx.toolchains:
  | Error: unsupported binary operation: string in ToolchainContext

rules_jvm_external:

(04:04:46) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/7060d67b7b3bc162c9acc2e7c1b4e17b/external/io_bazel_rules_scala_scala_reflect/BUILD:9:13: in @io_bazel_rules_scala//scala/private:coverage_replacements_provider.bzl%_aspect aspect on scala_import rule @io_bazel_rules_scala_scala_reflect//:io_bazel_rules_scala_scala_reflect:
--
  | Traceback (most recent call last):
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/7060d67b7b3bc162c9acc2e7c1b4e17b/external/io_bazel_rules_scala/scala/private/coverage_replacements_provider.bzl", line 62, column 42, in _aspect_impl
  | if JavaInfo in target and _is_enabled(ctx):
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/7060d67b7b3bc162c9acc2e7c1b4e17b/external/io_bazel_rules_scala/scala/private/coverage_replacements_provider.bzl", line 74, column 58, in _is_enabled
  | if "@io_bazel_rules_scala//scala:toolchain_type" not in ctx.toolchains:
  | Error: unsupported binary operation: string in ToolchainContext

rules_webtesting:

(04:05:05) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/8751c39c61e07acb8385d1122d0f1656/external/io_bazel_rules_scala_scala_reflect/BUILD:9:13: in @io_bazel_rules_scala//scala/private:coverage_replacements_provider.bzl%_aspect aspect on scala_import rule @io_bazel_rules_scala_scala_reflect//:io_bazel_rules_scala_scala_reflect:
--
  | Traceback (most recent call last):
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/8751c39c61e07acb8385d1122d0f1656/external/io_bazel_rules_scala/scala/private/coverage_replacements_provider.bzl", line 62, column 42, in _aspect_impl
  | if JavaInfo in target and _is_enabled(ctx):
  | File "/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/8751c39c61e07acb8385d1122d0f1656/external/io_bazel_rules_scala/scala/private/coverage_replacements_provider.bzl", line 74, column 58, in _is_enabled
  | if "@io_bazel_rules_scala//scala:toolchain_type" not in ctx.toolchains:
  | Error: unsupported binary operation: string in ToolchainContext
@coeuvre
Copy link
Member Author

coeuvre commented Apr 9, 2021

cc @katre

@katre
Copy link
Member

katre commented Apr 9, 2021

Huh, that wasn't supposed to have a change in behavior. @brandjon, can you see where I went wrong?

I'll investigate and fix this. @coeuvre, do you prefer a rollback, or can I investigate and fix?

@coeuvre
Copy link
Member Author

coeuvre commented Apr 12, 2021

Thanks for the quick fix!

@fweikert
Copy link
Member

Bazel auto-sheriff is convinced that the culprit here also caused this very different error: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1990#284aa31e-ee16-447a-af9f-7a30606fc5a5

@fweikert fweikert reopened this Apr 12, 2021
@fweikert fweikert assigned fweikert and katre and unassigned fweikert Apr 12, 2021
@katre
Copy link
Member

katre commented Apr 12, 2021

There shouldn't be any behavior changes (after b120d4f), but I will investigate.

@fweikert
Copy link
Member

I wonder whether ebac27e is the actual culprit, based on the commit message.

@katre
Copy link
Member

katre commented Apr 12, 2021

I can reproduce the error with bazel at head, and it goes away when I run with --notrim_test_configuration, so that seems more likely.

@fweikert
Copy link
Member

John, thanks for testing! I discovered another GitHub issue that I hadn't noticed before. Sorry for the noise.

katre added a commit to katre/bazel that referenced this issue Jul 13, 2021
Fixes bazelbuild#13320.

PiperOrigin-RevId: 367624002
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

3 participants