treewide: replace go_binary_with_tag
Instead of using go_binary_with_tag, we can write a go_binary rule which
embeds the library. Then we can easily change all the Go configs, not
just tags.
By default, Gazelle generates the libraries for a go_binary with private
visibility, so we need to override it to pulic. The go_binary_with_tag
rule had the additional feature of combining the specified tags with the
incoming ones (osusergo, netgo); instead I added those manually.
Change-Id: I23965176f87e3a0bbd18ba5a72f190e4f9047363
Reviewed-on: https://review.monogon.dev/c/monogon/+/4157
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/build/sqlc/BUILD.bazel b/build/sqlc/BUILD.bazel
index 63fd6ff..22fbb6a 100644
--- a/build/sqlc/BUILD.bazel
+++ b/build/sqlc/BUILD.bazel
@@ -1,7 +1,12 @@
-load("//build/go:def.bzl", "go_binary_with_tag")
+load("@io_bazel_rules_go//go:def.bzl", "go_binary")
-go_binary_with_tag(
+# keep
+go_binary(
name = "sqlc",
- binary = "@com_github_sqlc_dev_sqlc//cmd/sqlc",
- gotags = ["nowasm"],
+ embed = ["@com_github_sqlc_dev_sqlc//cmd/sqlc:sqlc_lib"],
+ gotags = [
+ "osusergo",
+ "netgo",
+ "nowasm",
+ ],
)