go: re-do the entire thing
This is a mega-change, but attempting to split this up further is
probably not worth the effort.
Summary:
1. Bump up bazel, rules_go, and others.
2. Switch to new go target naming (bye bye go_default_library)
3. Move go deps to go.mod/go.sum, use make gazelle generate from that
4. Bump up Python deps a bit
And also whatever was required to actually get things to work - loads of
small useless changes.
Tested to work on NixOS and Ubuntu 20.04:
$ bazel build //...
$ bazel test //...
Change-Id: I8364bdaa1406b9ae4d0385a6b607f3e7989f98a9
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1583
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/third_party/go/com_github_cloudflare_circl.patch b/third_party/go/com_github_cloudflare_circl.patch
new file mode 100644
index 0000000..72d5a56
--- /dev/null
+++ b/third_party/go/com_github_cloudflare_circl.patch
@@ -0,0 +1,74 @@
+diff -ur com_github_cloudflare_circl.orig/dh/x25519/BUILD.bazel com_github_cloudflare_circl/dh/x25519/BUILD.bazel
+--- com_github_cloudflare_circl.orig/dh/x25519/BUILD.bazel 2023-07-24 19:46:59.144004038 +0200
++++ com_github_cloudflare_circl/dh/x25519/BUILD.bazel 2023-07-24 19:49:41.783441209 +0200
+@@ -15,6 +15,9 @@
+ ],
+ importpath = "github.com/cloudflare/circl/dh/x25519",
+ visibility = ["//visibility:public"],
++ embed = [
++ "//math/fp25519:headers",
++ ],
+ deps = [
+ "//math/fp25519",
+ ] + select({
+diff -ur com_github_cloudflare_circl.orig/dh/x448/BUILD.bazel com_github_cloudflare_circl/dh/x448/BUILD.bazel
+--- com_github_cloudflare_circl.orig/dh/x448/BUILD.bazel 2023-07-24 19:46:59.144004038 +0200
++++ com_github_cloudflare_circl/dh/x448/BUILD.bazel 2023-07-24 19:52:58.138976931 +0200
+@@ -15,6 +15,9 @@
+ ],
+ importpath = "github.com/cloudflare/circl/dh/x448",
+ visibility = ["//visibility:public"],
++ embed = [
++ "//math/fp448:headers",
++ ],
+ deps = [
+ "//math/fp448",
+ ] + select({
+diff -ur com_github_cloudflare_circl.orig/math/fp25519/BUILD.bazel com_github_cloudflare_circl/math/fp25519/BUILD.bazel
+--- com_github_cloudflare_circl.orig/math/fp25519/BUILD.bazel 2023-07-24 19:46:59.160003952 +0200
++++ com_github_cloudflare_circl/math/fp25519/BUILD.bazel 2023-07-24 19:50:26.752351128 +0200
+@@ -1,4 +1,4 @@
+-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_source", "go_test")
+
+ go_library(
+ name = "fp25519",
+@@ -22,6 +22,14 @@
+ }),
+ )
+
++go_source(
++ name = "headers",
++ srcs = [
++ "fp_amd64.h",
++ ],
++ visibility = ["//visibility:public"],
++)
++
+ alias(
+ name = "go_default_library",
+ actual = ":fp25519",
+diff -ur com_github_cloudflare_circl.orig/math/fp448/BUILD.bazel com_github_cloudflare_circl/math/fp448/BUILD.bazel
+--- com_github_cloudflare_circl.orig/math/fp448/BUILD.bazel 2023-07-24 19:46:59.160003952 +0200
++++ com_github_cloudflare_circl/math/fp448/BUILD.bazel 2023-07-24 19:54:32.569697606 +0200
+@@ -1,4 +1,4 @@
+-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
++load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_source", "go_test")
+
+ go_library(
+ name = "fp448",
+@@ -22,6 +22,14 @@
+ }),
+ )
+
++go_source(
++ name = "headers",
++ srcs = [
++ "fp_amd64.h",
++ ],
++ visibility = ["//visibility:public"],
++)
++
+ alias(
+ name = "go_default_library",
+ actual = ":fp448",