Commit Graph

795 Commits

Author SHA1 Message Date
Joe Tsai
cd108d00a8 encoding/protowire: make package publicly available
Change-Id: I95e293c208e787a91d50e29817620535dfeaa7f2
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/219838
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-20 07:42:18 +00:00
Joe Tsai
b738ac9285 all: regenerate remote .proto files
This fixes the conformance test failures which occur because the
conformance protos have not been regenerated.
The generator script has been modified with a sanity check that
files do not exist outside the expected sub-tree.

Change-Id: I473efec4a016f6bc96ddf7e20d54bcf5ff9b55fe
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223538
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-18 20:17:11 +00:00
Joe Tsai
6ad8e63055 compiler/protogen: allow specifying the package name with M flags
When using the M flags (which is functionally a mapping of
filenames to Go package paths), provide the user the ability to also
specify the package name by delimiting the package path with a ";".

Example usage:
	Mpath/to/foo.proto=path/to/foo_go_proto;foopb

This uses the exact same syntax as the go_package option where a
";" delimiter can be used to specify a package name.
It brings the M flags and the go_package option closer in behavior.

Change-Id: I98e1fbb66ec2f1b70b4143b305355e5ab35ea198
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223819
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-18 20:10:33 +00:00
Damien Neil
d3874051d7 internal/encoding/messageset: don't modify input data when unmarshaling
When combining multiple message fields in a MessageSet item (a case
which should never happen in practice), unmarshal could modify the input
data. Fix it to not do so. Add a general check to ensure that unmarshal
operations don't modify the input.

Change-Id: Idde46e6132a1dc96c374f9146efff81783c3bef3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223818
Reviewed-by: Joe Tsai <joetsai@google.com>
2020-03-18 05:27:34 +00:00
Joe Tsai
29677a9c11 types/dynamic: make Message implement legacy message interface
It's annoying for some users that they can't directly pass
*dynamicpb.Message to APIs that expect the legacy message interfaces.
The proto.MessageV1 wrappers work, but is somewhat suspect since they
were originally designed to wrap legacy generated messages.

Change-Id: I0f9900dcd1c9865c754551f8763680c9bb904813
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223817
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-17 23:08:45 +00:00
Joe Tsai
b4c73aa919 testing/protocmp: add SortRepeated and SortRepeatedFields
SortRepeated is similar to cmpopts.SortSlice where it accepts a
user-provided sort function, but only operates on repeated fields.
It pattern matches based on sort element type.

SortRepeatedFields is similar to SortRepeated, but chooses an
arbitrary sort order for the specified (by name) repeated fields.
It pattern matches based on message field name.

Change-Id: Ib6ef282e5394cf7b22522161d524f22e1b76677a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221432
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-17 22:58:48 +00:00
Damien Neil
aadba562d3 compiler/protogen: make paths=import work with M overrides
In the default .pb.go filename generation mode, we generate the filename
from the import path when a file has a go_package option and the source
.proto filename otherwise.

Change filename generation when an explicit mode of paths=import is
specified to always use the import path, no matter how it was
determiend. The practical effect is that you can override the import
path of a file with Mx.proto=import/path and have this behave
identically to setting a go_package option in the file.

Change-Id: I954b3f9d5fd17d08896629bfc77945dea1732bd6
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/219597
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2020-03-16 20:43:34 +00:00
Joe Tsai
92af527de9 internal/impl: remove Export.ExtensionDescFromType
This is no longer needed by the old implementation.

Change-Id: I3ba02d37f35f599ec790ec4e627258273883a308
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223279
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-13 23:34:19 +00:00
Joe Tsai
4ab2bc9bb7 internal/version: move version information to internal package
Change-Id: I947876de5d290cf783d9ba798871725e77e16517
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/223277
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-13 19:57:50 +00:00
Joe Tsai
f92988f900 all: upgrade protobuf to v3.11.4
This introduces some conformance test failures,
which occur not because our implementation changed behavior,
but because new cases were added.

Future work will be to investigate these failuress.

