rules_docker icon indicating copy to clipboard operation
rules_docker copied to clipboard

rules_docker fails to build with HEAD bazel

Open katre opened this issue 2 years ago • 1 comments

In https://github.com/bazelbuild/bazel/commit/87fb4620c6edd0e525d4621ecdca4bd47d69484c, I changed Bazel's platform rule to be non-configurable: this is a core goal of the Platforms API, since the target platform is part of the configuration, and in some changes appearing in the near future allowing the platform to change based on the configuration will lead to a conceptual dependency cycle (as opposed to a bazel target dependency cycle, or a Java class dependency cycle, this is a semantic issue and not syntactic).

Unfortunately, the //platforms:image_transition target in rules_docker is using configuration in the definition, specifically due to the use of a label_setting target, which I think is acting as an alias for the actual target CPU and OS constraints. This is leading to several failures in other projects which depend on rules_docker (see https://github.com/bazelbuild/bazel-buildfarm/issues/1446 and https://github.com/buchgr/bazel-remote/issues/700 for examples).

The immediate workaround is probably for projects to use the --@io_bazel_rules_docker//transitions:enable=false flag to disable the transition which sets //platforms:image_transition as the target platform, although that's a bit heavy-handed.

I have re-read PR #1963, which adds this behavior, and it looks like this exists to support the architecture attribute on image rules. In this case, the correct long-term fix is to integrate the change_platform transition from Standard Platform Transitions, which we are busy implementing currently and should be available shortly.

katre avatar Sep 21 '23 19:09 katre

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. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

github-actions[bot] avatar Dec 10 '24 02:12 github-actions[bot]