Add convenience _opt for singular message fields.
Users can detect if the message is set or unset, and unwrap via into_inner.
PiperOrigin-RevId: 602749065
This is the final CL (part 4 of 4) in the ProxiedWithPresence chain.
In the past, we had returned Mut directly for the `_mut` accessors.
This was a temporary engagement in order to get the other submsg machinery checked in.
As we prep for the finalization of v0.6, we can finally conform to the rest of the `_mut` getters.
$field$_mut now correctly returns $pb$::FieldEntry<'_, $msg_type$> as a part of this.
All test callsites have been updated to `.or_default` in order to test the mutational pathway as before.
PiperOrigin-RevId: 602739186
The old flag accidentally had inconsistent behavior between proto2 optional and proto3 optional fields, the new flag treats them consistently (and is consistent with the preexisting behavior of the Go JSON serializer).
PiperOrigin-RevId: 602711486
# Motivation
https://github.com/protocolbuffers/protobuf/issues/7392#issuecomment-1884666885
This is for completeness - I am not blocked by this change in any way, so feel free to close the PR or treat is a low priority.
# Changes
Implement JsonIgnoreUnknownParsingTest in C# conformance test runner.
# Tested
Locally with:
```
bazel test //csharp:conformance_test \
--action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=~ \
--action_env=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
```
Closes#15369
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15369 from noom:issue-7392/show-csharp-failures 3a652202a0
PiperOrigin-RevId: 602537927
It seems possible that old data is stored with serialized descriptors. If we
reject old descriptors due to invalid ctype, the change effectively becomes
breaking changes. We should apply this stricter check for edition 2023 or beyond.
PiperOrigin-RevId: 602516135
There are no restrict calls, so the manifest asserts that.
The CocoaPods support now ensures you are using CocoaPods >= 1.12 as that
avoids all the know bugs in CocoaPods support needed to capture the
Privacy Manifest in a resource bundle.
PiperOrigin-RevId: 602443703
Instead of silently ignoring `[ctype = XXX]` for non string or bytes fields,
this CL starts failing to build descriptors to call out the issue. This may
cause failures to existing proto schemas but fixing them should be straightforward.
PiperOrigin-RevId: 602441330
There are no restrict calls, so the manifest asserts that.
The CocoaPods support now ensure you are using CocoaPods >= 1.12 as that
avoids all the know bugs in CocoaPods support needed to capture the
Privacy Manifest in a resource bundle.
PiperOrigin-RevId: 602433417
right kind of extension. This way you get a compile time failure instead of a
runtime one.
Other extension accessors already have this kind of SFINAE restrictions.
PiperOrigin-RevId: 602418580
RepeatedPtrField had been updated to handle Add/MergeFrom when holding an abstract type MessageLite, hence ExtentionSet no longer needs to have custom workarounds.
PiperOrigin-RevId: 602381489
CocoaPods fails spec validation for some warnings, so use a local
to avoid warnings for 64->32bit implicit conversions. This comes up
for watchOS builds.
PiperOrigin-RevId: 601849919
* Tell cinterop that the `const char*` parameter in `upb_Decode` is not actually a string.
* Add `kotlin_native_hint` to `upb/wire`.
PiperOrigin-RevId: 601795518
This is done by specifying suffix punctuation to chomp with WithVars.
If we delete the space on line 64 without also doing the rest of this change, the result is that the comma is not emitted at all.
PiperOrigin-RevId: 601516987
Before this change if a field type was defined in a imported .proto file then our codegen would not generate the field. After this change such fields are correctly generated (see tests). This change is rather trivial as all the supporting infra has been implemented as part of the .proto -> crate mapping CLs.
PiperOrigin-RevId: 601443383
issue##15029
As required by https://developer.apple.com/support/third-party-SDK-requirements/
Protos does not collect data.
Required reason APIs searched for using:
```
grep -ER 'NSFileCreationDate|NSFileModificationDate|fileModificationDate|NSURLContentModificationDateKey|NSURLCreationDateKey|getattrlist\(|getattrlistbulk\(|fgetattrlist\(|stat\(|fstat\(|fstatat\(|lstat\(|getattrlistat\(|systemUptime\(|mach_absolute_time\(|NSURLVolumeAvailableCapacityKey|NSURLVolumeAvailableCapacityForImportantUsageKey|NSURLVolumeAvailableCapacityForOpportunisticUsageKey|NSURLVolumeTotalCapacityKey|NSFileSystemFreeSize|NSFileSystemSize|statfs\(|statvfs\(|fstatfs\(|fstatvfs\(|getattrlist\(|fgetattrlist\(|getattrlistat\(|activeInputModes|NSUserDefaults' .
```
```
./third_party/utf8_range/utf8_to_utf16/main.c: if (fstat(fd, &stat) == -1) {
./third_party/utf8_range/main.c: if (fstat(fd, &stat) == -1) {
./src/google/protobuf/map.h: s = mach_absolute_time();
./src/google/protobuf/io/io_win32.cc:int stat(const char* path, struct _stat* buffer) {
./src/google/protobuf/io/io_win32.cc: return ::_wstat(wpath.c_str(), buffer);
./src/google/protobuf/io/io_win32.cc: return ::_stat(path, buffer);
./src/google/protobuf/io/io_win32.h:PROTOBUF_EXPORT int stat(const char* path, struct _stat* buffer);
./src/google/protobuf/testing/file.cc: if (lstat(name.c_str(), &stats) != 0) return;
./src/google/protobuf/compiler/importer.cc: ret = stat(std::string(filename).c_str(), &sb);
```
`./third_party/utf8_range/...` - tool for utf that is not in user binaries
`./src/google/protobuf/map.h` - resolved with pull#15554
`./src/google/protobuf/io/io_win32.cc` - windows code
`./src/google/protobuf/testing/file.cc` - testing code not in user binaries
`./src/google/protobuf/compiler/importer.cc` - compiler code not in user binaries
So no required reason APIs.
Apple has not yet communicated how this is to be put into podspecs so saving for future commit.
Closes#15557
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15557 from dmaclach:privacy 4c4e570adf
PiperOrigin-RevId: 601362376