我试图在目标上使用平台约束:
cc_test(
name = "library_test",
srcs = ["library_test.cc"],
deps = [":library"],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux"
]
)但我发现了一个错误:
Dependency chain:
//platforms:library_test (1f7c4b) <-- target platform (@local_config_platform//:host) didn't satisfy constraints [@platforms//cpu:x86_64, @platforms//os:linux]我觉得很困惑,因为这应该是对的。如何打印@local_config_platform//:host中的值?
我确实打开了--incompatible_enable_cc_toolchain_resolution标志。
发布于 2022-11-01 20:13:47
您可以在bazel-out/../../../external/local_config_platform/constraints.bzl (相对于您的Bazel工作区)中找到这一点。
类似的路径也适用于任何其他外部存储库(@something在bazel-out/../../../external/something中)。储存库规则通过各种机制创建这些文件夹,能够查看结果对于调试非常有帮助。
https://stackoverflow.com/questions/74240658
复制相似问题