third_party: move go patches into their own folder
Change-Id: I7e2f2790e233aaf13cfd6ed2ffcf5544461a4f39
Reviewed-on: https://review.monogon.dev/c/monogon/+/3822
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/MODULE.bazel b/MODULE.bazel
index 474186f..31c8480 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -14,7 +14,7 @@
module_name = "rules_go",
patch_strip = 1,
patches = [
- "//third_party/go/patches:rules_go_absolute_embedsrc.patch",
+ "//third_party/rules_go:rules_go_absolute_embedsrc.patch",
],
version = "0.52.0",
)
diff --git a/build/bazel/go.MODULE.bazel b/build/bazel/go.MODULE.bazel
index e7f0da3..d657b60 100644
--- a/build/bazel/go.MODULE.bazel
+++ b/build/bazel/go.MODULE.bazel
@@ -140,7 +140,7 @@
"gazelle:proto file",
],
"pre_patches": [
- "//third_party/go/patches:go-tpm-tools-fix-proto-paths.patch",
+ "//third_party/com_github_google_go_tpm_tools:go-tpm-tools-fix-proto-paths.patch",
],
},
"github.com/googleapis/gax-go/v2": {
@@ -158,7 +158,7 @@
"gazelle:build_tags seccomp",
],
"patches": [
- "//third_party/go/patches:runc-add-cdeps.patch",
+ "//third_party/com_github_opencontainers_runc:runc-add-cdeps.patch",
],
},
"github.com/google/cadvisor": {
@@ -166,7 +166,7 @@
"gazelle:proto disable_global",
],
"pre_patches": [
- "//third_party/go/patches:cadvisor-errdefs1.patch",
+ "//third_party/com_github_google_cadvisor:cadvisor-errdefs1.patch",
],
},
"github.com/sqlc-dev/sqlc": {
@@ -195,8 +195,8 @@
"gazelle:proto disable",
],
"patches": [
- "//third_party/go/patches:etcd-fix-embed-close.patch",
- "//third_party/go/patches:etcd-fix-islearner-panic.patch",
+ "//third_party/com_go_etcd_io_etcd_server_v3:etcd-fix-embed-close.patch",
+ "//third_party/com_go_etcd_io_etcd_server_v3:etcd-fix-islearner-panic.patch",
],
},
"github.com/grpc-ecosystem/grpc-gateway": {
@@ -245,7 +245,7 @@
"gazelle:proto disable",
],
"patches": [
- "//third_party/go/patches:kubelet-fix-path.patch",
+ "//third_party/com_k8s_io_kubelet:kubelet-fix-path.patch",
],
},
"k8s.io/kubernetes": {
@@ -253,14 +253,14 @@
"gazelle:proto disable",
],
"patches": [
- "//third_party/go/patches:k8s-native-metrics.patch",
- "//third_party/go/patches:k8s-removed-block-device-pseudo-locks.patch",
- "//third_party/go/patches:k8s-add-pause-build-file.patch",
- "//third_party/go/patches:k8s-reserve-metropolis-ports-import.patch",
+ "//third_party/com_k8s_io_kubernetes:k8s-native-metrics.patch",
+ "//third_party/com_k8s_io_kubernetes:k8s-removed-block-device-pseudo-locks.patch",
+ "//third_party/com_k8s_io_kubernetes:k8s-add-pause-build-file.patch",
+ "//third_party/com_k8s_io_kubernetes:k8s-reserve-metropolis-ports-import.patch",
],
"pre_patches": [
- "//third_party/go/patches:k8s-drop-legacy-log-path.patch",
- "//third_party/go/patches:k8s-reserve-metropolis-ports.patch",
+ "//third_party/com_k8s_io_kubernetes:k8s-drop-legacy-log-path.patch",
+ "//third_party/com_k8s_io_kubernetes:k8s-reserve-metropolis-ports.patch",
],
},
"k8s.io/metrics": {
@@ -300,7 +300,7 @@
},
"github.com/containernetworking/cni": {
"patches": [
- "//third_party/go/patches:cni-fix-cachepath.patch",
+ "//third_party/com_github_containernetworking_cni:cni-fix-cachepath.patch",
],
},
"github.com/containernetworking/plugins": {
@@ -310,72 +310,72 @@
},
"github.com/corverroos/commentwrap": {
"patches": [
- "//third_party/go/patches:commentwrap-uri.patch",
+ "//third_party/com_github_corverroos_commentwrap:commentwrap-uri.patch",
],
},
"github.com/go-delve/delve": {
"patches": [
- "//third_party/go/patches:delve-fix-cgo.patch",
+ "//third_party/com_github_go_delve_delve:delve-fix-cgo.patch",
],
},
"github.com/pganalyze/pg_query_go/v4": {
"patches": [
- "//third_party/go/patches:pganalyze-add-cdeps.patch",
+ "//third_party/com_github_pganalyze_pg_query_go_v4:pganalyze-add-cdeps.patch",
],
},
"github.com/sbezverk/nfproxy": {
"pre_patches": [
- "//third_party/go/patches:nfproxy-adapt-to-k8s-1.28.patch",
- "//third_party/go/patches:nfproxy-adapt-to-nftables-0.2.patch",
+ "//third_party/com_github_sbezverk_nfproxy:nfproxy-adapt-to-k8s-1.28.patch",
+ "//third_party/com_github_sbezverk_nfproxy:nfproxy-adapt-to-nftables-0.2.patch",
],
},
"github.com/google/nftables": {
"pre_patches": [
- "//third_party/go/patches:nftables-bigger-buffers.patch",
- "//third_party/go/patches:nftables-dynamic-exprs.patch",
+ "//third_party/com_github_google_nftables:nftables-bigger-buffers.patch",
+ "//third_party/com_github_google_nftables:nftables-dynamic-exprs.patch",
],
},
"k8s.io/kubectl": {
"patches": [
- "//third_party/go/patches:kubectl-fix-embed.patch",
+ "//third_party/com_k8s_io_kubectl:kubectl-fix-embed.patch",
],
},
"github.com/seccomp/libseccomp-golang": {
"patches": [
- "//third_party/go/patches:libseccomp.patch",
+ "//third_party/com_github_seccomp_libseccomp_golang:libseccomp.patch",
],
},
"github.com/vishvananda/netlink": {
"patches": [
- "//third_party/go/patches:netlink-psample.patch",
+ "//third_party/com_github_vishvananda_netlink:netlink-psample.patch",
],
},
"gvisor.dev/gvisor": {
"patches": [
- "//third_party/go/patches:gvisor-fix-syslog.patch",
+ "//third_party/com_gvisor_dev_gvisor:gvisor-fix-syslog.patch",
],
"pre_patches": [
- "//third_party/go/patches:gvisor-containerd-compat.patch",
+ "//third_party/com_gvisor_dev_gvisor:gvisor-containerd-compat.patch",
],
},
"go.etcd.io/etcd/tests/v3": {
"patches": [
- "//third_party/go/patches:etcd-integration-logging.patch",
+ "//third_party/com_go_etcd_io_etcd_tests_v3:etcd-integration-logging.patch",
],
},
"k8s.io/component-base": {
"patches": [
- "//third_party/go/patches:k8s-fix-metrics-data-race.patch",
+ "//third_party/com_k8s_io_component_base:k8s-fix-metrics-data-race.patch",
],
},
"k8s.io/mount-utils": {
"pre_patches": [
- "//third_party/go/patches:k8s-native-mounter.patch",
+ "//third_party/com_k8s_io_mount_utils:k8s-native-mounter.patch",
],
},
"golang.org/x/tools": {
"patches": [
- "//third_party/go/patches:goimports-group-merging.patch",
+ "//third_party/com_golang_org_x_tools:goimports-group-merging.patch",
],
},
}
diff --git a/third_party/go/README.md b/build/go/README.md
similarity index 100%
rename from third_party/go/README.md
rename to build/go/README.md
diff --git a/metropolis/node/kubernetes/hyperkube/BUILD.bazel b/metropolis/node/kubernetes/hyperkube/BUILD.bazel
index 406ec7d..9fb4c22 100644
--- a/metropolis/node/kubernetes/hyperkube/BUILD.bazel
+++ b/metropolis/node/kubernetes/hyperkube/BUILD.bazel
@@ -1,5 +1,5 @@
-load("@//third_party/go:kubernetes_version_def.bzl", "version_x_defs")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+load(":kubernetes_version_def.bzl", "version_x_defs")
go_library(
name = "hyperkube_lib",
diff --git a/third_party/go/kubernetes_version_def.bzl b/metropolis/node/kubernetes/hyperkube/kubernetes_version_def.bzl
similarity index 100%
rename from third_party/go/kubernetes_version_def.bzl
rename to metropolis/node/kubernetes/hyperkube/kubernetes_version_def.bzl
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_containernetworking_cni/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_containernetworking_cni/BUILD.bazel
diff --git a/third_party/go/patches/cni-fix-cachepath.patch b/third_party/com_github_containernetworking_cni/cni-fix-cachepath.patch
similarity index 100%
rename from third_party/go/patches/cni-fix-cachepath.patch
rename to third_party/com_github_containernetworking_cni/cni-fix-cachepath.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_corverroos_commentwrap/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_corverroos_commentwrap/BUILD.bazel
diff --git a/third_party/go/patches/commentwrap-uri.patch b/third_party/com_github_corverroos_commentwrap/commentwrap-uri.patch
similarity index 100%
rename from third_party/go/patches/commentwrap-uri.patch
rename to third_party/com_github_corverroos_commentwrap/commentwrap-uri.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_go_delve_delve/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_go_delve_delve/BUILD.bazel
diff --git a/third_party/go/patches/delve-fix-cgo.patch b/third_party/com_github_go_delve_delve/delve-fix-cgo.patch
similarity index 100%
rename from third_party/go/patches/delve-fix-cgo.patch
rename to third_party/com_github_go_delve_delve/delve-fix-cgo.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_google_cadvisor/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_google_cadvisor/BUILD.bazel
diff --git a/third_party/go/patches/cadvisor-errdefs1.patch b/third_party/com_github_google_cadvisor/cadvisor-errdefs1.patch
similarity index 100%
rename from third_party/go/patches/cadvisor-errdefs1.patch
rename to third_party/com_github_google_cadvisor/cadvisor-errdefs1.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_google_go_tpm_tools/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_google_go_tpm_tools/BUILD.bazel
diff --git a/third_party/go/patches/go-tpm-tools-fix-proto-paths.patch b/third_party/com_github_google_go_tpm_tools/go-tpm-tools-fix-proto-paths.patch
similarity index 100%
rename from third_party/go/patches/go-tpm-tools-fix-proto-paths.patch
rename to third_party/com_github_google_go_tpm_tools/go-tpm-tools-fix-proto-paths.patch
diff --git a/third_party/go/patches/BUILD.bazel b/third_party/com_github_google_nftables/BUILD.bazel
similarity index 100%
copy from third_party/go/patches/BUILD.bazel
copy to third_party/com_github_google_nftables/BUILD.bazel
diff --git a/third_party/go/patches/nftables-bigger-buffers.patch b/third_party/com_github_google_nftables/nftables-bigger-buffers.patch
similarity index 100%
rename from third_party/go/patches/nftables-bigger-buffers.patch
rename to third_party/com_github_google_nftables/nftables-bigger-buffers.patch
diff --git a/third_party/go/patches/nftables-dynamic-exprs.patch b/third_party/com_github_google_nftables/nftables-dynamic-exprs.patch
similarity index 100%
rename from third_party/go/patches/nftables-dynamic-exprs.patch
rename to third_party/com_github_google_nftables/nftables-dynamic-exprs.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_opencontainers_runc/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_opencontainers_runc/BUILD.bazel
diff --git a/third_party/go/patches/runc-add-cdeps.patch b/third_party/com_github_opencontainers_runc/runc-add-cdeps.patch
similarity index 100%
rename from third_party/go/patches/runc-add-cdeps.patch
rename to third_party/com_github_opencontainers_runc/runc-add-cdeps.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_pganalyze_pg_query_go_v4/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_pganalyze_pg_query_go_v4/BUILD.bazel
diff --git a/third_party/go/patches/pganalyze-add-cdeps.patch b/third_party/com_github_pganalyze_pg_query_go_v4/pganalyze-add-cdeps.patch
similarity index 100%
rename from third_party/go/patches/pganalyze-add-cdeps.patch
rename to third_party/com_github_pganalyze_pg_query_go_v4/pganalyze-add-cdeps.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_sbezverk_nfproxy/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_sbezverk_nfproxy/BUILD.bazel
diff --git a/third_party/go/patches/nfproxy-adapt-to-k8s-1.28.patch b/third_party/com_github_sbezverk_nfproxy/nfproxy-adapt-to-k8s-1.28.patch
similarity index 100%
rename from third_party/go/patches/nfproxy-adapt-to-k8s-1.28.patch
rename to third_party/com_github_sbezverk_nfproxy/nfproxy-adapt-to-k8s-1.28.patch
diff --git a/third_party/go/patches/nfproxy-adapt-to-nftables-0.2.patch b/third_party/com_github_sbezverk_nfproxy/nfproxy-adapt-to-nftables-0.2.patch
similarity index 100%
rename from third_party/go/patches/nfproxy-adapt-to-nftables-0.2.patch
rename to third_party/com_github_sbezverk_nfproxy/nfproxy-adapt-to-nftables-0.2.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_seccomp_libseccomp_golang/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_seccomp_libseccomp_golang/BUILD.bazel
diff --git a/third_party/go/patches/libseccomp.patch b/third_party/com_github_seccomp_libseccomp_golang/libseccomp.patch
similarity index 100%
rename from third_party/go/patches/libseccomp.patch
rename to third_party/com_github_seccomp_libseccomp_golang/libseccomp.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_github_vishvananda_netlink/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_github_vishvananda_netlink/BUILD.bazel
diff --git a/third_party/go/patches/netlink-psample.patch b/third_party/com_github_vishvananda_netlink/netlink-psample.patch
similarity index 100%
rename from third_party/go/patches/netlink-psample.patch
rename to third_party/com_github_vishvananda_netlink/netlink-psample.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_go_etcd_io_etcd_server_v3/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_go_etcd_io_etcd_server_v3/BUILD.bazel
diff --git a/third_party/go/patches/etcd-fix-embed-close.patch b/third_party/com_go_etcd_io_etcd_server_v3/etcd-fix-embed-close.patch
similarity index 100%
rename from third_party/go/patches/etcd-fix-embed-close.patch
rename to third_party/com_go_etcd_io_etcd_server_v3/etcd-fix-embed-close.patch
diff --git a/third_party/go/patches/etcd-fix-islearner-panic.patch b/third_party/com_go_etcd_io_etcd_server_v3/etcd-fix-islearner-panic.patch
similarity index 100%
rename from third_party/go/patches/etcd-fix-islearner-panic.patch
rename to third_party/com_go_etcd_io_etcd_server_v3/etcd-fix-islearner-panic.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_go_etcd_io_etcd_tests_v3/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_go_etcd_io_etcd_tests_v3/BUILD.bazel
diff --git a/third_party/go/patches/etcd-integration-logging.patch b/third_party/com_go_etcd_io_etcd_tests_v3/etcd-integration-logging.patch
similarity index 100%
rename from third_party/go/patches/etcd-integration-logging.patch
rename to third_party/com_go_etcd_io_etcd_tests_v3/etcd-integration-logging.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_golang_org_x_tools/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_golang_org_x_tools/BUILD.bazel
diff --git a/third_party/go/patches/goimports-group-merging.patch b/third_party/com_golang_org_x_tools/goimports-group-merging.patch
similarity index 100%
rename from third_party/go/patches/goimports-group-merging.patch
rename to third_party/com_golang_org_x_tools/goimports-group-merging.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_gvisor_dev_gvisor/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_gvisor_dev_gvisor/BUILD.bazel
diff --git a/third_party/go/patches/gvisor-containerd-compat.patch b/third_party/com_gvisor_dev_gvisor/gvisor-containerd-compat.patch
similarity index 100%
rename from third_party/go/patches/gvisor-containerd-compat.patch
rename to third_party/com_gvisor_dev_gvisor/gvisor-containerd-compat.patch
diff --git a/third_party/go/patches/gvisor-fix-syslog.patch b/third_party/com_gvisor_dev_gvisor/gvisor-fix-syslog.patch
similarity index 100%
rename from third_party/go/patches/gvisor-fix-syslog.patch
rename to third_party/com_gvisor_dev_gvisor/gvisor-fix-syslog.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_k8s_io_client_go/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_k8s_io_client_go/BUILD.bazel
diff --git a/third_party/go/BUILD.bazel b/third_party/com_k8s_io_component_base/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_k8s_io_component_base/BUILD.bazel
diff --git a/third_party/go/patches/k8s-fix-metrics-data-race.patch b/third_party/com_k8s_io_component_base/k8s-fix-metrics-data-race.patch
similarity index 100%
rename from third_party/go/patches/k8s-fix-metrics-data-race.patch
rename to third_party/com_k8s_io_component_base/k8s-fix-metrics-data-race.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_k8s_io_kubectl/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_k8s_io_kubectl/BUILD.bazel
diff --git a/third_party/go/patches/kubectl-fix-embed.patch b/third_party/com_k8s_io_kubectl/kubectl-fix-embed.patch
similarity index 100%
rename from third_party/go/patches/kubectl-fix-embed.patch
rename to third_party/com_k8s_io_kubectl/kubectl-fix-embed.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_k8s_io_kubelet/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_k8s_io_kubelet/BUILD.bazel
diff --git a/third_party/go/patches/kubelet-fix-path.patch b/third_party/com_k8s_io_kubelet/kubelet-fix-path.patch
similarity index 100%
rename from third_party/go/patches/kubelet-fix-path.patch
rename to third_party/com_k8s_io_kubelet/kubelet-fix-path.patch
diff --git a/third_party/go/patches/BUILD.bazel b/third_party/com_k8s_io_kubernetes/BUILD.bazel
similarity index 100%
rename from third_party/go/patches/BUILD.bazel
rename to third_party/com_k8s_io_kubernetes/BUILD.bazel
diff --git a/third_party/go/patches/k8s-add-pause-build-file.patch b/third_party/com_k8s_io_kubernetes/k8s-add-pause-build-file.patch
similarity index 100%
rename from third_party/go/patches/k8s-add-pause-build-file.patch
rename to third_party/com_k8s_io_kubernetes/k8s-add-pause-build-file.patch
diff --git a/third_party/go/patches/k8s-drop-legacy-log-path.patch b/third_party/com_k8s_io_kubernetes/k8s-drop-legacy-log-path.patch
similarity index 100%
rename from third_party/go/patches/k8s-drop-legacy-log-path.patch
rename to third_party/com_k8s_io_kubernetes/k8s-drop-legacy-log-path.patch
diff --git a/third_party/go/patches/k8s-native-metrics.patch b/third_party/com_k8s_io_kubernetes/k8s-native-metrics.patch
similarity index 100%
rename from third_party/go/patches/k8s-native-metrics.patch
rename to third_party/com_k8s_io_kubernetes/k8s-native-metrics.patch
diff --git a/third_party/go/patches/k8s-removed-block-device-pseudo-locks.patch b/third_party/com_k8s_io_kubernetes/k8s-removed-block-device-pseudo-locks.patch
similarity index 100%
rename from third_party/go/patches/k8s-removed-block-device-pseudo-locks.patch
rename to third_party/com_k8s_io_kubernetes/k8s-removed-block-device-pseudo-locks.patch
diff --git a/third_party/go/patches/k8s-reserve-metropolis-ports-import.patch b/third_party/com_k8s_io_kubernetes/k8s-reserve-metropolis-ports-import.patch
similarity index 100%
rename from third_party/go/patches/k8s-reserve-metropolis-ports-import.patch
rename to third_party/com_k8s_io_kubernetes/k8s-reserve-metropolis-ports-import.patch
diff --git a/third_party/go/patches/k8s-reserve-metropolis-ports.patch b/third_party/com_k8s_io_kubernetes/k8s-reserve-metropolis-ports.patch
similarity index 100%
rename from third_party/go/patches/k8s-reserve-metropolis-ports.patch
rename to third_party/com_k8s_io_kubernetes/k8s-reserve-metropolis-ports.patch
diff --git a/third_party/go/BUILD.bazel b/third_party/com_k8s_io_mount_utils/BUILD.bazel
similarity index 100%
copy from third_party/go/BUILD.bazel
copy to third_party/com_k8s_io_mount_utils/BUILD.bazel
diff --git a/third_party/go/patches/k8s-native-mounter.patch b/third_party/com_k8s_io_mount_utils/k8s-native-mounter.patch
similarity index 100%
rename from third_party/go/patches/k8s-native-mounter.patch
rename to third_party/com_k8s_io_mount_utils/k8s-native-mounter.patch
diff --git a/third_party/go/patches/rules_go_gopackagesdriver_anchor_kind.patch b/third_party/go/patches/rules_go_gopackagesdriver_anchor_kind.patch
deleted file mode 100644
index b9e4c00..0000000
--- a/third_party/go/patches/rules_go_gopackagesdriver_anchor_kind.patch
+++ /dev/null
@@ -1,37 +0,0 @@
- gopackagesdriver: Make kind query regexes anchored
-
- A query like kind("go_library", ...) also returns rules that are not go
- libraries but have go_library as a substring of the rule name, such as
- sqlc_go_library in the Monogon monorepo. To fix that, add regex anchors.
-
-diff --git a/go/tools/gopackagesdriver/bazel_json_builder.go b/go/tools/gopackagesdriver/bazel_json_builder.go
-index c19f0308..242eeef8 100644
---- a/go/tools/gopackagesdriver/bazel_json_builder.go
-+++ b/go/tools/gopackagesdriver/bazel_json_builder.go
-@@ -80,7 +80,7 @@ func (b *BazelJSONBuilder) fileQuery(filename string) string {
- }
-
- kinds := append(_defaultKinds, additionalKinds...)
-- return fmt.Sprintf(`kind("%s", same_pkg_direct_rdeps("%s"))`, strings.Join(kinds, "|"), label)
-+ return fmt.Sprintf(`kind("^(%s) rule$", same_pkg_direct_rdeps("%s"))`, strings.Join(kinds, "|"), label)
- }
-
- func (b *BazelJSONBuilder) getKind() string {
-@@ -104,7 +104,7 @@ func (b *BazelJSONBuilder) localQuery(request string) string {
- request = fmt.Sprintf("%s:*", request)
- }
-
-- return fmt.Sprintf(`kind("%s", %s)`, b.getKind(), request)
-+ return fmt.Sprintf(`kind("^(%s) rule$", %s)`, b.getKind(), request)
- }
-
- func (b *BazelJSONBuilder) packageQuery(importPath string) string {
-@@ -113,7 +113,7 @@ func (b *BazelJSONBuilder) packageQuery(importPath string) string {
- }
-
- return fmt.Sprintf(
-- `kind("%s", attr(importpath, "%s", deps(%s)))`,
-+ `kind("^(%s) rule$", attr(importpath, "%s", deps(%s)))`,
- b.getKind(),
- importPath,
- bazelQueryScope)
diff --git a/third_party/go/BUILD.bazel b/third_party/rules_go/BUILD.bazel
similarity index 100%
rename from third_party/go/BUILD.bazel
rename to third_party/rules_go/BUILD.bazel
diff --git a/third_party/go/patches/rules_go_absolute_embedsrc.patch b/third_party/rules_go/rules_go_absolute_embedsrc.patch
similarity index 100%
rename from third_party/go/patches/rules_go_absolute_embedsrc.patch
rename to third_party/rules_go/rules_go_absolute_embedsrc.patch