Change-Id: Ifb17465883c417acd46865744572f8cd0c858383
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222857
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-13 19:49:20 +00:00
Joe Tsai
f75a338d9c test.bash: update Go to v1.12.17, v1.13.8, and v1.14
Change-Id: I5c8627290f02c4506e7ea07f5dce903bfbfef00e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/212221
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-11 02:07:34 +00:00
Joe Tsai
a56bd81046 all: start v1.20.1-devel
Change-Id: Ie2940cd41fd3c449b2233e1bc3b6ba5ba91038f2
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222699
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 21:07:39 +00:00
Joe Tsai
290f718d07 all: release v1.20.1
Change-Id: I77c61b55d3c6aa540103ffe82c9dd226959bb753
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222698
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 21:07:25 +00:00
Joe Tsai
676bcfb6fd all: use github.com/golang/protobuf@v1.4.0-rc.4
Change-Id: Ic5f0bd644b4234204d90fa747b780409abf7917d
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222680
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 21:03:34 +00:00
Joe Tsai
1718d82dda README.md: add link to blog announcement
Change-Id: Ibeddd40f2a11bfb4ec60f917341513349e788f56
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222697
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 20:40:04 +00:00
Joe Tsai
e05f789c09 proto: fix signature of UnmarshalState and MarshalState
The pseudo-internal MarshalState and UnmarshalState method should
not have a seperate Message argument since it is passed in through
the extensible MarshalInput and UnmarshalInput values.

Change-Id: I838aadaee30e91cdf888ab024e65348c73c1cd7e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222678
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 20:02:17 +00:00
Joe Tsai
ea6e3da5ef internal/testprotos/legacy: avoid direct dependency on github.com/golang/protobuf
Change-Id: I42b17ae672a76d91ecbeeb2c12949002d7720524
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222677
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-09 19:39:04 +00:00
Damien Neil
e358d430e7 compiler/protogen: disable warnings in tests
Change-Id: I80ff3c31dc1039a833e6c962d5f3fc6e0aa46f6a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/222377
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2020-03-09 17:16:35 +00:00
renthraysk
a30b571f93 protobuf-go/internal/encoding/wire: SizeVarint optimisation
Replace division by 7 in SizeVarint(). The previous method was optimised by the compiler to use a 64bit multiplication.
This uses 9/64 as 1/7 and unsigned 32bit multiplication (which compiler can optimise further using scaling address modes, lea (ax,ax*8),ax)) and a shift.)

protobuf-go/internal/benchmarks/micro benchmark

name                            old time/op  new time/op  delta
EmptyMessage/Wire/Marshal-4     40.0ns ± 1%  39.9ns ± 5%    ~     (p=0.683 n=5+5)
EmptyMessage/Wire/Unmarshal-4   20.5ns ± 2%  20.3ns ± 2%    ~     (p=0.317 n=5+5)
EmptyMessage/Wire/Validate-4    21.5ns ± 0%  21.5ns ± 1%    ~     (p=0.825 n=4+5)
EmptyMessage/Clone-4             135ns ± 2%   136ns ± 1%    ~     (p=0.365 n=5+5)
RepeatedInt32/Wire/Marshal-4    4.06µs ± 1%  3.69µs ± 1%  -9.05%  (p=0.008 n=5+5)
RepeatedInt32/Wire/Unmarshal-4  4.72µs ± 0%  4.55µs ± 2%  -3.74%  (p=0.008 n=5+5)
RepeatedInt32/Wire/Validate-4   3.08µs ± 2%  2.94µs ± 0%  -4.69%  (p=0.008 n=5+5)
RepeatedInt32/Clone-4           1.09µs ± 1%  1.09µs ± 0%    ~     (p=0.810 n=5+5)
Required/Wire/Marshal-4          296ns ± 1%   293ns ± 0%  -0.95%  (p=0.000 n=5+4)
Required/Wire/Unmarshal-4        147ns ± 1%   135ns ± 1%  -8.17%  (p=0.008 n=5+5)
Required/Wire/Validate-4         127ns ± 2%   123ns ± 0%  -3.15%  (p=0.000 n=5+4)
Required/Clone-4                 393ns ± 1%   391ns ± 2%    ~     (p=0.238 n=5+5)

