Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make harness failure #538

Closed
manuelnp opened this issue Dec 1, 2021 · 3 comments
Closed

make harness failure #538

manuelnp opened this issue Dec 1, 2021 · 3 comments
Labels
Bug Reports and/or fixes a bug

Comments

@manuelnp
Copy link

manuelnp commented Dec 1, 2021

Trying to setup the envirment to address the issue #321, I got the following error for 'make harness' using the docker route:

docker run --rm -v $(pwd):/go/src/github.com/envoyproxy/protoc-gen-validate lyft/protoc-gen-validate harness

rm -r tests/harness/cases/go || true
mkdir tests/harness/cases/go
rm -r tests/harness/cases/other_package/go || true
mkdir tests/harness/cases/other_package/go
rm -r tests/harness/cases/yet_another_package/go || true
mkdir tests/harness/cases/yet_another_package/go
# protoc-gen-go makes us go a package at a time
cd tests/harness/cases/other_package && \
protoc \
        -I . \
        -I ../../../.. \
        --go_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go,Mvalidate/validate.proto=github.com/envoyproxy/protoc-gen-validate/validate,Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb,Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb,Mgoogle/protobuf/struct.proto=google.golang.org/protobuf/types/known/structpb,Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb,Mgoogle/protobuf/wrappers.proto=google.golang.org/protobuf/types/known/wrapperspb,Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb:./go" \
        --plugin=protoc-gen-go=/go/bin/protoc-gen-go \
        --validate_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go,lang=go:./go" \
        ./*.proto
cd tests/harness/cases/yet_another_package && \
protoc \
        -I . \
        -I ../../../.. \
        --go_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go,Mvalidate/validate.proto=github.com/envoyproxy/protoc-gen-validate/validate,Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb,Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb,Mgoogle/protobuf/struct.proto=google.golang.org/protobuf/types/known/structpb,Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb,Mgoogle/protobuf/wrappers.proto=google.golang.org/protobuf/types/known/wrapperspb,Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb:./go" \
        --plugin=protoc-gen-go=/go/bin/protoc-gen-go \
        --validate_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go,lang=go:./go" \
        ./*.proto
cd tests/harness/cases && \
protoc \
        -I . \
        -I ../../.. \
        --go_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go,Mtests/harness/cases/other_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go;other_package,Mtests/harness/cases/yet_another_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go,Mvalidate/validate.proto=github.com/envoyproxy/protoc-gen-validate/validate,Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb,Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb,Mgoogle/protobuf/struct.proto=google.golang.org/protobuf/types/known/structpb,Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb,Mgoogle/protobuf/wrappers.proto=google.golang.org/protobuf/types/known/wrapperspb,Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb:./go" \
        --plugin=protoc-gen-go=/go/bin/protoc-gen-go \
        --validate_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go,lang=go,Mtests/harness/cases/other_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go,Mtests/harness/cases/yet_another_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go:./go" \
        ./*.proto
filename-with-dash.proto:5:1: warning: Import validate/validate.proto is unused.
./bin/harness -go -cc
panic: proto: file "embed.proto" is already registered
        previously from: "github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go"
        currently from:  "github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go"
See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict


goroutine 1 [running]:
google.golang.org/protobuf/reflect/protoregistry.glob..func1({0x85f840, 0x873018}, {0x85f840, 0xc000118820})
        /go/pkg/mod/google.golang.org/[email protected]/reflect/protoregistry/registry.go:54 +0x1f4
google.golang.org/protobuf/reflect/protoregistry.(*Files).RegisterFile(0xc000130018, {0x873018, 0xc000176a80})
        /go/pkg/mod/google.golang.org/[email protected]/reflect/protoregistry/registry.go:128 +0x399
google.golang.org/protobuf/internal/filedesc.Builder.Build({{0x74b7fc, 0x54}, {0xbbc860, 0x100, 0x100}, 0x1, 0x1, 0x0, 0x0, {0x868720, ...}, ...})
        /go/pkg/mod/google.golang.org/[email protected]/internal/filedesc/build.go:113 +0x1d6
google.golang.org/protobuf/internal/filetype.Builder.Build({{{0x74b7fc, 0x54}, {0xbbc860, 0x100, 0x100}, 0x1, 0x1, 0x0, 0x0, {0x0, ...}, ...}, ...})
        /go/pkg/mod/google.golang.org/[email protected]/internal/filetype/build.go:139 +0x198
github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go.file_embed_proto_init()
        /go/src/github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go/embed.pb.go:195 +0x1d8
github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go.init.0()
        /go/src/github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go/embed.pb.go:162 +0x17
make: *** [Makefile:63: harness] Error 2

Is this and issue or did I mess up somewhere?

@rodaine rodaine added the Bug Reports and/or fixes a bug label Dec 1, 2021
@rodaine
Copy link
Member

rodaine commented Dec 1, 2021

Looks like one of the recently added cases might have repeated some of the same FQNs, which bazel is able to handle fine but the make target likely wasn't handled correctly.

panic: proto: file "embed.proto" is already registered
        previously from: "github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go"
        currently from:  "github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go"

@claraisrael
Copy link

claraisrael commented May 10, 2023

Hello, I'm facing exactly this issue as @rodaine mentions. Can someone point me to the solution, if there's one? Thanks!
I got

panic: proto: file "validate/validate.proto" is already registered
        previously from: "github.com/envoyproxy/protoc-gen-validate/validate"
        currently from:  "go.buf.build/openfga/go/envoyproxy/protoc-gen-validate/validate"

@Mariscal6
Copy link

Hi, I am also experiencing the same issue. @claraisrael @rodaine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reports and/or fixes a bug
Projects
None yet
Development

No branches or pull requests

5 participants