*: bump up Go dependencies
This started off as 'let's bump gVisor'. However, pulling that thread
resulted in quite a few things that also required bumping for the build
to actually work. Here I come back from a day in the Bazel mines,
bearing fruits of my labor.
Notable changes:
- bump up gVisor
- bump up containerd
- bump up Bazel
- bump up rules_go, rules_docker, Gazelle
- use google.golang.org/protobuf (the 'new' go proto package)
- bump up gRPC (but not too much, as go-etcd is still straggling)
Notable effects:
- new gVisor supports TTY allocation (kubectl run -it
--image=ubuntu:20.04 ubuntu bash now works!)
Notable notes:
- gVisor shim has new been rolled into the main gVisor package and is
slightly easier to build (we can get rid of a bunch of patches).
- Opencontainers' runtime-specs now follow containerd instead of gVisor
- gVisor had to be taught to use the slightly newer runtime-specs via a
new patch.
- go_rule() in Starlark is now deprecated, and we had to change our
Starlark rule definitions to use rule() instead. We also had to patch
gVisor to do that (as there hasn't yet been a release that rolled
this up).
- Gazelle now supports different naming schemes for generated Go
targets - either the old //foo/bar:go_default_library scheme, or a
new and nicer //foo/bar:bar scheme. We currently force the usage of
the old scheme, as switching over is probably not going to be easy
(we use a lot of external Bazel files, and we have to wait for their
compatibility with the new scheme first).
- New Bazel/rules_go sets a TMPDIR long enough to generate paths (via
ioutil.TempDir) to which sockets cannot be bound (108-byte limit).
- The new protobuf API is incompatible with gogoproto. containerd/ttrpc
uses gogoproto, but we are smart enough to pull in the old protobuf
library as gogoproto's transitive dep. However, ttrpc also wants to
use some proto-generated grpc bits, and that doesn't work. We have to
pull in a ttrpc fork from a PR that hasn't yet been merged that fixes
this issue.
Test Plan: Refactor only, should be covered by tests.
X-Origin-Diff: phab/D689
GitOrigin-RevId: 1188c0605d25e7f40307fab5fd96e7019f3a9171
diff --git a/third_party/gazelle/add-prepatching.patch b/third_party/gazelle/add-prepatching.patch
index edbc94c..2150e96 100644
--- a/third_party/gazelle/add-prepatching.patch
+++ b/third_party/gazelle/add-prepatching.patch
@@ -13,20 +13,21 @@
limitations under the License.
-From db55421f284253c06561a4df18bca262999962ce Mon Sep 17 00:00:00 2001
-From: Lorenz Brun <lorenz@nexantic.com>
-Date: Wed, 22 Jul 2020 09:46:56 +0200
+From 2cb763552e2e386928e6c2211c4fb056b9ca7971 Mon Sep 17 00:00:00 2001
+From: Serge Bazanski <serge@nexantic.com>
+Date: Thu, 14 Jan 2021 16:30:32 +0100
Subject: [PATCH] Add support for prepatching
+Company: nexantic GmbH
---
- internal/go_repository.bzl | 18 +++++++++++++-----
- 1 file changed, 13 insertions(+), 5 deletions(-)
+ internal/go_repository.bzl | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/internal/go_repository.bzl b/internal/go_repository.bzl
-index 51a7317..86899bd 100644
+index 7f87ed1..a0ef36d 100644
--- a/internal/go_repository.bzl
+++ b/internal/go_repository.bzl
-@@ -127,6 +127,8 @@ def _go_repository_impl(ctx):
+@@ -130,6 +130,8 @@ def _go_repository_impl(ctx):
if result.stderr:
print("fetch_repo: " + result.stderr)
@@ -35,21 +36,8 @@
# Repositories are fetched. Determine if build file generation is needed.
build_file_names = ctx.attr.build_file_name.split(",")
existing_build_file = ""
-@@ -160,7 +162,7 @@ def _go_repository_impl(ctx):
- "-repo_root",
- ctx.path(""),
- "-repo_config",
-- ctx.path(ctx.attr.build_config)
-+ ctx.path(ctx.attr.build_config),
- ]
- if ctx.attr.version:
- cmd.append("-go_repository_module_mode")
-@@ -247,9 +249,13 @@ go_repository = repository_rule(
- ],
- ),
- "build_extra_args": attr.string_list(),
-- "build_config": attr.label(default= "@bazel_gazelle_go_repository_config//:WORKSPACE"),
-+ "build_config": attr.label(default = "@bazel_gazelle_go_repository_config//:WORKSPACE"),
+@@ -263,6 +265,10 @@ go_repository = repository_rule(
+ "build_config": attr.label(default = "@bazel_gazelle_go_repository_config//:WORKSPACE"),
"build_directives": attr.string_list(default = []),
+ # Patches to apply before running gazelle.
@@ -59,7 +47,7 @@
# Patches to apply after running gazelle.
"patches": attr.label_list(),
"patch_tool": attr.string(default = "patch"),
-@@ -260,10 +266,11 @@ go_repository = repository_rule(
+@@ -273,10 +279,11 @@ go_repository = repository_rule(
"""See repository.rst#go-repository for full documentation."""
# Copied from @bazel_tools//tools/build_defs/repo:utils.bzl
@@ -73,7 +61,7 @@
command = "{patchtool} {patch_args} < {patchfile}".format(
patchtool = ctx.attr.patch_tool,
patchfile = ctx.path(patchfile),
-@@ -276,7 +283,8 @@ def patch(ctx):
+@@ -289,7 +296,8 @@ def patch(ctx):
if st.return_code:
fail("Error applying patch %s:\n%s%s" %
(str(patchfile), st.stderr, st.stdout))
@@ -84,5 +72,5 @@
if st.return_code:
fail("Error applying patch command %s:\n%s%s" %
--
-2.25.1
+2.26.2