Skip to content

Commit fe32cc1

Browse files
authored
Merge pull request protocolbuffers#225 from Logofile/sync
Documentation update
2 parents 50b97c8 + 758ead8 commit fe32cc1

File tree

13 files changed

+274
-88
lines changed

13 files changed

+274
-88
lines changed

content/best-practices/1-1-1.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ edition = "2023";
4242
4343
package my.package;
4444
45-
message StudentID {
45+
message StudentId {
4646
string value = 1;
4747
}
4848
```
@@ -114,7 +114,7 @@ package my.package;
114114
import "student_id.proto";
115115
116116
message GetStudentRequest {
117-
StudentID id = 1;
117+
StudentId id = 1;
118118
}
119119
```
120120

@@ -154,17 +154,17 @@ The service definition and each of the message definitions are each in their own
154154
file, and you use includes to give access to the messages from other schema
155155
files.
156156

157-
In this example, `Student`, `StudentID`, and `FullName` are domain types that
157+
In this example, `Student`, `StudentId`, and `FullName` are domain types that
158158
are reusable across requests and responses. The top-level request and response
159159
protos are unique to each service+method.
160160

161161
If you later need to add a `middle_name` field to the `FullName` message, you
162162
won't need to update every individual top-level message with that new field.
163163
Likewise, if you need to update `Student` with more information, all the
164-
requests and responses get the update. Further, `StudentID` might update to be a
164+
requests and responses get the update. Further, `StudentId` might update to be a
165165
multi-part ID.
166166

167-
Lastly, having even simple types like `StudentID` wrapped as a message means
167+
Lastly, having even simple types like `StudentId` wrapped as a message means
168168
that you have created a type that has semantics and consolidated documentation.
169169
For something like `FullName` you'll need to be careful with where this PII gets
170170
logged; this is another advantage of not repeating these fields in multiple

content/editions/features.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,29 @@ message MyMessage {
590590
}
591591
```
592592

593+
#### `features.(pb.java).large_enum` {#java-large_enum}
594+
595+
**Languages:** Java
596+
597+
This language-specific feature enables you to adopt new functionality that
598+
handles large enums in Java without causing compiler errors.
599+
600+
This is new behavior, so doesn't affect proto2 or proto3 schema definition
601+
files.
602+
603+
**Values available:**
604+
605+
* `true`: Java enums will use the new functionality.
606+
* `false`: Java enums will continue to use Java enums.
607+
608+
**Applicable to the following scopes:** Enum
609+
610+
**Default behavior in Edition 2023:** `false`
611+
612+
**Behavior in proto2:** `false`
613+
614+
**Behavior in proto3:** `false`
615+
593616
## Preserving proto2 or proto3 Behavior {#preserving}
594617

595618
You may want to move to the editions format but not deal with updates to the way

content/editions/overview.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,9 @@ as it applies the file-level setting. The `Employment` `enum`, though, will be
271271

272272
### Prototiller {#prototiller}
273273

274-
Currently, all conversions to editions format are handled by the Protobuf team.
275-
276-
When this shifts to a self-serve model, we will provide both a migration guide
277-
and migration tooling to ease the migration to and between editions. The tool,
278-
called Prototiller, will enable you to:
274+
When the Prototiller tool is launched, we will
275+
provide both a migration guide and migration tooling to ease the migration to
276+
and between editions. The tool will enable you to:
279277

280278
* convert proto2 and proto3 definition files to the new editions syntax, at
281279
scale

content/news/2024-12-04.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = "Changes announced for Protocol Buffers on December 4, 2024."
66
type = "docs"
77
+++
88

9-
We are planning to modify the Protobuf debug APIs (including Protobuf
9+
We are planning to modify the Protobuf debug APIs for C++ (including Protobuf
1010
AbslStringify, `proto2::ShortFormat`, `proto2::Utf8Format`,
1111
`Message::DebugString`, `Message::ShortDebugString`, `Message::Utf8DebugString`)
1212
in v30 to redact sensitive fields annotated by `debug_redact`; the outputs of

content/news/2025-01-23.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
+++
2+
title = "Changes announced January 23, 2025"
3+
linkTitle = "January 23, 2025"
4+
toc_hide = "true"
5+
description = "Changes announced for Protocol Buffers on January 23, 2025."
6+
type = "docs"
7+
+++
8+
9+
## Poison Java gencode
10+
11+
We are patching a change into the 25.x branch that will poison Java gencode that
12+
was created prior to the
13+
[3.21.7 release](https://github.com/protocolbuffers/protobuf/releases/tag/v21.7).
14+
We will then mark all versions of Java protobuf from 3.21.7 through 3.25.5 as
15+
vulnerable to the
16+
[footmitten CVE](https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-h4h5-3hr4-j3g2).
17+
18+
After this change is patched in, protobuf will throw an
19+
`UnsupportedOperationException` from the
20+
[`makeExtensionsImmutable`](https://protobuf.dev/reference/java/api-docs/com/google/protobuf/GeneratedMessage.html#makeExtensionsImmutable\(\))
21+
method unless you set the system property
22+
"`-Dcom.google.protobuf.use_unsafe_pre22_gencode`". Using this system property
23+
can buy you some time if you can't update your code immediately, but should be
24+
considered a short-term workaround.
25+
26+
## Poison MSVC + Bazel
27+
28+
We will be dropping support for using Bazel and MSVC together in v34. As of v30,
29+
we will poison this combination with an error unless you specify the opt-out
30+
flag `--define=protobuf_allow_msvc=true` to silence it.
31+
32+
MSVC's path length limits combined with Bazel's sandboxing have become
33+
increasingly difficult to support in combination. Rather than randomly break
34+
users who install protobuf into a long path, we will prohibit the use of MSVC
35+
from Bazel altogether. We will continue to support MSVC with CMake, and begin
36+
supporting [clang-cl](https://clang.llvm.org/docs/UsersManual.html#clang-cl)
37+
with Bazel. For any feedback or discussion, see
38+
https://github.com/protocolbuffers/protobuf/issues/20085.

content/news/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ New news topics will also be published to the
2020
The following news topics provide information in the reverse order in which it
2121
was released.
2222

23+
* [January 23, 2025](/news/2025-01-23) - Poison Java
24+
gencode
2325
* [December 18, 2024](/news/2024-12-18) - Go Protobuf:
2426
The new Opaque API
2527
* [December 13, 2024](/news/2024-12-13) - Removing

content/news/v25.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,20 @@ same to minimize the need for additional changes, but there are two exceptions:
4545
- The top-level `BUILD` file for μpb has moved into the `upb` directory. So,
4646
for example, references to `@upb//:reflection` should now be written
4747
`@com_google_protobuf//upb:reflection`.
48+
49+
## Poison Java gencode
50+
51+
We are patching a change into the 25.x branch that will poison Java gencode that
52+
was created prior to the
53+
[3.21.7 release](https://github.com/protocolbuffers/protobuf/releases/tag/v21.7).
54+
We will then mark all versions of Java protobuf from 3.21.7 through 3.25.5 as
55+
vulnerable to the
56+
[footmitten CVE](https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-h4h5-3hr4-j3g2).
57+
58+
After this change is patched in, protobuf will throw an
59+
`UnsupportedOperationException` from the
60+
[`makeExtensionsImmutable`](https://protobuf.dev/reference/java/api-docs/com/google/protobuf/GeneratedMessage.html#makeExtensionsImmutable\(\))
61+
method unless you set the system property
62+
"`-Dcom.google.protobuf.use_unsafe_pre22_gencode`". Using this system property
63+
can buy you some time if you can't update your code immediately, but should be
64+
considered a short-term workaround.

content/news/v30.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ This release will drop C++ 14 as the minimum supported version and raise it to
111111
Per [our policies](https://protobuf.dev/support/version-support), we do not
112112
consider this to be a breaking change.
113113

114-
## Introduce ASAN Poisoning After Clearing Oneof Messages on Arena
114+
### Introduce ASAN Poisoning After Clearing Oneof Messages on Arena
115115

116116
This change adds a hardening check that affects C++ protobufs using Arenas.
117117
Oneof messages allocated on the protobuf arena will now be cleared in debug and
@@ -120,7 +120,7 @@ region will cause a crash in ASAN as a use-after-free error.
120120

121121
This implementation requires C++17.
122122

123-
## Dropping our C++ CocoaPods release
123+
### Dropping our C++ CocoaPods release
124124

125125
In v30, we will be dropping our C++ CocoaPods release, which has been broken
126126
since v4.x.x. C++ users should use our
@@ -381,7 +381,23 @@ allocDescriptorForName:valueNames:values:count:enumVerifier:extraTextFormatInfo:
381381

382382
**Replacement:** Regenerate with a current version of the library.
383383

384-
## Other Changes {#non-breaking}
384+
## Other Changes {#other}
385+
386+
### Poison MSVC + Bazel
387+
388+
We will be dropping support for using Bazel and MSVC together in v34. As of v30,
389+
we will poison this combination with an error unless you specify the opt-out
390+
flag `--define=protobuf_allow_msvc=true` to silence it.
391+
392+
MSVC's path length limits combined with Bazel's sandboxing have become
393+
increasingly difficult to support in combination. Rather than randomly break
394+
users who install protobuf into a long path, we will prohibit the use of MSVC
395+
from Bazel altogether. We will continue to support MSVC with CMake, and begin
396+
supporting [clang-cl](https://clang.llvm.org/docs/UsersManual.html#clang-cl)
397+
with Bazel. For any feedback or discussion, see
398+
https://github.com/protocolbuffers/protobuf/issues/20085.
399+
400+
## Other Changes (Non-Breaking) {#non-breaking}
385401

386402
In addition to those breaking changes are some other changes worth noting. While
387403
the following are not considered breaking changes, they may still impact users.
@@ -399,7 +415,7 @@ v30 will includes a fix to make UTF-8 enforcement consistent across languages.
399415
Users with bad non-UTF8 data in string fields may see surfaced UTF-8 enforcement
400416
errors earlier.
401417

402-
## Ruby and PHP Errors in JSON Parsing
418+
### Ruby and PHP Errors in JSON Parsing
403419

404420
v30 fixes non-conformance in JSON parsing of strings in numeric fields per the
405421
[JSON spec](https://protobuf.dev/programming-guides/json/).

content/overview.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ std::string email = john.email();
233233
When defining `.proto` files, you can specify that a field is either `optional`
234234
or `repeated` (proto2 and proto3) or leave it set to the default, implicit
235235
presence, in proto3. (The option to set a field to `required` is absent in
236-
proto3 and strongly discouraged in proto2. For more on this, see "Required is
237-
Forever" in
238-
[Specifying Field Rules](/programming-guides/proto3#specifying-field-rules).)
236+
proto3 and strongly discouraged in proto2. For more on this, see [Required Fields Considered Harmful](/programming-guides/required-considered-harmful.md).)
239237
240238
After setting the optionality/repeatability of a field, you specify the data
241239
type. Protocol buffers support the usual primitive data types, such as integers,

content/programming-guides/deserialize-debug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ and a randomized-length whitespace sequence. The new debugging format looks as
2323
follows:
2424

2525
```none
26-
go/nodeserialize
26+
goo.gle/nodeserialize
2727
spii_field: [REDACTED]
2828
normal_field: "value"
2929
```

0 commit comments

Comments
 (0)