This doesn't change the tests at all, but refactors them to be more reusable in different contexts. Specifically, this will make it easier to add corresponding editions-based tests. This also splits the concept of "uses a proto3 message" and "runs proto3 tests", in preparation for that change.
PiperOrigin-RevId: 574299923
The switch from aggregate initialization to explicit constructors in `Impl_` has been enabled since 09/06, and no issues have been reported or found. This change removes the back-out option and code from the various sources for aggregate initialization.
PiperOrigin-RevId: 574161896
addresses https://github.com/protocolbuffers/protobuf/issues/12714 by dumping more concise debug info for protobuf messages and repeated fields via the `serializeToJsonString` function. Additionally, message types which serialize into something other than an array (e.g. `Google\Protobuf\Value`, `Google\Protobuf\Timestamp`, etc) are handled in a special way to make their output consistent with other messages.
```php
$m = new Google\Protobuf\DoubleValue();
$m->setValue(1.5);
var_dump($m);
```
will output
```
object(Google\Protobuf\DoubleValue)#12 (1) {
["value"]=>
float(1.5)
}
```
Closes#12718
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12718 from bshaffer:php-add-debuginfo c40a6f91de
PiperOrigin-RevId: 574115431
`Options` is a fairly heavy class and not easy to initialize, and not required for the common functions we change here allowing a lower bar for re-use.
PiperOrigin-RevId: 573920014
We continue our foray into googletest-rust [1], this time with homegrown matchers.
Our unit tests will now be able to check is_unset() and is_set() for all types that implement ProxiedWithPresence. In practice, this boils down to [u8] and ProtoStr.
Note that we've broken out matchers_upb and matchers_cpp, similar to what was done with aliasing here [2].
[1] https://github.com/google/googletest-rust
[2] 9a0bc392b3 (diff-08e5182ff36ad340a3bfb628995524a2a36a89b59a514ba027b0f25e048dd5c3R90)
PiperOrigin-RevId: 573895179
We're adding googletest-rust as a dependency for our rust tests, so let's ensure that our opensource build has access to the same crates.
PiperOrigin-RevId: 573863399
We had previously commented out the upb portion of simple_nested_test.
This is because nonmutable getters have submessages being NULL by default.
This means that trying to fetch anything, like a simple scalar from that nested message would segfault.
This CL makes the externC return an Option<RawMessage> since we've discovered that upb can return NULL. This way, we can check for `None` and handle the NULL case appropriately.
We know that the NULL pathway can only come from terra upb, since
cpp automagically constructs submsgs if they don't exist.
We've augmented upb.rs to contain a scratch space that allocates a zeroed-out contiguous chunk of memory @64KB. Since a block of zeroed-out memory is a legit message from upb's point of view, we can provide $pbr$::ScratchSpace::zeroed_block() to upb in order to get the default submessage behavior we want from upb.
This block is lazily allocated upon first request. This means that a consumer of the cpp kernel will not incur an additional cost.
PiperOrigin-RevId: 573840755
This is likely the cause of our macos cmake flakes. Both the lite and full tests trigger codegen of the lite protos, but there's no dependency between them. This creates a race condition, where it's possible for the files to be invalid by the time one of their builds is triggered. This is consistent with the error message we see:
liblibtest_common_lite.a(unittest_lite.pb.cc.o) has no symbols
PiperOrigin-RevId: 573381442
This simplifies the logic when the type of a field is only known at a later time (when the field is resolved).
This brings upb in line with the C++ behavior.
PiperOrigin-RevId: 573338934
Multiple typos has been fixed.
- docs/upb/design.md -> line no 291: changed 'newMessageAccesor' to 'newMessageAccessor '
- docs/design/editions/edition-zero-features.md -> line no 149: changed 'implict' to 'implicit'
Closes#14385
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14385 from parikshitadhikari:patch d9bf9f91be
PiperOrigin-RevId: 573315890
This PR is fixing small inconsistencies in the paths where the protobuf compiler is searched for in the protobuf python setup.py.
Closes#14318
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14318 from ottmar-zittlau:main 598d13406f
PiperOrigin-RevId: 573315569
The current logic of finding a suitable include path relies on CMake to always return a meaningful relative path. On Windows, however, if the two paths reside on different drives (e.g. `c:/Users/Me` and `d:/project/`) the absolute path gets returned unaltered. This yields the invalid final path `c:/Users/Me/d:/project/`.
This case is now detected and the corresponding include path is deemed unsuitable.
(fixes#9290)
Closes#14025
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14025 from cgudrian:issue-9290-wrong-relative-path-in-protobuf-generate 3c0fd37324
PiperOrigin-RevId: 573315544
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.24.0 to 2.26.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/shivammathur/setup-php/releases">shivammathur/setup-php's releases</a>.</em></p>
<blockquote>
<h2>2.26.0</h2>
<h2>Changelog</h2>
<h3>Microsoft SQL Server extensions. (<a href="https://redirect.github.com/shivammathur/setup-php/issues/758">#758</a>, <a href="https://redirect.github.com/shivammathur/setup-php/issues/766">#766</a>)</h3>
<p>The latest supported version of <code>sqlsrv</code> and <code>pdo_sqlsrv</code> for the PHP version will be installed.
Also, on Windows, these extensions will be installed from <a href="https://github.com/microsoft/msphpsql"><code>microsoft/msphpsql</code></a> GitHub releases and will fallback to <code>pecl</code>.</p>
<pre lang="yaml"><code>- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: sqlsrv, pdo_sqlsrv
</code></pre>
<h3>PHP 8.4 Support (<a href="https://redirect.github.com/shivammathur/setup-php/issues/762">#762</a>)</h3>
<p>Added support for PHP <code>8.4.0-dev</code> from the master branch of <a href="https://github.com/php/php-src"><code>php/php-src</code></a> for all supported OS.
<strong>Note</strong>: PHP <code>8.3.0-dev</code> is now built from the new <a href="https://github.com/php/php-src/tree/PHP-8.3"><code>PHP-8.3</code></a> branch.</p>
<pre lang="yaml"><code>- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
</code></pre>
<h2>Fixes</h2>
<h3>Blackfire Player</h3>
<p>Resolved issues affecting the <code>blackfire-player</code> on Linux and macOS. It now installs the <code>uuid</code> extension that is required for the tool.
Dropped support for it on Windows as <code>uuid</code> extension is not available for the OS.</p>
<pre lang="yaml"><code>- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
tools: blackfire-player
</code></pre>
<h2>Updates</h2>
<h3>Update actions/checkout</h3>
<p>Updated the use of <code>actions/checkout</code> to v4 in the documentation and workflows.</p>
<pre lang="yaml"><code>- name: Checkout
uses: actions/checkout@v4
</code></pre>
<h3>Update Node.js Version</h3>
<p><strong>Note</strong>: Node.js 16 reached End-of-Life on 2023-09-11 (<a href="https://nodejs.dev/en/about/releases/">Ref</a>).</p>
<p>Updated <code>action.yml</code> to use the <code>node20</code> binary. If you use <code>setup-php</code> on a self-hosted runner, please make sure it is <a href="https://github.com/actions/runner/releases/tag/v2.308.0">v2.308.0</a> or newer to use this release or the major version tag <code>v2</code>.</p>
<h3>Node.js Dependencies</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="7fdd3ece87"><code>7fdd3ec</code></a> Fix blackfire-player on Linux and macOS</li>
<li><a href="0de5aa9140"><code>0de5aa9</code></a> Bump version to 2.26.0</li>
<li><a href="a6e0b1404f"><code>a6e0b14</code></a> Bump Node.js dependencies</li>
<li><a href="5d259c66b1"><code>5d259c6</code></a> Bump node version to 20 in action.yml</li>
<li><a href="6207829361"><code>6207829</code></a> Update use of actions/checkout to v4</li>
<li><a href="319feb83c2"><code>319feb8</code></a> Add support to install sqlsrv and pdo_sqlsrv from GitHub releases</li>
<li><a href="661ad4bf75"><code>661ad4b</code></a> Fix enabling latest pecl extensions</li>
<li><a href="04c15e2314"><code>04c15e2</code></a> Remove hardcoded latest version for sqlsrv and pdo_sqlsrv</li>
<li><a href="5aa416d77b"><code>5aa416d</code></a> Merge pull request <a href="https://redirect.github.com/shivammathur/setup-php/issues/766">#766</a> from GrahamCampbell/patch-1</li>
<li><a href="a9a661ccd4"><code>a9a661c</code></a> Use sqlsvr 5.11.1 on PHP 8</li>
<li>Additional commits viewable in <a href="d30ad8b184...7fdd3ece87">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=shivammathur/setup-php&package-manager=github_actions&previous-version=2.24.0&new-version=2.26.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#14115
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14115 from protocolbuffers:dependabot/github_actions/shivammathur/setup-php-2.26.0 f4423b44f0
PiperOrigin-RevId: 573315535