如何检查 @local_config_platform//:host?

huangapple go评论46阅读模式
英文:

How to inspect @local_config_platform//:host?

问题

我遇到了一些工具链问题,出现了如下错误:

INFO: ToolchainResolution:     Type @io_bazel_rules_go//go:toolchain: target platform @local_config_platform//:host: Rejected toolchain @go_sdk//:go_linux_amd64-impl; mismatching values: linux, x86_64
INFO: ToolchainResolution:   Type @io_bazel_rules_go//go:toolchain: target platform @local_config_platform//:host: No toolchains found.

但我相信我是在 x86_64 和 Linux 上运行,但通过检查生成的约束条件应该会明确。

这在先前提到过,但我无法找到生成的文件。

以防对其他人有所帮助,我正在运行 popos。

谢谢!

英文:

I'm running into some toolchain issues, with errors like:

INFO: ToolchainResolution:     Type @io_bazel_rules_go//go:toolchain: target platform @local_config_platform//:host: Rejected toolchain @go_sdk//:go_linux_amd64-impl; mismatching values: linux, x86_64
INFO: ToolchainResolution:   Type @io_bazel_rules_go//go:toolchain: target platform @local_config_platform//:host: No toolchains found.

but I believe I am running on x86_64 and Linux, but that would be made clear by inspecting the generated constraints.

This was mentioned earlier, but I was unable to find said-generated file.

And in case it ever helps anyone else, I'm running popos.

Thanks!

答案1

得分: 3

Use query --output=build to dump the rule:

$ bazel query --output=build @local_config_platform//:host
# /home/user/.cache/_bazel_cache/bf5544946d234767647dbf413a7bc3c9/external/local_config_platform/BUILD.bazel:4:9
platform(
  name = "host",
  constraint_values = ["@platforms//cpu:x86_64", "@platforms//os:linux"],
)

The comment line even tells you were to find the original generated BUILD file.

英文:

Use query --output=build to dump the rule:

$ bazel query --output=build @local_config_platform//:host
# /home/user/.cache/_bazel_cache/bf5544946d234767647dbf413a7bc3c9/external/local_config_platform/BUILD.bazel:4:9
platform(
  name = "host",
  constraint_values = ["@platforms//cpu:x86_64", "@platforms//os:linux"],
)

The comment line even tells you were to find the original generated BUILD file.

huangapple
  • 本文由 发表于 2023年2月10日 12:17:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75406895.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定