mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
deps: bump to go-criu v8.3.0
go-criu v8.3.0 switches to protobuf-go-lite, which helps to remove google.golang.org/protobuf dependency from here, reducing the runc binary size from ~16M to ~14M. The only missing piece is proto.String, proto.Bool, proto.Int32 etc. helpers that return a pointer to a given variable. Those are replaced by a generic mkPtr, which in turn is to be replaced by the new builtin once Go < 1.26 is no longer supported. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
+7
-7
@@ -9,8 +9,8 @@ import (
|
||||
"strconv"
|
||||
"syscall"
|
||||
|
||||
proto "github.com/checkpoint-restore/go-criu/v8/internal/proto"
|
||||
"github.com/checkpoint-restore/go-criu/v8/rpc"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// extraFilesStartFd is the first fd number assigned to cmd.ExtraFiles by os/exec.
|
||||
@@ -72,8 +72,8 @@ func (c *Criu) ensureInheritFd(opts *rpc.CriuOpts) {
|
||||
for i, key := range keys {
|
||||
fd := int32(extraFilesStartFd + i)
|
||||
opts.InheritFd = append(opts.InheritFd, &rpc.InheritFd{
|
||||
Key: proto.String(key),
|
||||
Fd: proto.Int32(fd),
|
||||
Key: proto.Ptr(key),
|
||||
Fd: proto.Ptr(fd),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
|
||||
}
|
||||
|
||||
if nfy != nil {
|
||||
opts.NotifyScripts = proto.Bool(true)
|
||||
opts.NotifyScripts = proto.Ptr(true)
|
||||
}
|
||||
|
||||
if features != nil {
|
||||
@@ -200,7 +200,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
|
||||
}
|
||||
|
||||
for {
|
||||
reqB, err := proto.Marshal(&req)
|
||||
reqB, err := req.MarshalVT()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -211,7 +211,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
|
||||
}
|
||||
|
||||
resp = &rpc.CriuResp{}
|
||||
err = proto.Unmarshal(respB[:respS], resp)
|
||||
err = resp.UnmarshalVT(respB[:respS])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -259,7 +259,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
|
||||
|
||||
req = rpc.CriuReq{
|
||||
Type: &respType,
|
||||
NotifySuccess: proto.Bool(true),
|
||||
NotifySuccess: proto.Ptr(true),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user