Comments (4)
This isn't a bug - you have duplicate types.
https://github.com/xmlking/micro-starter-kit/blob/develop/srv/account/proto/profile/profile_service.proto
https://github.com/xmlking/micro-starter-kit/blob/develop/e2e/profile_service.bloomrpc.proto
Both contain the same types, for example micro.account.profile.v1.ProfileService
. This would fail with protoc
as well:
$ git remote -v
origin https://github.com/xmlking/micro-starter-kit (fetch)
origin https://github.com/xmlking/micro-starter-kit (push)
$ protoc -I . -o /dev/null $(find . -name *.proto)
srv/account/proto/profile/profile_service.proto:24:31: "micro.account.profile.v1.ListRequest.limit" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:26:31: "micro.account.profile.v1.ListRequest.page" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:27:31: "micro.account.profile.v1.ListRequest.sort" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:28:31: "micro.account.profile.v1.ListRequest.preferred_theme" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:31:48: "micro.account.profile.v1.ListRequest.gender" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:23:9: "micro.account.profile.v1.ListRequest" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:37:46: "micro.account.profile.v1.ListResponse.results" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:38:10: "micro.account.profile.v1.ListResponse.total" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:35:9: "micro.account.profile.v1.ListResponse" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto: "micro.account.profile.v1.GetRequest.id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:43:33: "micro.account.profile.v1.GetRequest.profile_id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:45:33: "micro.account.profile.v1.GetRequest.user_id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:41:9: "micro.account.profile.v1.GetRequest" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:52:37: "micro.account.profile.v1.GetResponse.result" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:50:9: "micro.account.profile.v1.GetResponse" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:56:31: "micro.account.profile.v1.CreateRequest.user_id" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:58:31: "micro.account.profile.v1.CreateRequest.tz" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:59:31: "micro.account.profile.v1.CreateRequest.avatar" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:61:48: "micro.account.profile.v1.CreateRequest.gender" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:63:29: "micro.account.profile.v1.CreateRequest.birthday" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:65:31: "micro.account.profile.v1.CreateRequest.preferred_theme" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:55:9: "micro.account.profile.v1.CreateRequest" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:72:37: "micro.account.profile.v1.CreateResponse.result" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:70:9: "micro.account.profile.v1.CreateResponse" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:16:7: "micro.account.profile.v1.ProfileService.List" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:17:7: "micro.account.profile.v1.ProfileService.Get" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:18:7: "micro.account.profile.v1.ProfileService.Create" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:15:9: "micro.account.profile.v1.ProfileService" is already defined in file "e2e/profile_service.bloomrpc.proto".
srv/account/proto/profile/profile_service.proto:16:12: "micro.account.profile.v1.ListRequest" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto". To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:16:34: "micro.account.profile.v1.ListResponse" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto". To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:17:11: "micro.account.profile.v1.GetRequest" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto". To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:17:32: "micro.account.profile.v1.GetResponse" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto". To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:18:14: "micro.account.profile.v1.CreateRequest" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto". To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:18:38: "micro.account.profile.v1.CreateResponse" seems to be defined in "e2e/profile_service.bloomrpc.proto", which is not imported by "srv/account/proto/profile/profile_service.proto". To use it here, please add the necessary import.
srv/account/proto/profile/profile_service.proto:13:1: warning: Import third_party/proto/validate/validate.proto is unused.
from buf.
Not directly related to your issue, but also see https://buf.build/docs/build-configuration#root-requirements.
The general issue is you can't have a type defined in two places as part of your build - this is a general Protobuf requirement, not just a Buf requirement (and is also a requirement in most languages). There's some issue above where you have nearly the same file in two places.
Closing this issue unless there's something else. Let us know!
from buf.
@bufdev thanks for clarifying. I had e2e/profile_service.bloomrpc.proto
for documentation purpose only.
bloomrpc
tool cannot load.proto
files with certain validation rules. so I have to share slightly modifiedprofile_service.bloomrpc.proto
in my repo.
I am building my protos with Makefile
for f in ${TYPE}/${TARGET}/proto/**/*.proto; do \
protoc --proto_path=.:${GOPATH}/src \
--go_out=paths=source_relative:. \
--micro_out=paths=source_relative:. \
--gorm_out=engine=postgres,enums=string,paths=source_relative:. \
--validate_out=lang=go,paths=source_relative:. $$f; \
echo ✓ compiled: $$f; \
done \
is it possible to make Buf
truly ** exclude** some files from BUILD
and LINT
if I give .
as root
?
it is common to have some duplicate photo files in docs
or dist
folders
from buf.
Yes, see https://buf.build/docs/build-configuration#excludes
from buf.
Related Issues (20)
- `buf generate` does not use correct `buf.lock` when using `--config` with `git` source HOT 2
- Generate implicit dependencies HOT 4
- unknown extension grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema HOT 2
- WARN bufimagebuild File imports not found in your local dependencies HOT 4
- Fails to install on BSDs HOT 1
- Field plugin not found in type bufgen.ExternalPluginConfigV1 HOT 1
- Stubs are stored under the initial path where proto files can be found HOT 2
- Clarification on RPC and Request/Response Names HOT 2
- Error installing buf via go install HOT 1
- buf generate does not appear to respect buf.yaml excludes rules HOT 7
- `ignore`/`build.excludes` with glob/regex/pattern HOT 1
- language_version not specified in .pre-commit-hooks.yaml HOT 3
- buf generate get an error HOT 1
- buf build error on bazel external dependency HOT 4
- lint: Excluding a rule doesn't seem to work HOT 4
- Unable to use buf without bsr HOT 2
- Issues with protovalidate when linting a proto file with repeated fields and protovalidate constraints HOT 2
- Resource locking serializes concurrent buf executions? HOT 4
- field name contains a number HOT 1
- FIELD_SAME_ONEOF is not triggering HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buf.