英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论