Skip to content

Commit 8fce3a0

Browse files
Update the cross version guarantee to reflect the Java unbreaking changes.
PiperOrigin-RevId: 816390326
1 parent d6822a4 commit 8fce3a0

File tree

1 file changed

+39
-27
lines changed

1 file changed

+39
-27
lines changed

content/support/cross-version-runtime-guarantee.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ type = "docs"
77

88
<link rel="stylesheet" href="/includes/version-tables.css">
99

10-
Protobuf language bindings have two components. The generated code (typically
11-
produced from `protoc`) and the runtime libraries that must be included when
12-
using the generated code. When these come from different releases of protobuf,
13-
we are in a "cross version runtime" situation.
10+
Protobuf language bindings have two components. The generated code (gencode) and
11+
the runtime libraries that implement common functionality for that generated
12+
code. When these come from different releases of protobuf, we are in a "cross
13+
version runtime" situation.
1414

1515
We intend to offer the following guarantees across most languages. These are the
1616
default guarantees; however, owners of protobuf code generators and runtimes may
@@ -38,18 +38,30 @@ gencode with an older runtime.
3838

3939
## Major Versions {#major}
4040

41-
Starting with the 2025Q1 release, the protobuf project will adopt a rolling
42-
compatibility window for major versions. Code generated for a major version V
43-
(full version: V.x.y) will be supported by protobuf runtimes of version V and
44-
V+1.
41+
Protobuf implements sliding window compatibility for major versions. Code
42+
generated for a major version V (full version: V.x.y) will be supported by
43+
protobuf runtimes of major version V and V+1.
4544

46-
Prior to this policy, code generated for 3.22.x+ (release ~1 year prior to major
47-
version 4) will still be supported by protobuf runtimes of version 3 and 4.
48-
Users with older gencode should upgrade to the latest gencode from 3.25.x.
45+
Protobuf will **not** support using gencode from version V with runtime &gt;=
46+
V+2 and will be using a "poison pill" mechanism to fail with a clear error
47+
message when a software assembly attempts to use such a configuration.
4948

50-
Protobuf will not support using gencode from version V with runtime &gt;= V+2
51-
and will be using a "poison pill" mechanism to fail with a clear error message
52-
when a software assembly attempts to use such a configuration.
49+
For Example:
50+
51+
* Java code generated by protobuf version 3.0.0 will work with runtimes 3.0.0
52+
to 4.x.y but **not** with runtimes 2.0.0 to 2.x.y or runtimes &gt;= 5.0.0.
53+
* Java code generated by protobuf version 4.27.2 will work with runtimes
54+
4.27.2 to 5.x.y but **not** runtimes 2.0.0 to 4.27.1 or runtimes &gt;= 6.0.0
55+
56+
Exceptions may be made in case where compatibility with older gencode *cannot*
57+
be maintained, such as in the case of [security](#exception) fixes requiring
58+
updated gencode.
59+
60+
**Note:** Poison pills were introduced in the protobuf 26.0 release. Java
61+
gencode older than 4.26.0 may *appear* to work with runtimes that are older than
62+
the gencode. However, the combination of
63+
[newer gencode and older runtime](#backwards) may have serious bugs that do not
64+
manifest until runtime.
5365

5466
**Note:** [C++ and Rust](#cpp) do not support compatibility windows, and
5567
[Python](#python) supports much longer ones.
@@ -67,11 +79,11 @@ versions.
6779
We reserve the right to violate the above promises if needed for security
6880
reasons. We expect these exceptions to be rare, but will always prioritize
6981
security above these guarantees. For example,
70-
[footmitten](https://cve.report/CVE-2022-3510) required paired updates to both
71-
the runtime and the generated code for Java. As a result, code generated by
72-
3.20.3 (which contained the footmitten fix) would not load with runtime library
73-
3.21.6 (which predates the footmitten fix), creating the following compatibility
74-
matrix:
82+
[the footmitten CVE](https://cve.report/CVE-2022-3510) required paired updates
83+
to both the runtime and the generated code for Java. As a result, code generated
84+
by 3.20.3 (which contained the footmitten fix) would not load with runtime
85+
library 3.21.6 (which predates the footmitten fix), creating the following
86+
compatibility matrix:
7587

7688
<table>
7789
<tr>
@@ -88,23 +100,23 @@ matrix:
88100
<td rowspan="4">Runtime<br>Version</td>
89101
<td class="gray">3.20.2</td>
90102
<td class="yellow">Vuln</td>
91-
<td class="red"><b>Broken</b></td>
92-
<td class="yellow"><b>Vuln</b></td>
93-
<td class="red"><b>Broken</b></td>
103+
<td class="red"><b>!Broken!</b></td>
104+
<td class="yellow"><b>!Vuln!</b></td>
105+
<td class="red"><b>!Broken!</b></td>
94106
</tr>
95107
<tr>
96108
<td class="gray">3.20.3</td>
97109
<td class="yellow">Vuln</td>
98110
<td class="green">Works</td>
99-
<td class="yellow"><b>Vuln</b></td>
100-
<td class="green"><b>Works?</b></td>
111+
<td class="yellow"><b>!Vuln!</b></td>
112+
<td class="green"><b>!Works?!</b></td>
101113
</tr>
102114
<tr>
103115
<td class="gray">3.21.6</td>
104116
<td class="yellow">Vuln</td>
105117
<td class="red">Broken</td>
106118
<td class="yellow">Vuln</td>
107-
<td class="red"><b>Broken</b></td>
119+
<td class="red"><b>!Broken!</b></td>
108120
</tr>
109121
<tr>
110122
<td class="gray">3.21.7</td>
@@ -120,8 +132,8 @@ matrix:
120132
* “Works” indicates that the combination will successfully start and does not
121133
have the vulnerability.
122134
* “Broken” indicates that the combination will not successfully start.
123-
* **Bold** indicates configurations that were never deliberately intended to
124-
function together given the guarantees outlined in this topic.
135+
* **!Bold!** indicates configurations that mix newer gencode with older
136+
runtime and were never intended to work together.
125137

126138
## No Coexistence of Multiple Major Runtime Versions {#coexist}
127139

0 commit comments

Comments
 (0)