There is no canonical rules_ruby repo today, and we don't want our fork to become one. In order to unblock inclusion of Protobuf in the bzlmod registry, we're making this a dev dependency and dropping support for Bazel/Ruby.
Fixes#14569
PiperOrigin-RevId: 584393841
- Inline the once_flag object. This avoids an unnecessary indirection and secondary object.
- Reorganize the fields to reduce the size by 8 bytes.
PiperOrigin-RevId: 584322655
This change implements the Proxied trait for the Map type.
It leaves a TODO to implement SettableValue. I haven't implemented SettableValue yet because I have not yet been able to verify that we get the right copy_from semantics for both kernels. I'll implement set_on in a follow up.
PiperOrigin-RevId: 584285061
EXPECT_DEBUG_DEATH runs the statement without expecting a death in NDEBUG mode, causing a test failure in asan due to reaching `__builtin_unreachable`.
Also, improve a bit the definition of Unreachable to be more readable/useful.
PiperOrigin-RevId: 584133307
This allows for better code generation in C++20 for algorithms that take advantage of random access vs contiguous data.
```
name old INSTRUCTIONS/op new INSTRUCTIONS/op delta
BM_RepeatedField_Sort 5.74k ± 0% 5.74k ± 0% -0.13% (p=0.000 n=179+183)
BM_RepeatedField_ToVector 693 ± 0% 693 ± 0% ~ (p=0.153 n=93+91)
BM_RepeatedPtrField_SortIndirect 562 ± 0% 559 ± 0% -0.53% (p=0.000 n=92+92)
```
PiperOrigin-RevId: 583983215
According to https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp, since there's no guarantees for cross-version support even for the micro/patch versions, we shouldn't allow range of versions that could be backward-compatible with, either, and should detach the corresponding version verifications.
PiperOrigin-RevId: 583056663
Before this change we would generate nested unsafe blocks that led to compiler warnings. This change minimizes each unsafe block and thereby avoids the nesting and compiler warnings. It's generally a best practice to keep unsafe blocks minimal to avoid the situation where a currently safe function is marked unsafe at a later point and all existing callsides don't need to be updated.
PiperOrigin-RevId: 582993146
This bug has been found by the TSAN sanitizer as part of cl/582814210. Before this change we were incorrectly returning an immutable Message instance for mutable accessors. This bug has been detected by TSAN because for embedded message fields the C++ runtime returns a static message instance if a field has not been set. In cl/582814210 this bug led to two separate unit tests read and write from/to the same object without any synchronization. Thus TSAN found a data race.
Tests for this change will be added as part of cl/582814210. At this state of the source we don't have any mutation functions available to trigger the TSAN error.
PiperOrigin-RevId: 582978261
Before this change the runtimes export a Map and MapInner. This change merges the Map and MapInner types into a single MapInner type, removing the Map type from the runtime (upb.rs, cpp.rs).
The motivation for this change is twofold:
1) A separate Map type is not strictly needed by the runtime. I hope this reduces some complexity.
2) After this change we can introduce a runtime-agnostic protobuf::Map type that implements Proxied.
PiperOrigin-RevId: 582978008