-
Notifications
You must be signed in to change notification settings - Fork 691
Bazel CI: rules_docker still failing with Bazel@HEAD #1988
Comments
/cc @brandjon Can you help advise how to fix this? |
FYI @uhthomas |
@brandjon ping, do you have any idea what's happening here? |
Since bazelbuild/bazel@98d376f is in Bazel 5.0, this means rules_docker has to fix this issue to be able to work with the next Bazel release. |
I've taken a quick look. ❯ git switch -d 76c708fc979c1bfb65b4db300c654be08f096874
❯ USE_BAZEL_VERSION=98d376faeb206f14838156ce4cb305ddbfce08fa bazel test //... --toolchain_resolution_debug
...
INFO: ToolchainResolution: Type //toolchains/docker:toolchain_type: target platform @io_bazel_rules_docker//platforms:image_transition: Rejected toolchain @docker_config//:toolchain; mismatching values: linux
INFO: ToolchainResolution: Type //toolchains/docker:toolchain_type: target platform @io_bazel_rules_docker//platforms:image_transition: Rejected toolchain @docker_config//:toolchain; mismatching values: windows
...
INFO: ToolchainResolution: Type //toolchains/docker:toolchain_type: target platform @io_bazel_rules_docker//platforms:image_transition: Rejected toolchain @docker_config//:toolchain; mismatching values: osx
...
INFO: ToolchainResolution: Type //toolchains/docker:toolchain_type: target platform @io_bazel_rules_docker//platforms:image_transition: No toolchains found. I'll take a deeper look later today to understand what's happening. |
I'm confused. The linked commit (bazelbuild/bazel@98d376f) is from January 2021, over a year ago. Has it only recently been merged? If not, what has now caused this problem? Whilst debugging I found that unrelated, seemingly random, targets and tests fail. For example: ERROR: /home/thomas/code/github.com/uhthomas/rules_docker/tests/contrib/BUILD:137:17: in container_bundle_ rule //tests/contrib:create_empty_bundle:
Traceback (most recent call last):
File "/home/thomas/code/github.com/uhthomas/rules_docker/container/bundle.bzl", line 67, column 15, in _container_bundle_impl
_incr_load(
File "/home/thomas/code/github.com/uhthomas/rules_docker/container/layer_tools.bzl", line 232, column 28, in incremental_load
run_tag = images.keys()[0]
Error: index out of range (index is 0, but sequence has 0 elements)
ERROR: Analysis of target '//tests/contrib:create_empty_bundle' failed; build aborted: Analysis of target '//tests/contrib:create_empty_bundle' failed In regard to Docker toolchain resolution, I believe the I suspect that we should make a patch to disable transitioning by default as it appears that Bazel just isn't ready for it. |
Yes, the commit is very old, but not included in Bazel 4.x release (our first LTS release). 5.0 is coming out very soon and will contain this change. rules_docker is broken by this commit with Bazel@HEAD for a long time, but it's only reported here recently. /cc @katre @gregestren Can you help with this issue? |
Do you have a simplest build that demonstrates the failure, aside from shown above? A quick look tells me if bazelbuild/bazel@98d376f is causing this it'd have to be some combination of a Starlark transition being applied and a user-defined build flag that might not be defined in the same repo as where the build is happening. Do the failures involve any flags? The next step I'd try to diagnose is to run a But happy to work with you to diagnose better. |
@uhthomas Are the other errors caused by the same issue? I'm seeing the same error with bazel 4.2.2:
Would I expect that to work? (I'm trying to replicate the CI command from https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2290#7782e19b-d082-4fa0-9ca6-ba4c6413740b but haven't yet gotten docker properly set up on my machine to work with any version) |
@gregestren To reproduce:
If you set USE_BAZEL_VERSION to bazelbuild/bazel@98d376f 's parent commit, it works:
|
Thanks @meteorcloudy. I'm wondering if we need to do more than
from #1988 (comment)? Or at least if the remaining problems are caused by the same code? |
Is this related? It seems to be the same error message. |
The symptom is similar, but I'm not sure about the root cause. |
I haven't heard loud complaint yet, but I think this issue is preventing users to use rules_docker from Bazel 5.0 |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?" |
Should this be reopened? |
/reopen |
https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2290#7782e19b-d082-4fa0-9ca6-ba4c6413740b
A bisect shows the breaking change is: bazelbuild/bazel@98d376f
I suspect it has something to do with how platform transition is defined here:
rules_docker/platforms/BUILD
Lines 60 to 84 in 4c6d61c
The text was updated successfully, but these errors were encountered: