Extract go_merge into its own package

This change is needed to support building gvisor for Fuchsia, which uses
Chromium's GN build system; at the time of writing, Fuchsia's Go support
does not include explicit enumeration of files, assuming instead that Go
binaries are always built from all Go source files in a given package.
Rather than extending Fuchsia's Go support, it is easier simply to
extract a separate package here.

PiperOrigin-RevId: 227133402
Change-Id: I1c64fff286d9c014b4bd1183b76023b35b60c720
This commit is contained in:
Tamir Duberstein
2018-12-28 07:26:18 -08:00
committed by Shentubot
parent 46e6577014
commit a3217b7172
4 changed files with 10 additions and 9 deletions
-8
View File
@@ -13,14 +13,6 @@ go_binary(
deps = ["//tools/go_generics/globals"],
)
go_binary(
name = "go_merge",
srcs = [
"merge.go",
],
visibility = ["//visibility:public"],
)
genrule(
name = "go_generics_tests",
srcs = glob(["generics_tests/**"]) + [":go_generics"],
+1 -1
View File
@@ -48,7 +48,7 @@ go_template = rule(
"opt_types": attr.string_list(),
"consts": attr.string_list(),
"opt_consts": attr.string_list(),
"_tool": attr.label(executable = True, cfg = "host", default = Label("//tools/go_generics:go_merge")),
"_tool": attr.label(executable = True, cfg = "host", default = Label("//tools/go_generics/go_merge")),
},
outputs = {
"out": "%{name}_template.go",
+9
View File
@@ -0,0 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
package(licenses = ["notice"]) # Apache 2.0
go_binary(
name = "go_merge",
srcs = ["main.go"],
visibility = ["//visibility:public"],
)