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

No matching toolchains with experimental_repository_resolved_file #8523

Closed
keith opened this issue May 30, 2019 · 6 comments
Closed

No matching toolchains with experimental_repository_resolved_file #8523

keith opened this issue May 30, 2019 · 6 comments
Assignees
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Comments

@keith
Copy link
Member

keith commented May 30, 2019

Description of the problem / feature request:

When using the experimental_repository_resolved_file family of flags as recommended by this post, when using rules_go you end up with this error upon building:

ERROR: While resolving toolchains for target //lang:go_default_library: no matching toolchains found for types @io_bazel_rules_go//go:toolchain
ERROR: Analysis of target '//lang:go_default_library' failed; build aborted: no matching toolchains found for types @io_bazel_rules_go//go:toolchain

Note: this is an easy repro case with go, but I've also seen this with other toolchains:

ERROR: While resolving toolchains for target //tools/storyboarder:storyboarder: no matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  • Clone https://github.com/bazelbuild/buildtools
  • Run bazel sync --experimental_repository_resolved_file=resolved.bzl
  • Run bazel build --experimental_resolved_file_instead_of_workspace=resolved.bzl --experimental_repository_hash_file=resolved.bzl --experimental_verify_repository_rules=@bazel_tools//tools/build_defs/repo:git.bzl%git_repository --experimental_verify_repository_rules=@bazel_tools//tools/build_defs/repo:http.bzl%http_archive //...

(or add these flags to a .bazelrc)

What operating system are you running Bazel on?

macOS

What's the output of bazel info release?

release 0.26.0

Have you found anything relevant by searching the web?

No, I also can't really tell what the state of these flags is

@aiuto aiuto added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. team-Rules-CPP Issues for C++ rules untriaged team-Configurability platforms, toolchains, cquery, select(), config transitions and removed team-Rules-CPP Issues for C++ rules labels May 31, 2019
@aiuto
Copy link
Contributor

aiuto commented May 31, 2019

Given to both configurability (because toolchains) and ExternalDeps. I am not sure where the boundary is.

@katre
Copy link
Member

katre commented Jun 3, 2019

This looks suspiciously similar to #7773, but I don't know what the --experimental_repository_resolved_file option is trying to do.

I suspect @aehlig may need to investigate this.

@aehlig
Copy link
Contributor

aehlig commented Jun 5, 2019

I suspect @aehlig may need to investigate this.

tl;dr: fixed upstream

The longer story is the following. The repository resolved file was once faithfully representing the semantics of the of the WORKSPACE file as a flat value. But then, the tool chains were introduced as a new concept but not added to the resolved file. It took me a while to realize that, and once I did, I fixed it in 384fc0b. That commit didn't make it into 0.26, but will be in 0.27 (as the resolved file still is officially "experimental", that commit didn't justify a cherry-pick or a patch release).

@katre
Copy link
Member

katre commented Jun 5, 2019

Thank you! Is there a separate commit adding support for register_execution_platforms?

@aehlig
Copy link
Contributor

aehlig commented Jun 6, 2019

Thank you! Is there a separate commit adding support for register_execution_platforms?

Is that another feature added to WORKSAPCE files? Then I guess I'll have to add that to the resolved file as well.

@aehlig
Copy link
Contributor

aehlig commented Jun 6, 2019

Pending for review: https://bazel-review.googlesource.com/c/bazel/+/102230

@katre katre removed team-Configurability platforms, toolchains, cquery, select(), config transitions untriaged labels Jun 6, 2019
irengrig pushed a commit to irengrig/bazel that referenced this issue Jun 18, 2019
The concept of execution platforms was introduced after the introduction
of the workspace resolved file. However, when it was added, no addition
was made to the resolved file to contain that information as well. Do so
now, to ensure the resolved file still can be used as a full replacement
for the workspace file.

Fixes bazelbuild#8523

Change-Id: I3e31845084393d13bc917071bc458ea8a78a4336
PiperOrigin-RevId: 252016507
irengrig pushed a commit to irengrig/bazel that referenced this issue Jul 15, 2019
The concept of execution platforms was introduced after the introduction
of the workspace resolved file. However, when it was added, no addition
was made to the resolved file to contain that information as well. Do so
now, to ensure the resolved file still can be used as a full replacement
for the workspace file.

Fixes bazelbuild#8523

Change-Id: I3e31845084393d13bc917071bc458ea8a78a4336
PiperOrigin-RevId: 252016507
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

No branches or pull requests

5 participants