Fix java_linkage_monitor test.
This was silently breaking because we didn't fail on errors in the test script. The upb version is also bumped to pull in improvements for system_python that fix the underlying issue (python 3.5 doesn't work with our pip dependencies).
PiperOrigin-RevId: 492526855
diff --git a/kokoro/linux/java_linkage_monitor/build.sh b/kokoro/linux/java_linkage_monitor/build.sh
index 7d4d7b7..de98697 100755
--- a/kokoro/linux/java_linkage_monitor/build.sh
+++ b/kokoro/linux/java_linkage_monitor/build.sh
@@ -6,6 +6,8 @@
# This script selects a specific Dockerfile (for building a Docker image) and
# a script to run inside that image.
+set -eux
+
use_bazel.sh 4.2.2
# Change to repo root
diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c
index 4be85ed..376b202 100644
--- a/php/ext/google/protobuf/php-upb.c
+++ b/php/ext/google/protobuf/php-upb.c
@@ -6377,9 +6377,12 @@
upb_MtDecoder_AssignHasbits(d->table);
// Map entries have a pre-determined layout, regardless of types.
- d->fields[0].offset = offsetof(upb_MapEntryData, k);
- d->fields[1].offset = offsetof(upb_MapEntryData, v);
- d->table->size = UPB_ALIGN_UP(sizeof(upb_MapEntryData), 8);
+ // NOTE: sync with mini_table/message_internal.h.
+ const size_t kv_size = d->platform == kUpb_MiniTablePlatform_32Bit ? 8 : 16;
+ const size_t hasbit_size = 8;
+ d->fields[0].offset = hasbit_size;
+ d->fields[1].offset = hasbit_size + kv_size;
+ d->table->size = UPB_ALIGN_UP(hasbit_size + kv_size + kv_size, 8);
// Map entries have a special bit set to signal it's a map entry, used in
// upb_MiniTable_SetSubMessage() below.
diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h
index 436e20d..bf9f538 100644
--- a/php/ext/google/protobuf/php-upb.h
+++ b/php/ext/google/protobuf/php-upb.h
@@ -1497,8 +1497,12 @@
//
// Note that users can and do create map entries directly, which will also use
// this layout.
+//
+// NOTE: sync with mini_table/decode.c.
typedef struct {
- uint32_t hasbits;
+ // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
+ // and the uint64_t helps make this clear.
+ uint64_t hasbits;
union {
upb_StringView str; // For str/bytes.
upb_value val; // For all other types.
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index 3d65b5a..ed24c53 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -135,6 +135,6 @@
_github_archive(
name = "upb",
repo = "https://github.com/protocolbuffers/upb",
- commit = "b198dd0754c415fa2bc445b2f07121ac3761048b",
- sha256 = "f400a6b425cfb334c360fc50192343139941aebeb451ed1d793b7cdba75a066c",
+ commit = "ee56471047ad8619d0c701f894aa1767ca91f5c2",
+ sha256 = "0c3f86ce497e6cc75e89a0d4a8e32c90ea25aaedabd6d42fb9e2f2ad52d3f4b0",
)
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c
index 56157d7..430b39e 100644
--- a/ruby/ext/google/protobuf_c/ruby-upb.c
+++ b/ruby/ext/google/protobuf_c/ruby-upb.c
@@ -6043,9 +6043,12 @@
upb_MtDecoder_AssignHasbits(d->table);
// Map entries have a pre-determined layout, regardless of types.
- d->fields[0].offset = offsetof(upb_MapEntryData, k);
- d->fields[1].offset = offsetof(upb_MapEntryData, v);
- d->table->size = UPB_ALIGN_UP(sizeof(upb_MapEntryData), 8);
+ // NOTE: sync with mini_table/message_internal.h.
+ const size_t kv_size = d->platform == kUpb_MiniTablePlatform_32Bit ? 8 : 16;
+ const size_t hasbit_size = 8;
+ d->fields[0].offset = hasbit_size;
+ d->fields[1].offset = hasbit_size + kv_size;
+ d->table->size = UPB_ALIGN_UP(hasbit_size + kv_size + kv_size, 8);
// Map entries have a special bit set to signal it's a map entry, used in
// upb_MiniTable_SetSubMessage() below.
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h
index 793f712..f3e625d 100755
--- a/ruby/ext/google/protobuf_c/ruby-upb.h
+++ b/ruby/ext/google/protobuf_c/ruby-upb.h
@@ -1499,8 +1499,12 @@
//
// Note that users can and do create map entries directly, which will also use
// this layout.
+//
+// NOTE: sync with mini_table/decode.c.
typedef struct {
- uint32_t hasbits;
+ // We only need 2 hasbits max, but due to alignment we'll use 8 bytes here,
+ // and the uint64_t helps make this clear.
+ uint64_t hasbits;
union {
upb_StringView str; // For str/bytes.
upb_value val; // For all other types.