bufbuild / protoc-gen-validate

Protocol Buffer Validation - Being replaced by github.com/bufbuild/protovalidate
https://github.com/bufbuild/protovalidate
Apache License 2.0
3.76k stars 582 forks source link

repeated inlookup failing to build #83

Closed kyessenov closed 6 years ago

kyessenov commented 6 years ago

Current version fails to produce valid gogo code for: https://github.com/envoyproxy/data-plane-api/blob/master/envoy/config/filter/accesslog/v2/accesslog.proto#L164

kyessenov commented 6 years ago

/cc @davecheney need to fix this first to get the build working in go-control-plane

kyessenov commented 6 years ago

Also noticed this:

 make kitchensink
# generates the kitchensink test protos
rm -r tests/kitchensink/go || true
mkdir -p tests/kitchensink/go
rm -r tests/kitchensink/gogo || true
mkdir -p tests/kitchensink/gogo
cd tests/kitchensink && \
protoc \
        -I . \
        -I ../.. \
        --go_out="Mvalidate/validate.proto=github.com/lyft/protoc-gen-validate/validate,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any,Mgoogle/protobuf/duration.proto=github.com/golang/protobuf/ptypes/duration,Mgoogle/protobuf/struct.proto=github.com/golang/protobuf/ptypes/struct,Mgoogle/protobuf/timestamp.proto=github.com/golang/protobuf/ptypes/timestamp,Mgoogle/protobuf/wrappers.proto=github.com/golang/protobuf/ptypes/wrappers,Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,Mgogoproto/gogo.proto=github.com/lyft/protoc-gen-validate/gogoproto:./go" \
        --validate_out="lang=go:./go" \
        --plugin=protoc-gen-gogofast=/home/kuat/go/src/github.com/lyft/protoc-gen-validate/gogofast \
        --gogofast_out="Mvalidate/validate.proto=github.com/lyft/protoc-gen-validate/validate,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/types,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto:./gogo" \
        --validate_out="lang=gogo:./gogo" \
        `find . -name "*.proto"`
cd tests/kitchensink/go && go build .
# github.com/lyft/protoc-gen-validate/tests/kitchensink/go
./repeated.pb.validate.go:158:15: undefined: _Repeated_InItemRules_InLookup
./repeated.pb.validate.go:170:15: undefined: _Repeated_NotInItemRules_NotInLookup
Makefile:86: recipe for target 'kitchensink' failed
rodaine commented 6 years ago

@junr03 I think this is related to your PR, want to take a look?

junr03 commented 6 years ago

@kyessenov this is the related PR https://github.com/lyft/protoc-gen-validate/pull/78/files. How is it failing in gogo? How should I repro? I can take a look tomorrow morning.

kyessenov commented 6 years ago

The problem might be present for go, too. Try make kitchensink, as in the above.

kyessenov commented 6 years ago

I forgot to rebuild my binary... I'll take a look at why go/gogo are different here. The templates look the same to me.

kyessenov commented 6 years ago

OK, resolved by updating to master. Sorry for the noise.