Add upb "No System Python" test run
This test validates that upb Python targets can be built successfully even if
Python is not installed locally.
I also updated our pinned upb version to pull in some recent fixes needed for
this test run.
PiperOrigin-RevId: 559504790
diff --git a/.github/workflows/test_upb.yml b/.github/workflows/test_upb.yml
index 7fdfddd..f3b1926 100644
--- a/.github/workflows/test_upb.yml
+++ b/.github/workflows/test_upb.yml
@@ -97,3 +97,25 @@
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: "upb-bazel-macos"
bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} @upb//...
+
+ no-python:
+ strategy:
+ fail-fast: false # Don't cancel all jobs if one fails.
+ name: No System Python
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout pending changes
+ uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
+ with:
+ ref: ${{ inputs.safe-checkout }}
+ - name: Run tests
+ uses: protocolbuffers/protobuf-ci/bazel-docker@v2
+ with:
+ image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:6.3.0-91a0ac83e968068672bc6001a4d474cfd9a50f1d
+ credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
+ bazel-cache: "upb-bazel-no-python"
+ bash: >-
+ which python3 &&
+ mv `which python3` /tmp &&
+ ! which python3 &&
+ bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 @upb//python/... -- -@upb//python/dist:source_wheel
diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c
index 50f8f3c..640e5a4 100644
--- a/php/ext/google/protobuf/php-upb.c
+++ b/php/ext/google/protobuf/php-upb.c
@@ -41,10 +41,13 @@
#include <assert.h>
#include <setjmp.h>
#include <stdbool.h>
-#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#ifndef UINTPTR_MAX
+Error, UINTPTR_MAX is undefined
+#endif
+
#if UINTPTR_MAX == 0xffffffff
#define UPB_SIZE(size32, size64) size32
#else
@@ -267,7 +270,7 @@
#define UPB_ASAN 1
#define UPB_ASAN_GUARD_SIZE 32
#ifdef __cplusplus
-extern "C" {
+ extern "C" {
#endif
void __asan_poison_memory_region(void const volatile *addr, size_t size);
void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
@@ -7405,6 +7408,25 @@
}
+const char _kUpb_ToBase92[] = {
+ ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
+ '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
+ 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
+ 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
+ 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '{', '|', '}', '~',
+};
+
+const int8_t _kUpb_FromBase92[] = {
+ 0, 1, -1, 2, 3, 4, 5, -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+};
+
+
// Must be last.
@@ -7699,25 +7721,6 @@
}
-const char _kUpb_ToBase92[] = {
- ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
- '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
- 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
- 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
- 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
- 'w', 'x', 'y', 'z', '{', '|', '}', '~',
-};
-
-const int8_t _kUpb_FromBase92[] = {
- 0, 1, -1, 2, 3, 4, 5, -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
-};
-
-
// Must be last.
diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h
index 182693f..e9b1443 100644
--- a/php/ext/google/protobuf/php-upb.h
+++ b/php/ext/google/protobuf/php-upb.h
@@ -40,10 +40,13 @@
#include <assert.h>
#include <setjmp.h>
#include <stdbool.h>
-#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#ifndef UINTPTR_MAX
+Error, UINTPTR_MAX is undefined
+#endif
+
#if UINTPTR_MAX == 0xffffffff
#define UPB_SIZE(size32, size64) size32
#else
@@ -266,7 +269,7 @@
#define UPB_ASAN 1
#define UPB_ASAN_GUARD_SIZE 32
#ifdef __cplusplus
-extern "C" {
+ extern "C" {
#endif
void __asan_poison_memory_region(void const volatile *addr, size_t size);
void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
@@ -468,7 +471,10 @@
const char* data;
size_t size;
} upb_StringView;
-// LINT.ThenChange(GoogleInternalName0)
+// LINT.ThenChange(
+// GoogleInternalName0,
+// //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string
+// )
#ifdef __cplusplus
extern "C" {
@@ -503,14 +509,14 @@
#include <stdint.h>
-#ifndef UPB_MESSAGE_TYPEDEF_H_
-#define UPB_MESSAGE_TYPEDEF_H_
+#ifndef UPB_MESSAGE_TYPES_H_
+#define UPB_MESSAGE_TYPES_H_
-// This typedef needs its own header to resolve a circular dependency between
+// This typedef is in a leaf header to resolve a circular dependency between
// messages and mini tables.
typedef void upb_Message;
-#endif /* UPB_MESSAGE_TYPEDEF_H_ */
+#endif /* UPB_MESSAGE_TYPES_H_ */
// Must be last.
@@ -577,6 +583,8 @@
#ifndef UPB_MINI_TABLE_INTERNAL_ENUM_H_
#define UPB_MINI_TABLE_INTERNAL_ENUM_H_
+#include <stdint.h>
+
// Must be last.
struct upb_MiniTableEnum {
@@ -646,6 +654,8 @@
#ifndef UPB_MINI_TABLE_INTERNAL_FIELD_H_
#define UPB_MINI_TABLE_INTERNAL_FIELD_H_
+#include <stdint.h>
+
// Must be last.
@@ -1037,6 +1047,8 @@
#ifndef UPB_MEM_ARENA_H_
#define UPB_MEM_ARENA_H_
+#include <stddef.h>
+#include <stdint.h>
#include <string.h>
@@ -2776,6 +2788,7 @@
UPB_INLINE void _upb_Message_AssertMapIsUntagged(
const upb_Message* msg, const upb_MiniTableField* field) {
+ UPB_UNUSED(msg);
_upb_MiniTableField_CheckIsMap(field);
#ifndef NDEBUG
upb_TaggedMessagePtr default_val = 0;
@@ -3418,6 +3431,23 @@
#define UPB_WIRE_DECODE_H_
+#ifndef UPB_WIRE_TYPES_H_
+#define UPB_WIRE_TYPES_H_
+
+#define kUpb_WireFormat_DefaultDepthLimit 100
+
+// A list of types as they are encoded on the wire.
+typedef enum {
+ kUpb_WireType_Varint = 0,
+ kUpb_WireType_64Bit = 1,
+ kUpb_WireType_Delimited = 2,
+ kUpb_WireType_StartGroup = 3,
+ kUpb_WireType_EndGroup = 4,
+ kUpb_WireType_32Bit = 5
+} upb_WireType;
+
+#endif /* UPB_WIRE_TYPES_H_ */
+
// Must be last.
#ifdef __cplusplus
@@ -11459,6 +11489,8 @@
#ifndef UPB_LEX_ATOI_H_
#define UPB_LEX_ATOI_H_
+#include <stdint.h>
+
// Must be last.
#ifdef __cplusplus
@@ -11484,6 +11516,8 @@
#ifndef UPB_LEX_UNICODE_H_
#define UPB_LEX_UNICODE_H_
+#include <stdint.h>
+
// Must be last.
#ifdef __cplusplus
@@ -11870,23 +11904,6 @@
#endif // UPB_PORT_ATOMIC_H_
-#ifndef UPB_WIRE_COMMON_H_
-#define UPB_WIRE_COMMON_H_
-
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define kUpb_WireFormat_DefaultDepthLimit 100
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // UPB_WIRE_COMMON_H_
-
#ifndef UPB_WIRE_READER_H_
#define UPB_WIRE_READER_H_
@@ -11894,6 +11911,8 @@
#ifndef UPB_WIRE_INTERNAL_SWAP_H_
#define UPB_WIRE_INTERNAL_SWAP_H_
+#include <stdint.h>
+
// Must be last.
#ifdef __cplusplus
@@ -11926,21 +11945,6 @@
#endif /* UPB_WIRE_INTERNAL_SWAP_H_ */
-#ifndef UPB_WIRE_TYPES_H_
-#define UPB_WIRE_TYPES_H_
-
-// A list of types as they are encoded on the wire.
-typedef enum {
- kUpb_WireType_Varint = 0,
- kUpb_WireType_64Bit = 1,
- kUpb_WireType_Delimited = 2,
- kUpb_WireType_StartGroup = 3,
- kUpb_WireType_EndGroup = 4,
- kUpb_WireType_32Bit = 5
-} upb_WireType;
-
-#endif /* UPB_WIRE_TYPES_H_ */
-
// Must be last.
#ifdef __cplusplus
@@ -12140,6 +12144,8 @@
#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
#define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
+#include <stdint.h>
+
// Must be last.
@@ -12315,6 +12321,8 @@
#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
#define UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
+#include <stdint.h>
+
// Must be last.
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index 8019f7a..5fbbf07 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -150,6 +150,6 @@
_github_archive(
name = "upb",
repo = "https://github.com/protocolbuffers/upb",
- commit = "cd176a0cd1913ea8c643680d206c8ca278815c2c",
- sha256 = "661b2d63dff82c6868cd1dea5e7be2ca1a6467746a146c293834f18aaa709077",
+ commit = "823a12e80934f9c8fb9178191d69f06a1bbfd604",
+ sha256 = "165f425714d32018a1a856b1935cfa24206878f8a469384808d2dce1d7c4003a",
)
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c
index d90ddaa..23be9a1 100644
--- a/ruby/ext/google/protobuf_c/ruby-upb.c
+++ b/ruby/ext/google/protobuf_c/ruby-upb.c
@@ -41,10 +41,13 @@
#include <assert.h>
#include <setjmp.h>
#include <stdbool.h>
-#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#ifndef UINTPTR_MAX
+Error, UINTPTR_MAX is undefined
+#endif
+
#if UINTPTR_MAX == 0xffffffff
#define UPB_SIZE(size32, size64) size32
#else
@@ -267,7 +270,7 @@
#define UPB_ASAN 1
#define UPB_ASAN_GUARD_SIZE 32
#ifdef __cplusplus
-extern "C" {
+ extern "C" {
#endif
void __asan_poison_memory_region(void const volatile *addr, size_t size);
void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
@@ -6944,6 +6947,25 @@
}
+const char _kUpb_ToBase92[] = {
+ ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
+ '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
+ 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
+ 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
+ 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
+ 'w', 'x', 'y', 'z', '{', '|', '}', '~',
+};
+
+const int8_t _kUpb_FromBase92[] = {
+ 0, 1, -1, 2, 3, 4, 5, -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+};
+
+
// Must be last.
@@ -7238,25 +7260,6 @@
}
-const char _kUpb_ToBase92[] = {
- ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/',
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
- '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
- 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
- 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
- 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
- 'w', 'x', 'y', 'z', '{', '|', '}', '~',
-};
-
-const int8_t _kUpb_FromBase92[] = {
- 0, 1, -1, 2, 3, 4, 5, -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, -1, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
-};
-
-
// Must be last.
diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h
index ca4c7a9..53bc0e9 100755
--- a/ruby/ext/google/protobuf_c/ruby-upb.h
+++ b/ruby/ext/google/protobuf_c/ruby-upb.h
@@ -42,10 +42,13 @@
#include <assert.h>
#include <setjmp.h>
#include <stdbool.h>
-#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#ifndef UINTPTR_MAX
+Error, UINTPTR_MAX is undefined
+#endif
+
#if UINTPTR_MAX == 0xffffffff
#define UPB_SIZE(size32, size64) size32
#else
@@ -268,7 +271,7 @@
#define UPB_ASAN 1
#define UPB_ASAN_GUARD_SIZE 32
#ifdef __cplusplus
-extern "C" {
+ extern "C" {
#endif
void __asan_poison_memory_region(void const volatile *addr, size_t size);
void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
@@ -470,7 +473,10 @@
const char* data;
size_t size;
} upb_StringView;
-// LINT.ThenChange(GoogleInternalName0)
+// LINT.ThenChange(
+// GoogleInternalName0,
+// //depot/google3/third_party/upb/bits/golang/accessor.go:map_go_string
+// )
#ifdef __cplusplus
extern "C" {
@@ -505,14 +511,14 @@
#include <stdint.h>
-#ifndef UPB_MESSAGE_TYPEDEF_H_
-#define UPB_MESSAGE_TYPEDEF_H_
+#ifndef UPB_MESSAGE_TYPES_H_
+#define UPB_MESSAGE_TYPES_H_
-// This typedef needs its own header to resolve a circular dependency between
+// This typedef is in a leaf header to resolve a circular dependency between
// messages and mini tables.
typedef void upb_Message;
-#endif /* UPB_MESSAGE_TYPEDEF_H_ */
+#endif /* UPB_MESSAGE_TYPES_H_ */
// Must be last.
@@ -579,6 +585,8 @@
#ifndef UPB_MINI_TABLE_INTERNAL_ENUM_H_
#define UPB_MINI_TABLE_INTERNAL_ENUM_H_
+#include <stdint.h>
+
// Must be last.
struct upb_MiniTableEnum {
@@ -648,6 +656,8 @@
#ifndef UPB_MINI_TABLE_INTERNAL_FIELD_H_
#define UPB_MINI_TABLE_INTERNAL_FIELD_H_
+#include <stdint.h>
+
// Must be last.
@@ -1039,6 +1049,8 @@
#ifndef UPB_MEM_ARENA_H_
#define UPB_MEM_ARENA_H_
+#include <stddef.h>
+#include <stdint.h>
#include <string.h>
@@ -2740,6 +2752,7 @@
UPB_INLINE void _upb_Message_AssertMapIsUntagged(
const upb_Message* msg, const upb_MiniTableField* field) {
+ UPB_UNUSED(msg);
_upb_MiniTableField_CheckIsMap(field);
#ifndef NDEBUG
upb_TaggedMessagePtr default_val = 0;
@@ -3382,6 +3395,23 @@
#define UPB_WIRE_DECODE_H_
+#ifndef UPB_WIRE_TYPES_H_
+#define UPB_WIRE_TYPES_H_
+
+#define kUpb_WireFormat_DefaultDepthLimit 100
+
+// A list of types as they are encoded on the wire.
+typedef enum {
+ kUpb_WireType_Varint = 0,
+ kUpb_WireType_64Bit = 1,
+ kUpb_WireType_Delimited = 2,
+ kUpb_WireType_StartGroup = 3,
+ kUpb_WireType_EndGroup = 4,
+ kUpb_WireType_32Bit = 5
+} upb_WireType;
+
+#endif /* UPB_WIRE_TYPES_H_ */
+
// Must be last.
#ifdef __cplusplus
@@ -11229,6 +11259,8 @@
#ifndef UPB_LEX_ATOI_H_
#define UPB_LEX_ATOI_H_
+#include <stdint.h>
+
// Must be last.
#ifdef __cplusplus
@@ -11254,6 +11286,8 @@
#ifndef UPB_LEX_UNICODE_H_
#define UPB_LEX_UNICODE_H_
+#include <stdint.h>
+
// Must be last.
#ifdef __cplusplus
@@ -11640,23 +11674,6 @@
#endif // UPB_PORT_ATOMIC_H_
-#ifndef UPB_WIRE_COMMON_H_
-#define UPB_WIRE_COMMON_H_
-
-// Must be last.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define kUpb_WireFormat_DefaultDepthLimit 100
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // UPB_WIRE_COMMON_H_
-
#ifndef UPB_WIRE_READER_H_
#define UPB_WIRE_READER_H_
@@ -11664,6 +11681,8 @@
#ifndef UPB_WIRE_INTERNAL_SWAP_H_
#define UPB_WIRE_INTERNAL_SWAP_H_
+#include <stdint.h>
+
// Must be last.
#ifdef __cplusplus
@@ -11696,21 +11715,6 @@
#endif /* UPB_WIRE_INTERNAL_SWAP_H_ */
-#ifndef UPB_WIRE_TYPES_H_
-#define UPB_WIRE_TYPES_H_
-
-// A list of types as they are encoded on the wire.
-typedef enum {
- kUpb_WireType_Varint = 0,
- kUpb_WireType_64Bit = 1,
- kUpb_WireType_Delimited = 2,
- kUpb_WireType_StartGroup = 3,
- kUpb_WireType_EndGroup = 4,
- kUpb_WireType_32Bit = 5
-} upb_WireType;
-
-#endif /* UPB_WIRE_TYPES_H_ */
-
// Must be last.
#ifdef __cplusplus
@@ -11910,6 +11914,8 @@
#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
#define UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_
+#include <stdint.h>
+
// Must be last.
@@ -12085,6 +12091,8 @@
#ifndef UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
#define UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_
+#include <stdint.h>
+
// Must be last.