Change-Id: Idfe75a9cd80b2bddaf13a8e879403c0c94ebc419
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221803
Reviewed-by: Damien Neil <dneil@google.com>
2020-03-06 15:28:51 +00:00
Damien Neil
13e7f145cc reflect/protoregistry: avoid deadlock in registration
Under some rare circumstances registration can deadlock
when lazy descriptor initialization consults the registry.

Move the call triggering the lazy init out of the critical section.

Fixes golang/protobuf#1052.

Change-Id: Ic266e06b0db99fea65e797b879ce53e5342fff95
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/204804
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2020-03-05 17:35:16 +00:00
Damien Neil
e1c61a307e internal/encoding/messageset: fix decoding of some invalid data
For historical reasons, MessageSets items are allowed to have field
numbers outside the usual valid range. Detect the case where the field
number cannot fit in an int32 and report an error. Also check for
a field number of 0 (always invalid).

Handle the case where a MessageSet item includes an unknown field.
We have no place to put the contents of the field, so drop it. This is,
I believe, consistent with other implementations.

Change-Id: Ic403427e1c276cbfa232ca577e7a799cce706bc7
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221939
Reviewed-by: Herbie Ong <herbie@google.com>
2020-03-04 02:12:26 +00:00
Damien Neil
969537aa29 all: start post-v1.20.0 devel
Change-Id: I811fab64a8a22288760beef04021ded63bc4ea9b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221784
Reviewed-by: Herbie Ong <herbie@google.com>
2020-03-02 19:36:27 +00:00
Damien Neil
aa81c06513 all: release v1.20.0
Change-Id: I3bc9d46f836535393059b9a73e8364211eee9e38
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221783
Reviewed-by: Herbie Ong <herbie@google.com>
2020-03-02 18:51:28 +00:00
Damien Neil
0f2b33b67a reflect/protoregistry: add link to namespace conflict FAQ
Updates golang/protobuf#1039.

Change-Id: Ia9f80da5dab1e6cd3cf9ad512b78b63b32065c31
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221782
Reviewed-by: Herbie Ong <herbie@google.com>
2020-03-02 18:04:46 +00:00
Joe Tsai
fea7d5276d all: start v1.20.0-rc.1.devel
Change-Id: I7a88cf90c9b2ee61d6eae5019829362a7dce164f
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221598
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-29 07:48:10 +00:00
Joe Tsai
a6bf928d57 all: release v1.20.0-rc.1
Change-Id: I383cd3e94788f80b95f3ef7f1b86922fc0ea1db3
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221597
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-29 07:47:16 +00:00
Joe Tsai
65466b8cf4 all: update weak dependency to github.com/golang/protobuf@v1.4.0-rc.2
Change-Id: I1af402a44c8d113ce50e60523e4c6d8397dbb520
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221434
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-29 02:36:55 +00:00
Damien Neil
6e36304a32 reflect/protoreflect: ExtensionRangeOptions never returns nil
Documentation only change.

Change-Id: Ib620efc99bdaab90eeb5404554ae442f345d6f47
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221560
Reviewed-by: Joe Tsai <joetsai@google.com>
2020-02-28 23:53:49 +00:00
Joe Tsai
ab0ca4ff8a compiler/protogen: use consistent options pattern
Throughout the module options usually expressed as a struct where the
acting function is a method hanging off the options type.
Use this pattern for protogen as well.

Change-Id: I533a61387cb74971e4efc9313d400b66b8aac451
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221424
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-28 23:03:10 +00:00
Joe Tsai
c14e7899f9 testing/protocmp: fix reflection handling of extensions
Extensions should be checked based on ContainingMessage,
rather than the Parent. Add tests to ensure this works.

