Mike Kruskal
3e3c83f0ca
Clarify staleness tests
...
- They will now output the regen command on failure
- On fork presubmits, they won't be named by branch
PiperOrigin-RevId: 562068279
1 year ago
Jie Luo
3e966f1dc9
Add lock to pure python's field decoders
...
Fix data race that may increase flake rate of some tests.
PiperOrigin-RevId: 562044867
1 year ago
Martijn Vels
e052928c94
Add dependency on absl::layout, and explicitly include absl layout includes
...
This header was transitively included from (deprecated) absl cord includes.
PiperOrigin-RevId: 562008066
1 year ago
Protobuf Team Bot
fa98bb316a
Auto-generate files after cl/561993644
1 year ago
Mike Kruskal
d0e8969166
Editions: Introduce an Edition enum and setup migration from strings
...
PiperOrigin-RevId: 561993644
1 year ago
Cong Liu
0a7a73d757
Remove redundant option: profile_driven_inline_string.
...
PiperOrigin-RevId: 561976278
1 year ago
Protobuf Team Bot
cb8da95e91
Fix SetExtension value semantics.
...
Move SetExtension common code out of header to protos.cc.
PiperOrigin-RevId: 561829364
1 year ago
Protobuf Team Bot
12d4f418a7
Comparing a proto message with an object of unknown returns NotImplemented
...
The Python comparison protocol requires that if an object doesn't know how to
compare itself to an object of a different type, it returns NotImplemented
rather than False. The interpreter will then try performing the comparison using
the other operand. This translates, for protos, to:
If a proto message doesn't know how to compare itself to an object of
non-message type, it returns NotImplemented. This way, the interpreter will then
try performing the comparison using the comparison methods of the other object,
which may know how to compare itself to a message. If not, then Python will
return the combined result (e.g., if both objects don't know how to perform
__eq__, then the equality operator `==` return false).
This change allows one to compare a proto with custom matchers such as mock.ANY
that the message doesn't know how to compare to, regardless of whether
mock.ANY is on the right-hand side or left-hand side of the equality (prior to
this change, it only worked with mock.ANY on the left-hand side).
Fixes https://github.com/protocolbuffers/protobuf/issues/9173
PiperOrigin-RevId: 561728156
1 year ago
Mike Kruskal
14222b30f7
Fix permissions of janitor GHA
...
PiperOrigin-RevId: 561707787
1 year ago
Hong Shin
fcebbd1442
Squelch snake case warnings for modules
...
PiperOrigin-RevId: 561697301
1 year ago
Protobuf Team Bot
9d75ac6145
Address -Wint-conversion issues.
...
PiperOrigin-RevId: 561684898
1 year ago
Protobuf Team Bot
0522054f3e
Workaround ICE on gcc 7.5 by not having one overload call the other one with a
...
const_cast.
Fixes https://github.com/protocolbuffers/protobuf/issues/13715
PiperOrigin-RevId: 561660761
1 year ago
Michael Diamond
a7eee92b66
Update reference to missing function JsonStringToBinary() ( #13581 )
...
Also tweaked the "simple wrapper" language since the implementation does not appear to delegate to JsonToBinaryStream() directly.
Closes #13581
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13581 from dimo414:dimo414-patch-1 7522ae1673
PiperOrigin-RevId: 561610218
1 year ago
Protobuf Team Bot
a773618181
Internal Code Change
...
PiperOrigin-RevId: 561592059
1 year ago
Protobuf Team Bot
32b20e596d
Auto-generate files after cl/561528198
1 year ago
Mike Kruskal
0cf3b66eac
Silence warnings about extra semicolon in non-TSAN builds.
...
Fixes https://github.com/protocolbuffers/protobuf/issues/13787
PiperOrigin-RevId: 561528198
1 year ago
Mike Kruskal
4d5ab7324e
Create a reflection helper for ExtensionIdentifier.
...
This will allow easy access to the FieldDescriptor of a generated extension.
PiperOrigin-RevId: 561480962
1 year ago
Jie Luo
9c76ea4413
Add upb python Py_mp_subscript for descriptor sequences.
...
A behavior diff that between upb and the other two implementations.
PiperOrigin-RevId: 561471616
1 year ago
Mike Kruskal
e897bcf3ff
Editions: Provide an API for C++ generators to specify their features.
...
This works for both built-in generators and plugins written in C++. Any feature extensions specified by this virtual method will end up fully resolved in the descriptors.
PiperOrigin-RevId: 561446773
1 year ago
Protobuf Team Bot
a3dfe32eeb
Set top and job level permissions for janitor.yml
...
It seems that the janitor.yml workflow only needs pull-requests: write permission -- to close the PRs. I've also granted the contents: read just in case.
PiperOrigin-RevId: 561444486
1 year ago
Protobuf Team Bot
403a32d0ab
Auto-generate files after cl/561422951
1 year ago
Alyssa Haroldsen
614e29f946
Implement v0.6 string fields
...
This is predominantly a wrapper around `BytesMut`, for simplicity.
Bytes and string fields are mostly the same, except for possible UTF-8 handling.
This also implements some minor parts of `ProtoStr` that were missed.
PiperOrigin-RevId: 561422951
1 year ago
Mike Kruskal
395bfe1d55
Cleanup Bazel/Bash CI commands
...
PiperOrigin-RevId: 561422532
1 year ago
dependabot[bot]
fa57b05755
Bump actions/setup-python from 4.5.0 to 4.7.0 ( #13766 )
...
Bumps [actions/setup-python](https://github.com/actions/setup-python ) from 4.5.0 to 4.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/setup-python/releases ">actions/setup-python's releases</a>.</em></p>
<blockquote>
<h2>v4.7.0</h2>
<p>In scope of this release, the support for reading python version from pyproject.toml was added (<a href="https://redirect.github.com/actions/setup-python/pull/669 ">actions/setup-python#669</a>).</p>
<pre lang="yaml"><code> - name: Setup Python
uses: actions/setup-python@v4
with:
python-version-file: pyproject.toml
</code></pre>
<h3>Besides, it includes such changes as:</h3>
<ul>
<li>Bump tough-cookie and <code>@azure/ms-rest-js</code> by <a href="https://github.com/dependabot "><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/697 ">actions/setup-python#697</a></li>
<li>Bump semver from 7.3.8 to 7.5.2 by <a href="https://github.com/dependabot "><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/692 ">actions/setup-python#692</a></li>
<li>Fix typos found by codespell by <a href="https://github.com/DimitriPapadopoulos "><code>@DimitriPapadopoulos</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/650 ">actions/setup-python#650</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/dariocurr "><code>@dariocurr</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/669 ">actions/setup-python#669</a></li>
<li><a href="https://github.com/DimitriPapadopoulos "><code>@DimitriPapadopoulos</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/650 ">actions/setup-python#650</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-python/compare/v4...v4.7.0 ">https://github.com/actions/setup-python/compare/v4...v4.7.0 </a></p>
<h2>v4.6.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix <code>allow-prereleases</code> sample configuration by <a href="https://github.com/mayeut "><code>@mayeut</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/615 ">actions/setup-python#615</a></li>
<li>Fix a incorrect link advanced-usage.md by <a href="https://github.com/siyuan0322 "><code>@siyuan0322</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/657 ">actions/setup-python#657</a></li>
<li>Remove implicit dependency by <a href="https://github.com/nikolai-laevskii "><code>@nikolai-laevskii</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/668 ">actions/setup-python#668</a></li>
<li>Automatic update of configuration files from 05/23/2023 by <a href="https://github.com/github-actions "><code>@github-actions</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/671 ">actions/setup-python#671</a></li>
<li>Add warning for python 2.7 on release/v4 by <a href="https://github.com/dmitry-shibanov "><code>@dmitry-shibanov</code></a> in <a href="https://redirect.github.com/actions/setup-python/pull/673 ">actions/setup-python#673</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/siyuan0322 "><code>@siyuan0322</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/657 ">actions/setup-python#657</a></li>
<li><a href="https://github.com/nikolai-laevskii "><code>@nikolai-laevskii</code></a> made their first contribution in <a href="https://redirect.github.com/actions/setup-python/pull/668 ">actions/setup-python#668</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/setup-python/compare/v4...v4.6.1 ">https://github.com/actions/setup-python/compare/v4...v4.6.1 </a></p>
<h2>Add allow-prereleases input</h2>
<p>In scope of this release we added a new input (<code>allow-prereleases</code>) to allow <a href="https://redirect.github.com/actions/setup-python/pull/414 ">falling back to pre-release versions of Python when a matching GA version of Python is not available</a></p>
<pre lang="yaml"><code>steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.12
allow-prereleases: true
</code></pre>
<p>Besides, we added such changes as:</p>
<ul>
<li>Fix bug to trim new line for PyPy version: <a href="https://redirect.github.com/actions/setup-python/pull/610 ">actions/setup-python#610</a></li>
<li>Added pip dependency file to generate hash from it: <a href="https://redirect.github.com/actions/setup-python/pull/604 ">actions/setup-python#604</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="61a6322f88
"><code>61a6322</code></a> Fix typos found by codespell (<a href="https://redirect.github.com/actions/setup-python/issues/650 ">#650</a>)</li>
<li><a href="ea5b57fccc
"><code>ea5b57f</code></a> Bump semver from 7.3.8 to 7.5.2 (<a href="https://redirect.github.com/actions/setup-python/issues/692 ">#692</a>)</li>
<li><a href="014d32a830
"><code>014d32a</code></a> Bump tough-cookie and <code>@azure/ms-rest-js</code> (<a href="https://redirect.github.com/actions/setup-python/issues/697 ">#697</a>)</li>
<li><a href="c16c4b8d18
"><code>c16c4b8</code></a> Fix pipenv jobs (<a href="https://redirect.github.com/actions/setup-python/issues/699 ">#699</a>)</li>
<li><a href="0d5da6a89a
"><code>0d5da6a</code></a> Read python version from pyproject.toml (fix <a href="https://redirect.github.com/actions/setup-python/issues/542 ">#542</a>) (<a href="https://redirect.github.com/actions/setup-python/issues/669 ">#669</a>)</li>
<li><a href="3f824b7ca6
"><code>3f824b7</code></a> remove python 2.7 from the tests (<a href="https://redirect.github.com/actions/setup-python/issues/687 ">#687</a>)</li>
<li><a href="bd6b4b6205
"><code>bd6b4b6</code></a> Add warning for python 2.7 (<a href="https://redirect.github.com/actions/setup-python/issues/673 ">#673</a>)</li>
<li><a href="0cbcb9a3d7
"><code>0cbcb9a</code></a> Merge pull request <a href="https://redirect.github.com/actions/setup-python/issues/668 ">#668</a> from akv-platform/disallow-implicit-dependencies</li>
<li><a href="669664dac1
"><code>669664d</code></a> Merge branch 'tool-config-auto-update' into disallow-implicit-dependencies</li>
<li><a href="9cbf792a3c
"><code>9cbf792</code></a> Update configuration files</li>
<li>Additional commits viewable in <a href="d27e3f3d7c...61a6322f88
">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-python&package-manager=github_actions&previous-version=4.5.0&new-version=4.7.0 )](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Closes #13766
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13766 from protocolbuffers:dependabot/github_actions/actions/setup-python-4.7.0 5e427982474c6dfb5304e50662f45d585acad73d
PiperOrigin-RevId: 561416587
1 year ago
Mike Kruskal
32eccf0b21
Delete obsolete code that searches the pool for "proto2.FeatureSet".
...
Feature resolution has been refactored in a way that made this dead code.
PiperOrigin-RevId: 561410946
1 year ago
Protobuf Team Bot
de59ed8541
Fix SetExtension to fuse the right arenas.
...
Also, make sure the operation has no side effects if the arenas can't be fused.
PiperOrigin-RevId: 561378595
1 year ago
Protobuf Team Bot
8985e978d5
Auto-generate files after cl/561344217
1 year ago
Protobuf Team Bot
d052b0849f
Fix arenaz wasted space reporting
...
Currently wasted space includes ArenaBlock header (24 bytes),
and never can be 0 even if blocks are used optimally.
Report 0 wasted space if blocks are used optimally.
PiperOrigin-RevId: 561347182
1 year ago
Keith Smiley
6f980073ac
[bazel] Update platforms ( #13509 )
...
Fixes https://github.com/protocolbuffers/protobuf/issues/13500
Closes #13509
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13509 from keith:ks/bazel-update-platforms d0e577f732
PiperOrigin-RevId: 561346885
1 year ago
Protobuf Team Bot
2454ae2cd1
Internal change
...
PiperOrigin-RevId: 561344217
1 year ago
Protobuf Team Bot
190a2bad35
Auto-generate files after cl/561288632
1 year ago
Protobuf Team Bot
293f0a3b31
protobuf: mark unlikely branch as so
...
Don't leave things to chance. We generally mark likely/unlikely
branches on hot paths as such.
PiperOrigin-RevId: 561288632
1 year ago
Protobuf Team Bot
e454cb50fc
Auto-generate files after cl/561272213
1 year ago
Protobuf Team Bot
89e7b1c7f1
proto: remove debug logging from opt build
...
The debug logging call makes SerialArena::AllocateFromExistingWithCleanupFallback function non-leaf and significantly worsens codegen (stack frame allocation + register spills). As the result it's also not inlined into ThreadSafeArena::AllocateAlignedWithCleanup.
With this change SerialArena::AllocateFromExistingWithCleanupFallback
becomes frame-less leaf function and is inlined into ThreadSafeArena::AllocateAlignedWithCleanup.
Codegen before:
00000000007b1820 <proto2::internal::ThreadSafeArena::AllocateAlignedWithCleanup(unsigned long, unsigned long, void (*)(void*))>:
7b1820: 48 c7 c0 40 fb ff ff mov $0xfffffffffffffb40,%rax
7b1827: 64 4c 8b 40 08 mov %fs:0x8(%rax),%r8
...
7b189f: e9 5c eb ff ff jmp 7b0400 <proto2::internal::SerialArena::AllocateFromExistingWithCleanupFallback(unsigned long, unsigned long, void (*)(void*))>
00000000007b0400 <proto2::internal::SerialArena::AllocateFromExistingWithCleanupFallback(unsigned long, unsigned long, void (*)(void*))>:
7b0400: 55 push %rbp
7b0401: 48 89 e5 mov %rsp,%rbp
7b0404: 41 56 push %r14
7b0406: 53 push %rbx
7b0407: 48 83 ec 10 sub $0x10,%rsp
...
7b04c3: 48 83 c4 10 add $0x10,%rsp
7b04c7: 5b pop %rbx
7b04c8: 41 5e pop %r14
7b04ca: 5d pop %rbp
7b04cb: c3 ret
7b04cc: 48 8d 35 44 a4 a9 ff lea -0x565bbc(%rip),%rsi # 24a917 <absl::debugging_internal::IdentifierIsAnonymousNamespace(absl::debugging_internal::State*, unsigned long)::anon_prefix+0x2e19e>
7b04d3: 4c 8d 75 e0 lea -0x20(%rbp),%r14
7b04d7: 4c 89 f7 mov %r14,%rdi
7b04da: ba f3 00 00 00 mov $0xf3,%edx
7b04df: e8 9c 05 1e 00 call 990a80 <absl::log_internal::LogMessageFatal::LogMessageFatal(char const*, int)>
7b04e4: 48 8d 35 3e 43 a6 ff lea -0x59bcc2(%rip),%rsi # 214829 <absl::Symbolize(void const*, char*, int)::kEllipsis+0xba26>
7b04eb: 4c 89 f7 mov %r14,%rdi
7b04ee: e8 cd f6 d0 ff call 4bfbc0 <absl::log_internal::LogMessage& absl::log_internal::LogMessage::operator<< <24>(char const (&) [24])>
7b04f3: 48 89 c7 mov %rax,%rdi
7b04f6: 89 de mov %ebx,%esi
7b04f8: e8 c3 a0 c9 ff call 44a5c0 <absl::log_internal::LogMessage::operator<<(int)>
7b04fd: 4c 89 f7 mov %r14,%rdi
7b0500: e8 1b e9 0c 00 call 87ee20 <absl::log_internal::LogMessageFatal::~LogMessageFatal()>
Codegen after:
00000000007b1680 <proto2::internal::ThreadSafeArena::AllocateAlignedWithCleanup(unsigned long, unsigned long, void (*)(void*))>:
7b1680: 49 c7 c0 40 fb ff ff mov $0xfffffffffffffb40,%r8
7b1687: 64 49 8b 40 08 mov %fs:0x8(%r8),%rax
...
7b17a5: c3 ret
name old cpu/op new cpu/op delta
BM_ArenaAllocWithCleanup/100 957ns ± 3% 868ns ± 1% -9.27% (p=0.000 n=54+48)
PiperOrigin-RevId: 561281492
1 year ago
Protobuf Team Bot
69f86a62f9
protobuf: add arena allocation with cleanup benchmark
...
Allocation with cleanup is quite different from the normal allocation.
Add a synthetic benchmark for it.
PiperOrigin-RevId: 561272213
1 year ago
Protobuf Team Bot
39feb83d60
Auto-generate files after cl/561268500
1 year ago
Marcel Hlopko
836c5c3af5
Internal change
...
PiperOrigin-RevId: 561268500
1 year ago
Protobuf Team Bot
0ef0214161
Auto-generate files after cl/561249277
1 year ago
Protobuf Team Bot
0d0701948d
protobuf: fix data race on SerialArena::string_block_
...
SpaceUsed reads string_block_ while AllocateFromStringBlockFallback
can be changing it concurrently. Make it an atomic.
PiperOrigin-RevId: 561249277
1 year ago
Protobuf Team Bot
17beb003ef
Auto-generate files after cl/561191678
1 year ago
Protobuf Team Bot
720c93c34e
Remove unused MaybeAllocateWithCleanup<T>
...
The function is only used for strings,
the generic version is dead code. Remove it.
PiperOrigin-RevId: 561241337
1 year ago
Shixin Li
d6a2f31c84
Internal change
...
PiperOrigin-RevId: 561191678
1 year ago
Protobuf Team Bot
4cda2e3941
Auto-generate files after cl/561187352
1 year ago
Adam Cozzette
0937be16c0
Update PHP and Ruby amalgamations in regenerate_stale_files.sh
...
This removes the need for us to manually rebuild these amalgamation files. I
added the "manual" tag to the corresponding staleness tests so that we won't
get presubmit errors if the amalgamation files are out of date. I also had to
tweak the Ruby BUILD.bazel file to make sure it uses Bazel-generated
amalgamations instead of relying on the checked-in files.
I added deliberate errors to the Ruby and PHP amalgamation files to test that
everything is working. We should not see any CI errors, and the files should
quickly be auto-updated after the change lands on main.
PiperOrigin-RevId: 561187352
1 year ago
Protobuf Team Bot
ee817d1ad1
Change Deep clone in generated code to call ::protos::internal::DeepClone instead of C runtime to prevent race.
...
Add test that reproduces race between copy constructor and PromoteExtension.
PiperOrigin-RevId: 561144816
1 year ago
Adam Cozzette
fa75cd454f
Update references to upb to point to the new location
...
I also deleted upb's `.github` directory since this is no longer used.
PiperOrigin-RevId: 561119238
1 year ago
Jie Luo
bf0451983d
Make upb python FieldDescriptor able to access the constant cpp type attributes
...
To match the same behavior with pure python and cpp extension
PiperOrigin-RevId: 561077787
1 year ago
Jie Luo
20faf56325
fix python code generation compatibility with Cython
...
raised by https://github.com/protocolbuffers/protobuf/pull/13593
PiperOrigin-RevId: 561077681
1 year ago
Protobuf Team Bot
9c9f9b4abb
Auto-generate files after cl/561057538
1 year ago
Hong Shin
bbe389eb72
Add test ensuring that rust keywords can be message names
...
PiperOrigin-RevId: 561057538
1 year ago