-
Notifications
You must be signed in to change notification settings - Fork 16
Add support for buf to generate protos #86
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,9 @@ generate: protos | |
|
|
||
| protos: | ||
| @echo "$(WHALE) $@" | ||
| @(cd ${ROOTDIR}/api && PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${API_PACKAGES}) | ||
| @(cd ${ROOTDIR}/api && buf dep update) | ||
| @(cd ${ROOTDIR}/api && PATH="${ROOTDIR}/bin:${PATH}" buf generate) | ||
| @(cd ${ROOTDIR}/api && buf build --exclude-imports -o next.txtpb) | ||
|
Comment on lines
+99
to
+101
|
||
| go-fix-acronym -w -a '^Os' $(shell find api/ -name '*.pb.go') | ||
| go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ -name '*.pb.go') | ||
|
|
||
|
|
@@ -108,8 +110,8 @@ check-protos: protos ## check if protobufs needs to be generated again | |
|
|
||
| check-api-descriptors: protos ## check that protobuf changes aren't present. | ||
| @echo "$(WHALE) $@" | ||
| @test -z "$$(git status --short | grep ".pb.txt" | tee /dev/stderr)" || \ | ||
| ((git diff $$(find . -name '*.pb.txt') | cat) && \ | ||
| @test -z "$$(git status --short | grep ".txtpb" | tee /dev/stderr)" || \ | ||
| ((git diff $$(find . -name '*.txtpb') | cat) && \ | ||
| (echo "$(ONI) please run 'make protos' when making changes to proto files and check-in the generated descriptor file changes" && false)) | ||
|
|
||
| proto-fmt: ## check format of proto files | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| version: v2 | ||
| plugins: | ||
| - remote: buf.build/protocolbuffers/go:v1.28.1 | ||
| out: . | ||
| opt: | ||
| - module=github.com/containerd/nerdbox/api | ||
| - Mgoogle/rpc/status.proto=google.golang.org/genproto/googleapis/rpc/status | ||
| - local: protoc-gen-go-ttrpc | ||
| out: . | ||
| opt: | ||
| - module=github.com/containerd/nerdbox/api | ||
| - prefix=TTRPC |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Generated by buf. DO NOT EDIT. | ||
| version: v2 | ||
| deps: | ||
| - name: buf.build/containerd/api-dev | ||
| commit: f5087db925de43418b7d3653b696e1df | ||
| digest: b5:97797fd6f6ab6cdd8f36de346ab539657348f4ff9cb37a5cb0c006447d354c8a46193131048defd4ad18e494fb9481ef23aafd9e9c9b6745d4b2a66f6786caff | ||
| - name: buf.build/googleapis/googleapis | ||
| commit: 004180b77378443887d3b55cabc00384 | ||
| digest: b5:e8f475fe3330f31f5fd86ac689093bcd274e19611a09db91f41d637cb9197881ce89882b94d13a58738e53c91c6e4bae7dc1feba85f590164c975a89e25115dc |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| version: v2 | ||
| deps: | ||
| - buf.build/googleapis/googleapis | ||
| - buf.build/containerd/api-dev | ||
| modules: | ||
| - path: . |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
npm install @bufbuild/bufstep installs thebufCLI intonode_modules/.bin, but this directory is not added toPATH, so subsequentmakeinvocations that callbuf(via theprotostarget) will fail withbuf: command not foundon a clean runner. Consider either installing Buf globally (e.g. using a dedicated Buf GitHub Action ornpm install -g @bufbuild/buf) or adjusting the workflow/Makefile to invokenpx bufor to add./node_modules/.bintoPATHbefore runningmake.