Change-Id: Iaf257f65197fb8d332039bc77a192753f8c4159f
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221426
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-28 21:49:08 +00:00
Joe Tsai
a56742be04 all: update README.md
Change-Id: I11f37f0563b1b15184da2fd4a5325231519aa03f
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221238
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-28 21:47:40 +00:00
Joe Tsai
ca0b25e48f testing/protocmp: automatically promote message values
For user convenience, automatically transform message values by
shallow copying them if necessary. Storing messages as values is
frowned upon, but is sometimes done by APIs that a user does not own.

Change-Id: I7e927d1a1e050bf4cea1aa889f56d23e99355f26
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221423
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-27 23:42:48 +00:00
Joe Tsai
a89afdc06f testing/protocmp: make Message implement proto.Message
By having the Message type implement proto.Message, it can be passed
to other general-purpose protobuf functions such as proto.Merge.
This provides a convenient way to convert the Message back into a
concrete form that may be easier to work with.

A minor consequence of this change is that invalid messages are
converted to an invalid Message that preserves type information.
Previously, they were simply transformed to a nil Message.

Change-Id: I6fca8a0879408c7f44a99d52734613302fa23f70
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221422
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-27 23:32:22 +00:00
Joe Tsai
781d6f396b testing/protocmp: add Filter options
This CL adds the following helper options:
	func FilterEnum(protoreflect.Enum, cmp.Option) cmp.Option
	func FilterMessage(proto.Message, cmp.Option) cmp.Option
	func FilterField(proto.Message, protoreflect.Name, cmp.Option) cmp.Option
	func FilterOneof(proto.Message, protoreflect.Name, cmp.Option) cmp.Option
	func FilterDescriptor(protoreflect.Descriptor, cmp.Option) cmp.Option

There is primarily exposing pre-existing functionality that the Ignore options
were already depending on to operate.

Change-Id: I44edf2ffa07de980a9ad3284525bfe3b45428d74
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/207177
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-27 23:16:30 +00:00
Damien Neil
075e0741aa internal/impl: fix non-atomic access of MessageState.mi
MessageState's mi field must only be accessed via atomic operations.
Rename the field to 'atomicMessageInfo' to make it incorrect access
obvious. Fix one incorrect non-atomic access.

Change-Id: If80343fb1b82186416f007ca5b340a4926b1cd3c
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221419
Reviewed-by: Joe Tsai <joetsai@google.com>
2020-02-27 20:50:32 +00:00
Joe Tsai
a786db3a49 .gitignore: cleanup
Remove the entry for fuzz-fuzz.zip which lives in a directory
that no longer exists.

Add a trailing slash to directories.

Change-Id: I23e0649a2326bc995f3bda41202b73270a1df4fc
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221024
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-26 19:42:08 +00:00
Damien Neil
5698f90d86 internal/impl: fix messageset validation bug
The validator was not ensuring the the MessageInfo for messageset
items was initialized. Fixed.

One or more of the existing messageset tests fail when run in isolation
due to this bug, but running all of them in sequence passes due to an
earlier test initializing the MessageInfo first.

Change-Id: Ifa7bd525c6d1cef9d1bed7bf761b0380907e35ee
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221023
Reviewed-by: Joe Tsai <joetsai@google.com>
2020-02-26 18:56:34 +00:00
Joe Tsai
e0daf31d84 all: trivial formatting changes
Changes:
* import grouping for third-party dependencies
* import grouping for generated protobufs
* blank space removal

Change-Id: I2950b0606bb2064046d79a23a78b05c23147cbfe
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221017
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-25 21:59:54 +00:00
Joe Tsai
ee3cfcba3f encoding: remove unused benchV1 flag
Change-Id: Ib86ab31ffa38f85cbb218c114f0e6697e3df61d8
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/221018
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-25 21:50:06 +00:00
Joe Tsai
f6cf4925a9 proto: add TestNil test
TestNil checks for panic behavior for all top-level functions that
accept messages to ensure that we can detect when behavior changes
whether accidentally or deliberately.

This test discovered that the pure protobuf reflect behavior
differs with the fast-path implementation for a few cases.

For the protobuf reflection implementation, we explicitly check
for invalid messages in Merge and Reset. Previously, these would
not panic if the message was already empty (i.e., had no need to
actually set/clear any fields in the receiver message).

