Skip to content

Commit 3a61a2d

Browse files
fmeumalexeagle
authored andcommitted
Disable CGo (#17)
1 parent 5ac1ad7 commit 3a61a2d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Diff for: .bazelrc

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ common --action_env=RULES_PYTHON_ENABLE_PYSTAR=0
1414
# https://bazelbuild.slack.com/archives/C014RARENH0/p1691158021917459?thread_ts=1691156601.420349&cid=C014RARENH0
1515
common --check_direct_dependencies=off
1616

17+
# Force rules_go to disable CGO even though we have a (fake) C++ toolchain registered.
18+
common --host_platform=//:no_cgo_host_platform
19+
1720
# Load any settings specific to the current user.
1821
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
1922
# This needs to be last statement in this

Diff for: BUILD.bazel

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")
2+
3+
platform(
4+
name = "no_cgo_host_platform",
5+
constraint_values = HOST_CONSTRAINTS + [
6+
"@rules_go//go/toolchain:cgo_off",
7+
],
8+
)

Diff for: MODULE.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module(
99
bazel_dep(name = "bazel_features", version = "1.9.0")
1010
bazel_dep(name = "bazel_skylib", version = "1.4.1")
1111
bazel_dep(name = "rules_proto", version = "6.0.0")
12-
bazel_dep(name = "platforms", version = "0.0.8")
12+
bazel_dep(name = "platforms", version = "0.0.10")
1313

1414
protoc = use_extension("//protoc:extensions.bzl", "protoc")
1515
protoc.toolchain(

0 commit comments

Comments
 (0)