Commit Graph

70 Commits (main)

Author SHA1 Message Date
Mike Kruskal 95877d8569 Updating version.json and repo version numbers to: 28-dev (#16555)
Closes #16555

PiperOrigin-RevId: 626081638
2024-04-18 10:47:14 -07:00
Mike Kruskal 6898451f5e Setup upb installation with cmake.
This installs a upb's static library, headers, and three protoc plugin binaries (upb, upbdefs, upb_minitable).  These will now be enabled by default, but can be disabled by setting protobuf_BUILD_LIBUPB=OFF.

To qualify this, we hook into our existing install test infrastructure which attempts to build and run our tests without any of the installation artifacts available from the source tree.  Public headers are deleted, and builds of exported libraries/binaries are disabled.

PiperOrigin-RevId: 617376961
2024-03-19 20:17:58 -07:00
Mike Kruskal b6032d72e3 Add basic upb cmake support.
libupb will always be statically linked, and currently doesn't ever install itself.

PiperOrigin-RevId: 615136389
2024-03-12 12:43:16 -07:00
Daniel Richard G a8181d9ae8 Write generated source files to the build tree, not the source tree. (#14455)
My org, as part of its reproducible-build hygiene, builds projects with the source trees in read-only mode. I approached the protobuf build in the same way, but encountered this error (among others):
```
[ 30%] Built target statusor
[ 34%] Built target libprotobuf-lite
[ 45%] Built target libprotobuf
Consolidate compiler generated dependencies of target libprotoc
[ 62%] Built target libprotoc
Consolidate compiler generated dependencies of target protoc
[ 62%] Built target protoc
Consolidate compiler generated dependencies of target scoped_mock_log
[ 62%] Built target scoped_mock_log
[ 62%] Generating /home/src/protobuf/src/google/protobuf/util/message_differencer_unittest_proto3.pb.h, /home/src/protobuf/src/google/protobuf/util/message_differencer_unittest_proto3.pb.cc
/home/src/protobuf/src/google/protobuf/util/message_differencer_unittest_proto3.pb.cc: Read-only file system
make[2]: *** [CMakeFiles/libtest_common.dir/build.make:387: /home/src/protobuf/src/google/protobuf/util/message_differencer_unittest_proto3.pb.h] Error 1
make[1]: *** [CMakeFiles/Makefile2:1194: CMakeFiles/libtest_common.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
```
(`/home/src` is a read-only mount)

Generated source files are effectively build artifacts, and should be written to the build tree, not the source tree. This PR accordingly enables a successful build and test run (lite, full, and conformance) with read-only sources.

(Beyond this, I would add that CMake usually does not need source file paths to be qualified with `CMAKE_SOURCE_DIR` or `CMAKE_BINARY_DIR`; in most cases it knows to look in both locations, favoring the latter if a file is in both. The CMake code could be simplified by relying on this behavior.)

Closes #14455

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14455 from iskunk:feature/ro-source da7510c24a
PiperOrigin-RevId: 607031010
2024-02-14 10:32:11 -08:00
Dennis Shao 9146ce6ddb Updating version.json and repo version numbers to: 27-dev (#15590)
Closes #15590

PiperOrigin-RevId: 601468713
2024-01-25 09:18:51 -08:00
Kevin King fa5f8fa7e8 Depend on upb_generator:mangle from rust compiler
Update cmake to include necessary upb_generator files and upb namespace.

PiperOrigin-RevId: 595144470
2024-01-02 10:03:29 -08:00
Jie Luo 1231af10c7 merge 25.x to main (#14617)
Closes #14617

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14617 from anandolee:25.x ac86c5ef32
PiperOrigin-RevId: 578996979
2023-11-02 15:29:36 -07:00
Protobuf Team Bot 3ea774370a Internal change
PiperOrigin-RevId: 578944754
2023-11-02 13:34:12 -07:00
Protobuf Team Bot 6b5d8db01f Updating version.json and repo version numbers to: 25.0 2023-11-01 13:03:44 -07:00
Protobuf Team Bot ba1aab2baf Updating version.json and repo version numbers to: 25.0-rc2 2023-10-18 09:57:30 -07:00
Protobuf Team Bot 896f3d8ced Updating version.json and repo version numbers to: 25.0-rc1 2023-10-16 12:36:52 -07:00
ericsalo 843b74e601 Main 202308091812 (#13489)
Closes #13489

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13489 from protocolbuffers:main-202308091812 e729f0bf5a
PiperOrigin-RevId: 555301642
2023-08-09 16:02:04 -07:00
Protobuf Team Bot aba9a7f1a3 Internal change
PiperOrigin-RevId: 555251853
2023-08-09 13:09:58 -07:00
Protobuf Team Bot 093e258a71 Updating version.json and repo version numbers to: 24.0 2023-08-08 10:26:14 -07:00
Protobuf Team Bot 3487ae0c01 Updating version.json and repo version numbers to: 24.0-rc3 2023-08-01 10:27:01 -07:00
Protobuf Team Bot 034ec9d9f6 Updating version.json and repo version numbers to: 24.0-rc2 2023-07-18 11:50:33 -07:00
Protobuf Team Bot 05835e374d Updating version.json and repo version numbers to: 24.0-rc1 2023-07-11 14:54:12 -07:00
Carlos O'Ryan 4ad5f54fe6 cleanup(cmake): prefer target over global options (#12916)
In CMake >= 3.0 it is more idiomatic to set per-target compiler options than global compiler settings. I have kept these options and defines as `PRIVATE` so they won't be exported with the target.

Closes #12916

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12916 from coryan:cleanup-cmake-avoid-global-compile-settings 3d586dc0e8
PiperOrigin-RevId: 536517165
2023-05-30 14:56:51 -07:00
Mike Kruskal da085e8bd0 Fix broken ccache setup in windows builds
Policy CMP0141 broke our hack to remove /Zi, and there doesn't seem to be a way to strip debug symbols with this policy enabled.  We can disable the policy when it exists to get ccache working again and speed up our tests.

PiperOrigin-RevId: 534958215
2023-05-24 13:22:09 -07:00
deannagarcia 0e23f18865 Merge to main after 23.0 release (#12721)
Closes #12721

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12721 from protocolbuffers:main-202305082101 36482b4c68
PiperOrigin-RevId: 530664393
2023-05-09 11:28:29 -07:00
Protobuf Team Bot 67d9ea87f3 Internal change
PiperOrigin-RevId: 530619366
2023-05-09 09:27:53 -07:00
Deanna Garcia 36482b4c68 Merge remote-tracking branch 'upstream/23.x' into main-202305082101 2023-05-08 21:05:58 +00:00
Carlos O'Ryan 277a3331d9 cleanup(cmake): automatically use newer policies (#12712)
CMake has fairly strict backwards compatibility behavior. Saying `cmake_minimum_required(VERSION 3.10)` has two effects:

- It requires CMake to be version 3.10 or higher
- It configures CMake to behave exactly as it did in version 3.10

The code used to override some policies to get newer behavior if it was available. The alternative syntax in this PR says "require at least 3.10, and use the behavior (when available) up to 3.26". We can omit policy overrides by doing so. It does not seem like any other policies are important, so we can use the simpler syntax.

Closes #12712

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12712 from coryan:cleanup-cmake-automatically-use-newer-policies 36db0fa17e
PiperOrigin-RevId: 530376446
2023-05-08 12:30:13 -07:00
Protobuf Team Bot 6e511679de Updating version.json and repo version numbers to: 23.0 2023-05-08 09:48:50 -07:00
Protobuf Team Bot d8f44cc2fb Updating version.json and repo version numbers to: 23.0-rc3 2023-05-05 09:17:00 -07:00
Mike Rochefort cc7dcfa45b Enable the selection of system provided jsoncpp (#12577)
Allows the use of an external `jsoncpp` library to be used. Replicates the model used by `abseil-cpp` as a "package" or "module" to the `protobuf_JSONCPP_PROVIDER` option.

Resolves: #11827

Closes #12577

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12577 from omenos:omenos/cmake-jsoncpp 073edd69b4
PiperOrigin-RevId: 528492610
2023-05-01 09:38:05 -07:00
Protobuf Team Bot 51f51ac4ef Updating version.json and repo version numbers to: 23.0-rc2 2023-04-28 10:25:19 -07:00
Protobuf Team Bot b21d6be78b Updating version.json and repo version numbers to: 23.0-rc1 2023-04-25 13:47:12 -07:00
Sandy Zhang 4e23571384 Merge remote-tracking branch 'upstream/22.x' into main-202304181855 2023-04-18 19:09:21 +00:00
Protobuf Team Bot 482156c0f9 Updating version.json and repo version numbers to: 22.3 2023-04-12 15:43:07 -07:00
zhangskz b15bf628e5 Merge 22.x back to main (#12200)
Closes #12200

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/12200 from protocolbuffers:main-202303101853 1efa2e7205
PiperOrigin-RevId: 515722578
2023-03-10 13:25:18 -08:00
Mike Kruskal 25dfc39b11 Internal changes
PiperOrigin-RevId: 515648197
2023-03-10 13:24:31 -08:00
Sandy Zhang 1efa2e7205 Merge release branch 22.x into main 2023-03-10 19:17:05 +00:00
Protobuf Team Bot 81f89d509d Updating version.json and repo version numbers to: 22.2 2023-03-10 07:57:16 -08:00
deannagarcia 15bd2c21cf Merge 22.x back to main (#12169)
Closes #12169

PiperOrigin-RevId: 515161008
2023-03-08 15:38:14 -08:00
Protobuf Team Bot 839e8d25ea Updating version.json and repo version numbers to: 22.1 2023-03-07 12:51:16 -08:00
Mike Kruskal 8a07f45293 Add release tests for statically linked binaries
For now, this only covers linux on the two architectures we have testing support for.  However, it serves as a good sanity check and can be expanded in the future.

PiperOrigin-RevId: 514449399
2023-03-06 18:30:04 +00:00
Mike Kruskal 804ec94a16 Add release tests for statically linked binaries
For now, this only covers linux on the two architectures we have testing support for.  However, it serves as a good sanity check and can be expanded in the future.

PiperOrigin-RevId: 514449399
2023-03-06 10:26:21 -08:00
Mike Kruskal b143586425 Version protoc according to the compiler version number.
Previously we were using the C++ runtime version, which includes an extra major version number.  See #12064

PiperOrigin-RevId: 513049588
2023-02-28 23:36:17 +00:00
Mike Kruskal e67136d289 Version protoc according to the compiler version number.
Previously we were using the C++ runtime version, which includes an extra major version number.  See #12064

PiperOrigin-RevId: 513049588
2023-02-28 15:04:48 -08:00
Greg Miller bcb20bbdfa Update the min required CMake version to 3.10
This change also removes policy settings that are now already set to
`NEW` by default. There are still two remaining policies that were
introduced in CMake > 3.10, so I left those, and documented the CMake
version they were introduced in so we know when we can later remove them
(when our min version advances beyond that).

The min CMake version supported by Protobuf is documented here:
https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md

PiperOrigin-RevId: 511897379
2023-02-23 15:08:49 -08:00
Mike Kruskal 649cc30872 Open-source some of our string_view tests.
This support was added in 22.x, but we don't have any tests locking it down.

Closes https://github.com/protocolbuffers/protobuf/issues/8096

PiperOrigin-RevId: 510242380
2023-02-16 14:19:33 -08:00
Protobuf Team Bot a847a8dc4b Updating version.json and repo version numbers to: 22.0 2023-02-16 09:13:25 -08:00
Mike Kruskal 5127af50f2 Switch to Ninja generator for windows cmake builds.
These will still use MSVC as the compiler, but will no longer generate Visual Studio projects for the builds.  Visual Studio is particularly bad at parallelizing builds, and is hostile to ccache.

This change also tweaks the ccache setup to prevent unbounded the growth observed in our github caches.  Windows builds have had debug symbols stripped to reduce ccache size by a factor of 2x, and ccache maximum have been tweaked so that we persist fewer older builds.

Before this change, each CMake build took 12 minutes on every run (plus some constant overhead from staleness/gcloud), even with caching or on large multi-core runners.  No amount of caching or parallelization made any noticeable difference above noise.  With this change, we see the following improvements:
- 12 minutes to build from scratch on normal runners (unchanged)
- 4 minutes on 32-core runners from scratch
- 1 minute with optimal caches available on normal runners.
- 30 seconds on 32-core runners with optimal caches

PiperOrigin-RevId: 508799909
2023-02-14 11:38:09 -08:00
Protobuf Team Bot 4dd7a1e380 Updating version.json and repo version numbers to: 22.0-rc3 2023-02-10 11:01:55 -08:00
Sandy Zhang f25de39886 Merge remote-tracking branch 'upstream/main' into merge-main-to-22.x 2023-02-09 21:08:52 +00:00
Mike Kruskal c399aeccc4 Enable ccache for CMake builds.
This uses ccache + github caching to substantially decrease the time it takes to run CMake builds.  Due to Bazel caching, these are some of our slowest tests, causing one of the biggest presubmit bottlenecks

PiperOrigin-RevId: 507667813
2023-02-06 21:10:24 -08:00
Protobuf Team Bot fa7a079c11 Updating version.json and repo version numbers to: 22.0-rc2 2023-02-02 11:44:51 -08:00
Protobuf Team Bot 2b406251e4 Updating version.json and repo version numbers to: 22.0-rc1 2023-01-26 21:37:43 -08:00
Mike Kruskal a9f1ea6371 Breaking change: Migrate to Abseil's logging library.
This deletes our old branches of internal Abseil code in favor of their newly open-sourced library.  Notably, this removes the ability to turn CHECK crashes into exceptions.

PiperOrigin-RevId: 504460562
2023-01-24 21:51:03 -08:00