Change-Id: I571c0a819366bae993ce7c99b05fb4707e55cd3e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220958
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-25 20:33:07 +00:00
Joe Tsai
49f8611134 proto: allow nil with Clone
The v1 behavior of Clone returned nil as is.
Replicate this behavior in v2 for easier migration.

Change-Id: I79d93f15dd9913604027e31e5d9ff309e0c2da61
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220437
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-25 19:13:35 +00:00
Joe Tsai
ec552f691d runtime/protoiface: trivial change to Size
Remove named input argument to be consistent with other methods.

Change-Id: I22c48abf76e007a1319bfb037bbb2b7bfb66cee7
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220688
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-02-25 10:28:07 +00:00
Joe Tsai
2dabbe4711 proto: remove IsInitialized
Change-Id: I919286f2c0d564aaca792025bb29264884c4c81f
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220348
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-24 22:37:49 +00:00
Joe Tsai
bb941fe881 cmd/protoc-gen-go/testdata: remove go.mod file
In the distant past this was necessary because:
1) the generated code depended on github.com/golang/protobuf,
but now it doesn't.
2) protoc-gen-go-grpc had a dependency on google.golang.org/grpc,
and the seperate go.mod file allowed us to isolate the dependency,
but that binary doesn't exist here anymore.

Drop the go.mod file for cmd/protoc-gen-go/testdata.

Change-Id: I7341d78dc346bd82e5c68ed48cee3275b6296249
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220502
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-24 22:15:38 +00:00
Joe Tsai
9118b11cd8 all: update contributing documentation
Change-Id: I2815e570696fd5ffc765c42ffc26060fc4aa5a2b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220677
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-24 22:15:07 +00:00
Joe Tsai
764a9d16a6 cmd/protoc-gen-go: add link to devsite for protoc-gen-go
Change-Id: I67a0897df42e177782ec76bb307ea2334f86975e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220596
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-24 22:13:41 +00:00
Joe Tsai
222a0006a6 compiler/protogen: add devsite URL to protogen warnings
Change-Id: Ida47b31a4f62d00d9f756da6da98cd852f36bb69
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220594
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-24 20:14:07 +00:00
Damien Neil
37cbbeb558 internal/impl: check for size cache overflow
The size cache is an int32. Store a -1 in it if the message size
overflows, and fall back to recomputing the size if the value is
negative. This means lamentable O(N^2) costs in marshaling,
but that's better than silently producing invalid output.

Also considered: Return an error. Avoids O(N^2) behavior, but gives the
user no good choices if they don't care the output being slow. Encoding
costs of messages this large are likely to be dominated by copying the
bytes rather than the size operation anyway, so slow-but-correct seems
like the most generally useful option.

We could store valid values for the range (0x7fffffff,0xfffffffe)
reserving only 0xffffffff as the overflow sentinel, but optimizing this
case seems less important than the code being obviously correct.

Fixes golang/protobuf#970.

Change-Id: I44f59ff81fdfbc8672dd5aec959d5153a081aab9
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220593
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2020-02-24 20:12:47 +00:00
Joe Tsai
a88c3c4068 all: remove reliance on --compact-summary
This flag is recently added to git. Avoid it for now.

Change-Id: I007f3cc12ec6ef37bc6d70ddc346b7af7983879e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220501
Reviewed-by: Damien Neil <dneil@google.com>
2020-02-22 01:19:34 +00:00
Damien Neil
4d8936d0db all: fail faster on dirty working tree
It's annoying to get through all the tests for five different language
versions to discover at the end that you've got an uncommitted file
sitting around in your working tree, or you forgot to run
regenerate.bash.

Report uncommitted changes at the start of tests (so you can ^C and
fix the problem right off if you didn't know about it), but hold off on
failing the test until the end so you can still run tests on uncommitted
changes.

Fail immediately if generated files are out of date.

Change-Id: I12feaecaa3c5038ac0a4cca9cc9ff3447b57a08a
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/220517
Reviewed-by: Joe Tsai <joetsai@google.com>
2020-02-21 19:16:35 +00:00