rules_docker
                                
                                 rules_docker copied to clipboard
                                
                                    rules_docker copied to clipboard
                            
                            
                            
                        Py3_image no matching toolchains for types @bazel_tools//tools/cpp:toolchain_type
🐞 bug report
Affected Rule
The issue is caused by the rule: py3_image
Description
I can build a basic py_binary. But when building the py3_image we get:
🔬 Minimal Reproduction
Use default RBE 16-04 config and build a py3_image
🔥 Exception or Error
INFO: Invocation ID: a1d17661-a555-4223-a240-9dc43240e075
INFO: ToolchainResolution: Removed execution platform //configs/config:platform from available execution platforms, it is missing constraint @io_bazel_rules_docker//platforms:run_in_container
INFO: ToolchainResolution: Removed execution platform @local_config_platform//:host from available execution platforms, it is missing constraint @io_bazel_rules_docker//platforms:run_in_container
INFO: ToolchainResolution: Removed execution platform //configs/config:platform from available execution platforms, it is missing constraint @io_bazel_rules_docker//platforms:run_in_container
INFO: ToolchainResolution: Target platform //configs/config:platform: Selected execution platform //configs/config:platform,
INFO: ToolchainResolution: Removed execution platform //configs/config:platform from available execution platforms, it is missing constraint @io_bazel_rules_docker//platforms:run_in_container
INFO: ToolchainResolution: Removed execution platform @local_config_platform//:host from available execution platforms, it is missing constraint @io_bazel_rules_docker//platforms:run_in_container
INFO: ToolchainResolution: Removed execution platform //configs/config:platform from available execution platforms, it is missing constraint @io_bazel_rules_docker//platforms:run_in_container
ERROR: While resolving toolchains for target XXXX:py_image.binary: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
Operating System: Ubuntu container (remote), ubuntu container local
Our toolchain also uses gcc rather than clang
Temporary fix: Removed --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 from .bazelrc
I've encountered the same issue while attempting to use Bazel again; however, I'm not even using a .bazelrc with options like BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN in the setup described by @GeorgeEngland. I've created a repo that makes the issue easily reproducible with Docker.
Perhaps these tool versions are not compatible? Any recommendations for a version combo that currently works? Or is there something else wrong in the example repo that causes this issue?
- Ubuntu 20.04 w/ pythonandpython3installed
- Bazelisk w/ 4.2.1in.bazeliskrc
- rules_python-0.5.0w/- pip_parsefor dependencies and- py3_image
- rules_docker-v0.21.0
Resolved my instance of this issue by noticing I was missing the following in my WORKSPACE:
load("@io_bazel_rules_docker//python3:image.bzl", _py_image_repos = "repositories")
_py_image_repos()
I've updated my example repo to show the working example.
Facing the same issue on Bazel 5.0.0
Had the same issue on Bazel 5.2.0 and solve it by adding --@io_bazel_rules_docker//transitions:enable=false to the command
Related https://github.com/bazelbuild/bazel/issues/10134
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!
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"