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

Py3_image no matching toolchains for types @bazel_tools//tools/cpp:toolchain_type #1935

Closed
GeorgeEngland opened this issue Oct 7, 2021 · 9 comments
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not

Comments

@GeorgeEngland
Copy link

🐞 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

@GeorgeEngland
Copy link
Author

Our toolchain also uses gcc rather than clang

@GeorgeEngland
Copy link
Author

Temporary fix:
Removed --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 from .bazelrc

@kriswuollett
Copy link

kriswuollett commented Nov 19, 2021

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/ python and python3 installed
  • Bazelisk w/ 4.2.1 in .bazeliskrc
  • rules_python-0.5.0 w/ pip_parse for dependencies and py3_image
  • rules_docker-v0.21.0

@kriswuollett
Copy link

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.

@esirK
Copy link

esirK commented Mar 11, 2022

Facing the same issue on Bazel 5.0.0

@jensenkairos
Copy link

jensenkairos commented Jun 30, 2022

Had the same issue on Bazel 5.2.0 and solve it by adding --@io_bazel_rules_docker//transitions:enable=false to the command

@abhillman
Copy link

Related bazelbuild/bazel#10134

@github-actions
Copy link

github-actions bot commented Apr 7, 2023

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 Apr 7, 2023
@github-actions
Copy link

github-actions bot commented May 7, 2023

This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"

@github-actions github-actions bot closed this as completed May 7, 2023
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

5 participants