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

rules_docker fails to build with HEAD bazel #2275

Open
katre opened this issue Sep 21, 2023 · 1 comment
Open

rules_docker fails to build with HEAD bazel #2275

katre opened this issue Sep 21, 2023 · 1 comment
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not

Comments

@katre
Copy link
Member

katre commented Sep 21, 2023

In bazelbuild/bazel@87fb462, 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 buildfarm/buildfarm#1446 and buchgr/bazel-remote#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.

Copy link

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 github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not
Projects
None yet
Development

No branches or pull requests

1 participant