Open
Description
Platform: Windows 11 x64
I cannot get cgo to work, and this is one of the ways I tried that is not being respected.
Reproduction steps
Add the following to BUILD.bazel
:
platform(
name = "x64_windows-clang-cl",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
"@rules_go//go/toolchain:cgo_on",
],
)
Run bazel with --platforms=//tools:x64_windows-clang-cl --host_platform=//tools:x64_windows-clang-cl
and compile a cgo rule with -s
.
Expected behaviour
Either the rule is compiled with CGO_ENABLED=1
, or an error occurs because the toolchain is not compatible with the cgo_on
constraint.
Actual behaviour
The rule is compiled with CGO_ENABLED=0
What should happen
Either the cgo_on
constraint should only be supported by toolchains that actually support cgo, or it should be removed.
Metadata
Metadata
Assignees
Labels
No labels