Skip to content

Commit

Permalink
Update the datawkt package to include files from protoc v26.1 (#2918)
Browse files Browse the repository at this point in the history
This new version adds `cpp_features.proto` and `java_features.proto` to
the set of files that ship with `protoc`.
  • Loading branch information
jhump committed Apr 26, 2024
1 parent 18a8934 commit 08b93e0
Show file tree
Hide file tree
Showing 5 changed files with 5,711 additions and 27 deletions.
2 changes: 1 addition & 1 deletion make/go/dep_protoc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(call _assert_var,CACHE_BIN)
# Settable
# https://github.com/protocolbuffers/protobuf/releases 20240313 checked 20240313
# NOTE: Set to version compatible with genproto source code (only used in tests).
PROTOC_VERSION ?= 26.0
PROTOC_VERSION ?= 26.1

ifeq ($(UNAME_OS),Darwin)
PROTOC_OS := osx
Expand Down
2 changes: 1 addition & 1 deletion private/buf/bufpluginexec/bufpluginexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const (
// DefaultMinorVersion is the default minor version.
defaultMinorVersion = 26
// DefaultPatchVersion is the default patch version.
defaultPatchVersion = 0
defaultPatchVersion = 1
// DefaultSuffixVersion is the default suffix version.
defaultSuffixVersion = ""
)
Expand Down
14 changes: 7 additions & 7 deletions private/buf/bufwkt/cmd/wkt-go-data/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"fmt"
"go/format"
"io"
"math"
"path/filepath"
"sort"
"strings"

"golang.org/x/exp/constraints"

Expand All @@ -45,12 +45,13 @@ const (
programName = "wkt-go-data"
pkgFlagName = "package"
protobufVersionFlagName = "protobuf-version"
sliceLength = math.MaxInt64
bytesPerLine = 20
)

var failedError = app.NewError( /* exitCode */ 100, "something went wrong")

func main() {
// TODO: The datawkt machinery would be WAY simpler if it just used go:embed instead.
appcmd.Main(context.Background(), newCommand())
}

Expand Down Expand Up @@ -284,15 +285,15 @@ const Version = "`)
`)
data := pathToData[path]
for len(data) > 0 {
n := sliceLength
n := bytesPerLine
if n > len(data) {
n = len(data)
}
accum := ""
var accum strings.Builder
for _, elem := range data[:n] {
accum += fmt.Sprintf("0x%02x,", elem)
_, _ = fmt.Fprintf(&accum, "0x%02x,", elem)
}
p(accum)
p(accum.String())
p("\n")
data = data[n:]
}
Expand Down Expand Up @@ -383,7 +384,6 @@ func EnumFilePath(enumName string) (string, bool) {
filePath, ok := enumNameToFilePath[enumName]
return filePath, ok
}
`)
formatted, err := format.Source(buffer.Bytes())
if err != nil {
Expand Down
5,718 changes: 5,701 additions & 17 deletions private/gen/data/datawkt/datawkt.gen.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion windows/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eo pipefail

PROTOC_VERSION="26.0"
PROTOC_VERSION="26.1"
PROTOC_GEN_GO_VERSION="v1.33.0"
CONNECT_VERSION="v1.16.1"

Expand Down

0 comments on commit 08b93e0

Please sign in to comment.