Skip to content

Commit

Permalink
Delete buf protoc (bufbuild#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev authored Feb 4, 2022
1 parent fb07c55 commit 226dea7
Show file tree
Hide file tree
Showing 34 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
cmd/buf/buf
cmd/protoc-gen-buf-breaking/protoc-gen-buf-breaking
cmd/protoc-gen-buf-lint/protoc-gen-buf-lint
private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver
private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
private/buf/cmd/buf/workspacetests/other/proto/workspacetest/cache/
private/bufpkg/bufprotoplugin/cmd/protoc-gen-go-api/protoc-gen-go-api
private/bufpkg/bufprotoplugin/cmd/protoc-gen-go-apiclient/protoc-gen-go-apiclient
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/cmd/buf/buf
/cmd/protoc-gen-buf-breaking/protoc-gen-buf-breaking
/cmd/protoc-gen-buf-lint/protoc-gen-buf-lint
/private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver
/private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
/private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver
/private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer
/private/buf/cmd/buf/workspacetests/other/proto/workspacetest/cache/
/private/bufpkg/bufprotoplugin/cmd/protoc-gen-go-api/protoc-gen-go-api
/private/bufpkg/bufprotoplugin/cmd/protoc-gen-go-apiclient/protoc-gen-go-apiclient
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
`--include-imports`, this will result in the [Well-Known Types](https://github.com/bufbuild/wellknowntypes/tree/11ea259bf71c4d386131c1986ffe103cb1edb3d6/v3.19.4/google/protobuf)
being generated as well. Most language runtimes have the Well-Known Types included as part
of the core library, making generating the Well-Known Types separately undesirable.
- Remove `buf protoc`. This was a pre-v1.0 demonstration to show that `buf` compilation
produces equivalent results to mainline `protoc`, however `buf` is working on building
a better Protobuf future that provides easier mechanics than our former `protoc`-based
world. `buf protoc` itself added no benefit over mainline `protoc` beyond being considerably
faster and allowing parallel compilation. If `protoc` is required, move back to mainline `protoc`
until you can upgrade to `buf`. See [#915](https://github.com/bufbuild/buf/pull/915) for more
details.

## [v1.0.0-rc12] - 2022-02-01

Expand Down
4 changes: 2 additions & 2 deletions make/buf/all.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ GO_BINS := $(GO_BINS) \
private/pkg/licenseheader/cmd/license-header \
private/pkg/spdx/cmd/spdx-go-data
GO_TEST_BINS := $(GO_TEST_BINS) \
private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-receiver \
private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-writer
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver \
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer
DOCKER_BINS := $(DOCKER_BINS) buf
FILE_IGNORES := $(FILE_IGNORES) \
.build/ \
Expand Down
6 changes: 3 additions & 3 deletions private/buf/cmd/buf/buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"time"

"github.com/bufbuild/buf/private/buf/bufcli"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokencreate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget"
Expand Down Expand Up @@ -65,7 +66,6 @@ import (
"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/protoc"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/push"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin"
"github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout"
Expand Down Expand Up @@ -125,7 +125,6 @@ func NewRootCommand(name string) *appcmd.Command {
lint.NewCommand("lint", builder),
breaking.NewCommand("breaking", builder),
generate.NewCommand("generate", builder),
protoc.NewCommand("protoc", builder),
lsfiles.NewCommand("ls-files", builder),
push.NewCommand("push", builder),
{
Expand Down Expand Up @@ -284,9 +283,10 @@ func NewRootCommand(name string) *appcmd.Command {
},
{
Use: "alpha",
Short: "Alpha commands. Unstable and recommended only for experimentation.",
Short: "Alpha commands. Unstable and recommended only for experimentation. These may be deleted.",
Hidden: true,
SubCommands: []*appcmd.Command{
protoc.NewCommand("protoc", builder),
{
Use: "registry",
Short: "Manage assets on the Buf Schema Registry.",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var buftestingDirPath = filepath.Join(
"..",
"..",
"..",
"..",
"private",
"bufpkg",
"buftesting",
Expand Down
2 changes: 1 addition & 1 deletion private/buf/cmd/buf/command/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ as "proto/foo" is contained within "proto".
Plugins are invoked in the order they are specified in the template, but each plugin
has a per-directory parallel invocation, with results from each invocation combined
before writing the result. This is equivalent behavior to "buf protoc --by_dir".
before writing the result.
Insertion points are processed in the order the plugins are specified in the template.
`,
Expand Down
2 changes: 1 addition & 1 deletion private/bufpkg/bufimage/bufimagebuild/builder_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
func TestCompareGoogleapis(t *testing.T) {
testingextended.SkipIfShort(t)
// Don't run in parallel as it allocates a lot of memory
// cannot directly compare with source code info as buf protoc creates additional source
// cannot directly compare with source code info as buf alpha protoc creates additional source
// code infos that protoc does not
image := testBuildGoogleapis(t, false)
fileDescriptorSet := bufimage.ImageToFileDescriptorSet(image)
Expand Down
2 changes: 1 addition & 1 deletion private/bufpkg/bufmodule/bufmodulebuild/bufmodulebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type ModuleIncludeBuilder interface {
// NewModuleIncludeBuilder returns a new ModuleIncludeBuilder.
//
// TODO: we should parse includeDirPaths for modules as well in theory
// would be nice to be able to do buf protoc -I path/to/dir -I buf.build/foo/bar/v1
// would be nice to be able to do buf alpha protoc -I path/to/dir -I buf.build/foo/bar/v1
func NewModuleIncludeBuilder(
logger *zap.Logger,
storageosProvider storageos.Provider,
Expand Down
4 changes: 2 additions & 2 deletions windows/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ PATH="${DOWNLOAD_CACHE}/protoc/bin:${PATH}"
go install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION}
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION}
go install ./cmd/buf \
./private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-writer \
./private/buf/cmd/buf/command/protoc/internal/protoc-gen-insertion-point-receiver
./private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer \
./private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver
go test ./...

0 comments on commit 226dea7

Please sign in to comment.