123 Commits

Author SHA1 Message Date
Rachel Goldfinger
bd2543656e Fix arch tests by adding file to the Docker images
PiperOrigin-RevId: 881524967
2026-03-10 11:06:34 -07:00
Salman Chishti
adf9e8b80f Upgrade GitHub Actions for Node 24 compatibility (#25572)
## Summary

Upgrade GitHub Actions to their latest versions to ensure compatibility with Node 24, as Node 20 will reach end-of-life in April 2026.

## Changes

| Action | Old Version(s) | New Version | Release | Files |
|--------|---------------|-------------|---------|-------|
| `actions/cache` | [`1bd1e32`](1bd1e32a3b) | [`8b402f5`](8b402f58fb) | [Release](https://github.com/actions/cache/releases/tag/v5) | clear_caches.yml |
| `actions/checkout` | [`8ade135`](8ade135a41) | [`8e8c483`](8e8c483db8) | [Release](https://github.com/actions/checkout/releases/tag/v6) | scorecard.yml, staleness_refresh.yml, update_php_repo.yml |
| `actions/download-artifact` | [`018cc2c`](018cc2cf5b), [`fa0a91b`](fa0a91b85d) | [`37930b1`](37930b1c2a) | [Release](https://github.com/actions/download-artifact/releases/tag/v7) | test_cpp.yml, test_php_ext.yml, test_upb.yml |
| `actions/setup-dotnet` | [`3447fd6`](3447fd6a9f) | [`baa11fb`](baa11fbfe1) | [Release](https://github.com/actions/setup-dotnet/releases/tag/v5) | test_csharp.yml |
| `actions/setup-java` | [`3a4f6e1`](3a4f6e1af5) | [`be666c2`](be666c2fcd) | [Release](https://github.com/actions/setup-java/releases/tag/v5) | test_bazel.yml |
| `actions/setup-python` | [`39cd149`](39cd14951b), [`e797f83`](e797f83bcb) | [`a309ff8`](a309ff8b42) | [Release](https://github.com/actions/setup-python/releases/tag/v6) | test_python.yml, test_upb.yml |
| `actions/stale` | [`b69b346`](b69b346013) | [`9971854`](997185467f) | [Release](https://github.com/actions/stale/releases/tag/v10) | janitor.yml |
| `actions/upload-artifact` | [`5076954`](50769540e7), [`v4`](https://github.com/actions/upload-artifact/releases/tag/v4) | [`b7c566a`](b7c566a772) | [Release](https://github.com/actions/upload-artifact/releases/tag/v6) | scorecard.yml, test_cpp.yml, test_php_ext.yml, test_ruby.yml, test_upb.yml |

## Context

Per [GitHub's announcement](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/), Node 20 is being deprecated and runners will begin using Node 24 by default starting March 4th, 2026.

### Why this matters

- **Node 20 EOL**: April 2026
- **Node 24 default**: March 4th, 2026
- **Action**: Update to latest action versions that support Node 24

### Security Note

Actions that were previously pinned to commit SHAs remain pinned to SHAs (updated to the latest release SHA) to maintain the security benefits of immutable references.

### Testing

These changes only affect CI/CD workflow configurations and should not impact application functionality. The workflows should be tested by running them on a branch before merging.

Closes #25572

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/25572 from salmanmkc:upgrade-github-actions-node24 ef77dcfa4f
PiperOrigin-RevId: 874140973
2026-02-23 10:27:07 -08:00
Joshua Haberman
1816758069 Dropped support for Bazel 7.
This was previously announced here: https://protobuf.dev/support/migration/#dropped-bazel-7-support

#test-continuous

PiperOrigin-RevId: 870256373
2026-02-14 14:50:17 -08:00
Joshua Haberman
1ea2c4bab5 Updated release builds to use Bazel 8 and platforms.
Bazel 8 no longer supports legacy toolchains, so all of our release toolchains have been updated to use platforms.

#test-continuous

PiperOrigin-RevId: 870017275
2026-02-13 21:47:47 -08:00
Protobuf Team Bot
783da0a940 Disable constinit on MSVC for static library builds
38927bf2b9 cleaned up the constinit suppressions based on our understanding of the Windows/MSVC limitations at the time. It turns out this was incomplete and, by restoring constinit on static library MSVC builds, we broke something.

On MSVC, but not clang-cl, the workaround must extend to static library builds too. Although pointers to same-dll symbols are fine and MSVC, with optimizations, will avoid a static initializer, it doesn't seem to consistently recognize it in the type systems, so we can't enforce constinit. See https://godbolt.org/z/cYeYaaWq5

On MSVC, but not clang-cl, the above workaround must extend to static library builds too. MSVC can avoid a global constructor when initializing structures containing pointers to same-dll symbols, it relies on the optimizer for this, so we can't enforce constinit. This limitation does not apply to constexpr. See https://godbolt.org/z/hsT9e3zs4

Add a Windows Bazel C++20 build configuration, which would have caught this.

PiperOrigin-RevId: 858801389
2026-01-20 16:25:34 -08:00
Jie Luo
b046c9a30e Drop Bazel 7 tests for bazel, python, partially java partially cpp.
C++, java, PHP, Ruby and upb still have some cross-compilation Bazel 7 tests.

PiperOrigin-RevId: 855994201
2026-01-13 20:11:39 -08:00
Mikita Belahlazau
4f076d951f Add metadata annotations for generated Python protobuf symbols.
The pyi generator now includes Kythe annotations for:
*   Extension field constants (e.g., `EXTENSION_FIELD`).
*   Field number constants (e.g., `STRING_FIELD_FIELD_NUMBER`).
*   `Create` methods in generated Stubby client classes.

These annotations allow the Python indexer to link these generated symbols back to their definitions in the `.proto` files.

PiperOrigin-RevId: 852971617
2026-01-06 16:05:56 -08:00
Protobuf Team Bot
ae67a4c195 Internal version update.
PiperOrigin-RevId: 852733884
2026-01-06 05:27:44 -08:00
Eric Salo
244e1ea61c Delete redundant ARM tests
PiperOrigin-RevId: 836244136
2025-11-24 08:58:09 -08:00
Eric Salo
a6fbd40d7e Update GitHub Actions to use macOS-14.
See https://github.com/actions/runner-images/issues/13046.

#test-continuous

PiperOrigin-RevId: 835391347
2025-11-21 16:05:25 -08:00
Sebastian Pipping
88261aab23 CMake: Stop building tests by default (related to #20539) (#24373)
#test-continuous

Related to #20539, in reaction to https://github.com/protocolbuffers/protobuf/issues/20539#issuecomment-3505491543

CC @mkruskal-google

Closes #24373

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/24373 from hartwork:cmake-stop-building-tests-by-default 6be6748d4b
PiperOrigin-RevId: 831962270
2025-11-13 12:30:47 -08:00
Mike Kruskal
f764f12dc8 Upgrade to protobuf-ci v5
PiperOrigin-RevId: 825653280
2025-10-29 12:14:52 -07:00
Mike Kruskal
c2608c1c8d Mark aarch64 tests continous-only
These are by far our slowest tests due to their QEMU use.  They rarely catch unique issues, so we can handle this in post-submits instead of paying ~4 minutes on every presubmit

PiperOrigin-RevId: 818873557
2025-10-13 16:07:46 -07:00
Mike Kruskal
c6ba697d95 Remove the flag requirement for Bazel+MSVC users.
As discussed in https://github.com/protocolbuffers/protobuf/issues/20085, we were originally intending to drop support for this combination.  With Bazel's recent changes to virtual includes on windows though, we now have ~90 extra characters of runway.  This should be more than enough to continue supporting MSVC into the forseeable future.  Clang-cl support will be kept in place as an alternative on windows

PiperOrigin-RevId: 783798673
2025-07-16 10:07:51 -07:00
Adam Cozzette
bb454a777e Automated rollback of commit c256302461.
PiperOrigin-RevId: 781236113
2025-07-09 15:34:29 -07:00
Adam Cozzette
25d7981143 Upgrade to Bazel 7.6.1
This is necessary for upgrading setuptools, because older Bazel versions apparently can't handle whitespace in file names: https://github.com/protocolbuffers/protobuf/pull/22094

PiperOrigin-RevId: 780210543
2025-07-07 12:22:23 -07:00
Adam Cozzette
ee68ed1c0d Upgrade Abseil dependency to 20250512.1
PiperOrigin-RevId: 773854775
2025-06-20 15:05:06 -07:00
Adam Cozzette
c256302461 Upgrade Clang on Windows test runs and work around MSVC error
#test-continuous

Most of our Windows test runs are currently failing with an error message about
the Clang version being too old. This seems to be an occasional
[issue](https://github.com/actions/runner-images/issues/10001) with the GitHub
Windows runners, and the suggested workaround is to use `choco` to upgrade LLVM.
We should revert this change as soon as the GitHub runners are fixed.

This change also includes a tweak to descriptor.cc to work around a mysterious
"internal compiler error" with MSVC.

PiperOrigin-RevId: 773825728
2025-06-20 13:45:53 -07:00
Mike Kruskal
9d871a1208 Drop windows-2019 runners from CI
#test-continuous

See https://github.com/actions/runner-images/issues/12045

PiperOrigin-RevId: 769765346
2025-06-10 13:16:17 -07:00
Mike Kruskal
07fb7b764f Refactor conformance library
PiperOrigin-RevId: 757011936
2025-05-09 20:46:35 -07:00
Deanna Garcia
754c1130be Add bazel 8 c++ tests
Note that cross compilation tests are still in bazel 7 while we debug b/409557730
#test-continuous

PiperOrigin-RevId: 745844519
2025-04-09 21:13:21 -07:00
Mike Kruskal
2ad7546e0e Re-enable aarch64 tests.
These were broken by a QEMU bug that appears to have been broken by a recent hardening added to the ubuntu kernel rolled out to the github runner images.

See https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2096782 and https://github.com/tonistiigi/binfmt/issues/215 for more information.

PiperOrigin-RevId: 740895829
2025-03-26 14:07:17 -07:00
Adam Cozzette
6aefdde973 Automated rollback of commit 46e602c914.
PiperOrigin-RevId: 737031015
2025-03-14 17:12:48 -07:00
Adam Cozzette
46e602c914 Automated rollback of commit d311374b14.
PiperOrigin-RevId: 736907364
2025-03-14 10:28:46 -07:00
Sandy Zhang
d311374b14 Temporarily disable broken aarch64 test runs.
This seems to have been broken by latest github ubuntu runner image.

PiperOrigin-RevId: 732135074
2025-02-28 08:10:48 -08:00
Mike Kruskal
0964d253f9 Remove test platform specification from release config
#test-continuous

PiperOrigin-RevId: 731139639
2025-02-25 20:52:59 -08:00
Adam Cozzette
dce6b0f14b Move upb minitable code generator into protoc
The main goal of this is to incorporate the minitable generator into our
released protoc binaries so that Rust users don't have to build it from source.

PiperOrigin-RevId: 728785507
2025-02-19 13:10:54 -08:00
Mike Kruskal
cab65df75e Mark some of our middle gcc versions continous-only
PiperOrigin-RevId: 724030072
2025-02-06 12:27:25 -08:00
Mike Kruskal
6c768ff33e Add tests for older gcc versions we still support
PiperOrigin-RevId: 723691910
2025-02-05 16:24:41 -08:00
Protobuf Team Bot
06ba410c27 Bump the C++/Ruby CI runner images
Reenable aarch64 tests

PiperOrigin-RevId: 723490932
2025-02-05 06:47:30 -08:00
Sandy Zhang
e7260fd5cc Remove --noenable_bzlmod from .bazelrc
Enables bzlmod for most CI tests, except python (and thus upb) since infra for system python headers for python dist are not bzlmod compatible and require further work.

#test-continuous

PiperOrigin-RevId: 721946253
2025-01-31 16:45:18 -08:00
Mike Kruskal
117e7bbe74 Breaking change: prohibit using Bazel+MSVC to build protobuf
An opt-out flag `--define=protobuf_allow_msvc=true` will be available until our 2026 breaking release 34.0. See https://github.com/protocolbuffers/protobuf/issues/20085 for more details.

#test-continuous

PiperOrigin-RevId: 720822739
2025-01-28 22:01:32 -08:00
Mike Kruskal
f7b199b125 Speed up our sanitized tests to avoid timeouts
- Switch our MSAN tests to use Memory instead of MemoryWithOrigins
- Enable minimal (-O1) optimizations for all sanitized builds

The new optimization shook loose some ODR issues we've hit before due to the cyclic dependency of cc_proto_library.  This will fix itself once we finish taking over the rule, and shouldn't affect users.  It can be worked around by forcing static linkage in sanitized builds.

#test-continuous

PiperOrigin-RevId: 720686491
2025-01-28 13:25:47 -08:00
Adam Cozzette
e77920478c Temporarily disable or remove flaky aarch64 test runs
These tests are currently flaky but should be fixed soon by a new image
rollout.

I plan on rolling back this change in a couple of days once the issue is fixed.

PiperOrigin-RevId: 720598019
2025-01-28 09:13:40 -08:00
Sandy Zhang
aef40aaf83 Update protobuf repository to use the newest version (v4) of protobuf-ci
#test-continuous

PiperOrigin-RevId: 712618052
2025-01-06 12:33:01 -08:00
Mike Kruskal
1223341793 Set up golden tests for the files we install via cmake.
This will help us avoid further bugs like #19735, where we're typically not very aware of how our files get installed as long as everything builds.  With these tests in place, we will need to manually update the golden files whenever we add a new file to users' installations.

PiperOrigin-RevId: 709134471
2024-12-23 13:11:02 -08:00
Tony Liao
f4cc92c73d Remove stale references to C++14.
The main branch was upgraded to use C++17 after the 29.0 branch cut, in commit
fe535930d3

There are still stale references to C++14 in the code, build chain, and
READMEs. This commit cleans up the stale configs and settings.

PiperOrigin-RevId: 706000867
2024-12-13 14:29:25 -08:00
Deanna Garcia
afe2de2618 Move to bazel 7 and turn down support for bazel 6.
Migrate all tests to run on bazel 7 and fix errors that came up in the process. 30.x will no longer guarantee support for bazel 6.
#test-continuous

PiperOrigin-RevId: 703590770
2024-12-06 13:05:40 -08:00
Mike Kruskal
9cc685edf8 Breaking change: Flip default behavior for handling cmake dependencies.
Instead of fetching dependencies by default, we will first look for a local installation and only fetch as a fallback.  Two new options are added for forcing either of these behaviors.  protobuf_FORCE_FETCH_DEPENDENCIES will always fetch dependencies, and protobuf_PREVENT_FETCH_DEPENDENCIES will never do so.

#test-continuous

PiperOrigin-RevId: 693898394
2024-11-06 16:15:10 -08:00
Evan Brown
f971ed3f36 Use Layout::WithStaticSizes in SerialArenaChunk to improve performance of Layout computations.
PiperOrigin-RevId: 688155852
2024-10-21 09:10:03 -07:00
Tony Liao
fe535930d3 Bump minimum C++ version to C++17 after branch cut for v29.
Branch cut for v29 is done on 2024-09-30:
https://github.com/protocolbuffers/protobuf/releases/tag/v29.0-rc1

The next version v30 will be a breaking release. The release date is scheduled
after the EOL of C++14 support on 2024-12-15 for Google open source projects
generally:
https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md

This commit allows us to start taking advantage of C++17 features now.

Some issues I ran into while upgrading:

Two GCC 9.5 bugs related to -Wunused-but-set-parameter:
- https://godbolt.org/z/qo51cKe7b
- https://godbolt.org/z/65qW3vGhP

Another GCC warning related to -Wself-assign in a template.

There is a custom ASAN check that is not yet open sourced. I'll see if I can
open source them in a subsequent commit.

#test-continuous

PiperOrigin-RevId: 687435042
2024-10-18 15:07:07 -07:00
Mike Kruskal
264c4b7b43 Fix abseil build after bump broke windows/cmake
#test-continuous

PiperOrigin-RevId: 686933460
2024-10-17 09:06:20 -07:00
Mike Kruskal
3f06ca4306 Breaking change: Remove CMake submodule support in favor of fetched or installed dependencies.
This flips the default behavior to "fetch", downloading local copies of required dependencies.  This can be disabled by setting `-Dprotobuf_FETCH_DEPENDENCIES=OFF`, in which case we will look for a local installation using find_package.  Setting `-Dprotobuf_ABSL_PROVIDER=package` will continue to have the same behavior as before.

See https://protobuf.dev/news/2024-10-02/#replace-cmake-submods for more details.

#test-continuous

PiperOrigin-RevId: 686649864
2024-10-16 14:52:31 -07:00
Protobuf Team Bot
a0eb24061f Replace use of C++17 with disabling a warning
PiperOrigin-RevId: 686572636
2024-10-16 11:15:12 -07:00
Mike Kruskal
d3735bc2a0 Support fetching CMake dependencies via -Dprotobuf_FETCH_DEPENDENCIES=ON
This ports upb's WORKSPACE scraping logic to protobuf, and allows us to dynamically fetch our dependencies at the exact same pinned version as in Bazel via protobuf_FETCH_DEPENDENCIES=ON.  This is mostly for development purposes, and is preferable to git submodules.  In a later cl we will flip the default behavior to "package"

#test-continuous

PiperOrigin-RevId: 686265348
2024-10-15 15:52:06 -07:00
Protobuf Team Bot
5aa7abc659 Upgrade rules_cc to 0.0.13
This version is compatible with Bazel 6 and above.

PiperOrigin-RevId: 686151846
2024-10-15 10:26:00 -07:00
Protobuf Team Bot
87de73d8e8 Update GitHub Actions to use macOS-13 ahead of macOS-12 deprecation.
See https://github.com/actions/runner-images/issues/10721.

#test-continuous

PiperOrigin-RevId: 684546079
2024-10-10 13:02:46 -07:00
Protobuf Team Bot
fe683705a1 Restore macOS CMake configuration.
PiperOrigin-RevId: 684435872
2024-10-10 09:39:43 -07:00
Protobuf Team Bot
13cf397e1a upgrade test images to bazel 6.4
PiperOrigin-RevId: 673392132
2024-09-11 08:06:35 -07:00
Deanna Garcia
f6a6b060e2 Edit GHA to never skip full jobs on presubmit -- only steps.
This ensures the names of these jobs will properly be prefixed with "[SKIPPED] (Continuous)" and will show as passed instead of skipped.

PiperOrigin-RevId: 666918220
2024-08-23 14:16:07 -07:00