Skip to content

Commit

Permalink
crit/images: fix name conflict with letsencrypt
Browse files Browse the repository at this point in the history
The core.proto and so.proto files provided by criu have conflicting
names with the proto files included in

https://github.com/letsencrypt/boulder

Since protobuf v1.26.0 a hard error is reported when a compiled Go
program starts up that has multiple conflicting protobuf names
linked into it. This results in the following error when running
the podman tests:

panic: proto: file "sa.proto" is already registered
	previously from: "github.com/letsencrypt/boulder/sa/proto"
	currently from:  "github.com/checkpoint-restore/go-criu/v6/crit/images"
See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict

goroutine 1 [running]:
google.golang.org/protobuf/reflect/protoregistry.glob..func1({0x1b0b380?, 0xc0004ce240?}, {0x1b0b380?, 0xc0004ce280})
	/home/rst/tmp/libpod/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go:56 +0x1ee
google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(0xc0001a8678, {0x1b204c8?, 0xc0000fc000?})
	/home/rst/tmp/libpod/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go:130 +0x39c
google.golang.org/protobuf/internal/filedesc.Builder.Build({{0x153c2e0, 0x34}, {0x25a1a80, 0x100, 0x100}, 0x0, 0x1, 0x0, 0x0, {0x1b10fd0, ...}, ...})
	/home/rst/tmp/libpod/vendor/google.golang.org/protobuf/internal/filedesc/build.go:112 +0x1d6
google.golang.org/protobuf/internal/filetype.Builder.Build({{{0x153c2e0, 0x34}, {0x25a1a80, 0x100, 0x100}, 0x0, 0x1, 0x0, 0x0, {0x0, ...}, ...}, ...})
	/home/rst/tmp/libpod/vendor/google.golang.org/protobuf/internal/filetype/build.go:138 +0x19d
github.com/checkpoint-restore/go-criu/v6/crit/images.file_sa_proto_init()
	/home/rst/tmp/libpod/vendor/github.com/checkpoint-restore/go-criu/v6/crit/images/sa.pb.go:190 +0x198
github.com/checkpoint-restore/go-criu/v6/crit/images.file_core_proto_init()
	/home/rst/tmp/libpod/vendor/github.com/checkpoint-restore/go-criu/v6/crit/images/core.pb.go:1109 +0x6f
github.com/checkpoint-restore/go-criu/v6/crit/images.init.12()
	/home/rst/tmp/libpod/vendor/github.com/checkpoint-restore/go-criu/v6/crit/images/core.pb.go:1095 +0x17
path is /home/rst/tmp/libpod/.coverage
Unable to read coverage file cmd/podman/coverprofile to combine, open cmd/podman/coverprofile: no such file or directory

This patch fixes this error by prepending the `criu-` prefix to
core.proto and so.proto.

Fixes: checkpoint-restore#94

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed Sep 7, 2022
1 parent 74ddb08 commit 55607f2
Show file tree
Hide file tree
Showing 78 changed files with 378 additions and 515 deletions.
6 changes: 5 additions & 1 deletion crit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ update-proto:
# from other projects, the files of this repository are
# now registered under the package name `criu`.
ls ./images/*.proto | xargs sed -i '/syntax/a package criu;'
mv ./images/sa.proto ./images/criu-sa.proto
sed -i 's/sa\.proto/criu-sa\.proto/g' images/*.proto
mv ./images/core.proto ./images/criu-core.proto
sed -i 's/core\.proto/criu-core\.proto/g' images/*.proto

gen-proto:
rm ./images/*.pb.go || true
rm -f ./images/*.pb.go || true
@protoc \
--proto_path=$(proto_path) \
--go_out=$(proto_path) \
Expand Down
2 changes: 1 addition & 1 deletion crit/images/apparmor.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/autofs.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/binfmt-misc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/bpfmap-data.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/bpfmap-file.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/cgroup.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/core-aarch64.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/core-arm.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/core-mips.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/core-ppc64.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/core-s390.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/core-x86.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/cpuinfo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crit/images/creds.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 55607f2

Please sign in to comment.