bazelbuild / bazelbuild/rules_docker
rules_docker fails to build with HEAD bazel
- Dominant language
- Starlark
- Stars
- 1.1k
- Forks
- 689
- PR merge metrics
- No merged PRs in 30d
Description
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`](https://github.com/bazelbuild/rules_docker/blob/8e70c6bcb584a15a8fd061ea489b933c0ff344ca/platforms/BUILD#L79) 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](https://github.com/bazelbuild/rules_docker/pull/1963), 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](https://github.com/bazelbuild/proposals/blob/main/designs/2023-06-08-standard-platform-transitions.md), which we are busy implementing currently and should be available shortly.
Contributor guide
Assessment
This issue has not been assessed yet.