Go support for Google's protocol buffers
Go to file
Joe Tsai bab3d4084e runtime/protoimpl, cmd/protoc-gen-go: support release versioning
In order for protoc-gen-go to output the current version,
it needs to know what version it is currently running as.
However, we cannot rely on the git tags since the tags are not
made until *after* the commit has been submitted.
Instead, we manually encode the version into the code and
make sure that git tags match up with the version in the code.

The version.go file in runtime/protoimpl contains instructions
for how to make a release. Essentially:
* Every non-release commit has a version string with "devel" in it.
* Every release commit must not have "devel" in it and must be unique.
* The "release process" involves submitting two CLs.
The first CL creates a version string without "devel",
which is the commit that a git tag will actually reference.
The second CL follows immediately and re-introduces "devel"
into the version string.

The following example shows a possible sequence of VersionStrings
for git commits in time-ascending order:
	v1.19.0-devel      (this CL)
	v1.19.0-devel
	v1.19.0-devel
	v1.19.0-devel
	v1.20.0-rc.1       <- tagged
	v1.20.0-rc.1.devel
	v1.20.0-rc.1.devel
	v1.20.0-rc.1.devel
	v1.20.0-rc.2       <- tagged
	v1.20.0-rc.2.devel
	v1.20.0            <- tagged (future public release)
	v1.20.0-devel
	v1.20.0-devel
	v1.20.0-devel
	v1.20.0-devel
	v1.20.1            <- tagged
	v1.20.1-devel
	v1.20.1-devel
	v1.21.0            <- tagged
	v1.21.0-devel

Note that we start today with v1.19.0-devel, which means that our initial
release will be v1.20.0. This number was intentionally chosen since
1) the number 20 has some correlation to the fact that we keep calling
the new implementation the "v2" implementation, and
2) the set of tagged versions for github.com/golang/protobuf
and google.golang.org/protobuf are unlikely to ever overlap.
This way, the version of protoc-gen-go is never ambiguous which module
it was built from.

Now that we have version information, we add support for generating .pb.go
files with the version information recorded. However, we do not emit
these for .pb.go files in our own repository since they are always guaranteed
to be at the right version (enforced by integration_test.go).

Updates golang/protobuf#524

Change-Id: I25495a45042c2aa39a39cb7e7738ae8e831a9d26
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/186117
Reviewed-by: Damien Neil <dneil@google.com>
2019-08-07 22:59:30 +00:00
benchmarks benchmarks: move download_benchdata.bash into benchmarks/ dir 2019-07-09 22:36:27 +00:00
cmd runtime/protoimpl, cmd/protoc-gen-go: support release versioning 2019-08-07 22:59:30 +00:00
compiler/protogen compiler/protogen, cmd/protoc-gen-go: use alternative comments API 2019-08-07 06:00:36 +00:00
encoding runtime/protoimpl, cmd/protoc-gen-go: support release versioning 2019-08-07 22:59:30 +00:00
internal runtime/protoimpl, cmd/protoc-gen-go: support release versioning 2019-08-07 22:59:30 +00:00
proto all: remove dead code 2019-08-06 21:16:48 +00:00
reflect runtime/protoimpl, cmd/protoc-gen-go: support release versioning 2019-08-07 22:59:30 +00:00
runtime runtime/protoimpl, cmd/protoc-gen-go: support release versioning 2019-08-07 22:59:30 +00:00
testing/prototest all: add NewField, NewElement, NewValue 2019-08-06 21:54:30 +00:00
types runtime/protoimpl, cmd/protoc-gen-go: support release versioning 2019-08-07 22:59:30 +00:00
.gitignore .gitignore: add policy for new entries 2019-08-06 21:42:16 +00:00
.travis.yml .travis.yml: configure for OSX 2019-03-13 18:04:08 +00:00
AUTHORS
CONTRIBUTING.md
CONTRIBUTORS
go.mod all: update to github.com/golang/protobuf@b9f5089f 2019-07-18 00:01:40 +00:00
go.sum all: update to github.com/golang/protobuf@b9f5089f 2019-07-18 00:01:40 +00:00
integration_test.go all: implement proto1 weak fields 2019-07-15 18:44:12 +00:00
LICENSE
PATENTS
README.md
regenerate.bash internal/cmd/generate-protos: generate test for testdata 2019-03-11 19:40:53 +00:00
test.bash test.bash: add -failfast flag 2019-08-05 21:48:09 +00:00

Next Generation Go Protocol Buffers

WARNING: This repository is in active development. There are no guarantees about API stability. Breaking changes will occur until a stable release is made and announced.

This repository is for the development of the next major Go implementation of protocol buffers. This library makes breaking API changes relative to the existing Go protobuf library. Of particular note, this API aims to make protobuf reflection a first-class feature of the API and implements the protobuf ecosystem in terms of reflection.

Design Documents

List of relevant design documents:

Contributing

We appreciate community contributions. See CONTRIBUTING.md.

Reporting Issues

Issues regarding the new API can be filed at github.com/golang/protobuf. Please use a APIv2: prefix in the title to make it clear that the issue is regarding the new API work.