Skip to content

Commit

Permalink
Always enable cgo in builds made with bazel
Browse files Browse the repository at this point in the history
This might make cross compiling a bit more difficult, but it is less
surprising when you know cgo will be enabled if it builds.

Background in buchgr#655.
  • Loading branch information
mostynb committed May 7, 2023
1 parent 983ed20 commit 9a55f82
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ go_binary(
name = "bazel-remote",
embed = [":go_default_library"],
pure = "off",
cgo = True,
static = "off",
visibility = ["//visibility:public"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
Expand All @@ -59,6 +60,7 @@ go_binary(
goarch = "amd64",
goos = "linux",
pure = "off",
cgo = True,
static = "off",
visibility = ["//visibility:public"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
Expand All @@ -69,7 +71,8 @@ go_binary(
embed = [":go_default_library"],
goarch = "arm64",
goos = "linux",
pure = "on",
pure = "off",
cgo = True,
static = "on",
visibility = ["//visibility:public"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
Expand All @@ -80,7 +83,8 @@ go_binary(
embed = [":go_default_library"],
goarch = "amd64",
goos = "darwin",
pure = "on",
pure = "off",
cgo = True,
static = "on",
visibility = ["//visibility:public"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
Expand All @@ -91,7 +95,8 @@ go_binary(
embed = [":go_default_library"],
goarch = "arm64",
goos = "darwin",
pure = "on",
pure = "off",
cgo = True,
static = "on",
visibility = ["//visibility:public"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
Expand All @@ -107,6 +112,7 @@ go_image(
goarch = "amd64",
goos = "linux",
pure = "off",
cgo = True,
static = "on",
visibility = ["//visibility:private"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
Expand All @@ -119,6 +125,7 @@ go_image(
goarch = "arm64",
goos = "linux",
pure = "off",
cgo = True,
static = "on",
visibility = ["//visibility:private"],
x_defs = {"main.gitCommit": "{STABLE_GIT_COMMIT}"},
Expand Down

0 comments on commit 9a55f82

Please sign in to comment.