This required enabling the feature in the code generator and fixing a few edge cases around label and type.
Also added tests to verify the special cases, and to verify that required fields work as expected.
PiperOrigin-RevId: 580263087
The initial job ran and found stale PRs/issues, but lacked the permission to comment on them, add labels, or close issues/PRs.
Any issues with 'help wanted' shouldn't be auto-closed as we want them to be able to sit inactive.
PiperOrigin-RevId: 580209299
This restores the behavior of `-[GPBMessage writeToOutputStream:]` throwing an
exception if the underlying `GPBCodedOutputStream` failed to flush.
`GPBDictionary` and `GPBUnknownFieldSet` could also have theoretically thrown
exceptions from just about any method (although not for disk I/O reasons), so
this also restores that functionality by explicitly flushing before deallocating
the `GPBCodedOutputStream`.
PiperOrigin-RevId: 580207004
Unlike the wire fuzz test this only fuzzes json against a fixed message; in a subsequent improvement it can additionally fuzz over the message def itself.
PiperOrigin-RevId: 580158012
We will soon be moving utf8_range into the protobuf repo, not as a subtree
anymore but as the real source of truth. This change adds CI coverage in
advance so that there will not be a lapse in coverage.
I also upgraded our pinned versions of rules_fuzzing and rules_python, to fix
some errors that came up with Bazel 6 and Python 3.12. I had to patch
rules_fuzzing but I am working on upstreaming the fixes.
PiperOrigin-RevId: 579987379
If `-[GPBCodedOutputStream flush]` failed (e.g., because the filesystem
was out of space), then `-[GPBCodedOutputStream dealloc]` would throw
an exception.
`-dealloc` cannot fail, so the only thing to do in this case is to silently
swallow the exception.
PiperOrigin-RevId: 579916429
Roughly, this means: types, static constants, constructors, other functions, data members.
Also, remove a redundant `private:`.
PiperOrigin-RevId: 579911543
There was the potential for if the serialization failed, the final
release of the CodedOutputStream could flush some data back into the
return result; instead insure a zero length data is always returned
for that error case.
PiperOrigin-RevId: 579865501
This should address the issue in #14600 by avoiding a conflict on with the
`build` directory created by setup.py on a case-insensitive filesystem.
Closes#14600.
PiperOrigin-RevId: 579859556
This removes a virtual function from MessageLite.
To support this, we now make sure that all derived types provide a ClassData instance tailored for them. All special classes now also contain a CachedSize member to make it a requirement instead of optional.
The ClassData instanaces are still not unique because all MapEntry instantiations share one.
PiperOrigin-RevId: 579856691
Add PyObject_GC_UnTrack() in deallocation functions for Python types that
have PyTPFLAGS_HAVE_GC set, either explicitly or by inheriting from a type
with GC set. Not untracking before clearing instance data introduces
potential race conditions (if GC happens to run between the partial clearing
and the actual deallocation) and produces a warning under Python 3.11.
(The warning then triggered an assertion failure, which only showed up when
building in Py_DEBUG mode; this therefor also fixes that assertion failure.)
PiperOrigin-RevId: 579827001
Adds Automatic-Module-Name after it was lost during the maven-bazel migration (and subsequent re-addition of osgi bundle support).
Updates OsgiWrapper to support adding the Automatic-Module-Name header to the list of properties supported by the `osgi_java_library` rule.
Fixes#12639Closes#14562
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14562 from Sineaggi:add-automatic-module-name a27b3e6695
PiperOrigin-RevId: 579748655
out-of-line functions. This avoids local std::string temporaries and alike.
It also speeds up code because we delay constructing the errors via StrCat
until an error has actually occurred.
PiperOrigin-RevId: 579269516
As an analog to the C++ mutable_foo() member functions,
uses of Java builders should appear as writes in Code Search.
They should be marked with the kSet semantic.
Note that the get*OrBuilder[List] methods should *not* be
marked with kSet as they do not return a mutable object.
PiperOrigin-RevId: 579079084