Merge the protobuf and upb Bazel repos
A couple weeks ago we moved upb into the protobuf Git repo, and this change continues the merger of the two repos by making them into a single Bazel repo. This was mostly a matter of deleting upb's WORKSPACE file and fixing up a bunch of references to reflect the new structure. Most of the changes are pretty mechanical, but one thing that needed more invasive changes was the Python script for generating CMakeLists.txt, make_cmakelists.py. The WORKSPACE file it relied on no longer exists with this change, so I updated it to hardcode the information it needed from that file. PiperOrigin-RevId: 564810016pull/13886/head
parent
f175757c1a
commit
7286ffceb2
|
@ -1,6 +1,4 @@
|
||||||
# These are fetched as external repositories.
|
# These are fetched as external repositories.
|
||||||
third_party/abseil-cpp
|
third_party/abseil-cpp
|
||||||
third_party/googletest
|
third_party/googletest
|
||||||
# upb is its own Bazel repository for now.
|
|
||||||
upb/
|
|
||||||
_build/
|
_build/
|
||||||
|
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
version: [ "3.7", "3.8", "3.9", "3.10" ]
|
version: [ "3.7", "3.8", "3.9", "3.10" ]
|
||||||
include:
|
include:
|
||||||
- type: Pure
|
- type: Pure
|
||||||
targets: //python/... @upb//python/... //python:python_version
|
targets: //python/... //upb/python/... //python:python_version
|
||||||
flags: --define=use_fast_cpp_protos=false
|
flags: --define=use_fast_cpp_protos=false
|
||||||
- type: C++
|
- type: C++
|
||||||
targets: //python/... //python:python_version
|
targets: //python/... //python:python_version
|
||||||
|
@ -57,7 +57,7 @@ jobs:
|
||||||
version: [ "3.10" ]
|
version: [ "3.10" ]
|
||||||
include:
|
include:
|
||||||
- type: Pure
|
- type: Pure
|
||||||
targets: //python/... @upb//python/... //python:python_version
|
targets: //python/... //upb/python/... //python:python_version
|
||||||
- type: C++
|
- type: C++
|
||||||
targets: //python/... //python:python_version
|
targets: //python/... //python:python_version
|
||||||
flags: --define=use_fast_cpp_protos=true
|
flags: --define=use_fast_cpp_protos=true
|
||||||
|
|
|
@ -19,10 +19,10 @@ jobs:
|
||||||
config:
|
config:
|
||||||
- { name: "Fastbuild" }
|
- { name: "Fastbuild" }
|
||||||
- { name: "Optimized", flags: "-c opt" }
|
- { name: "Optimized", flags: "-c opt" }
|
||||||
- { name: "FastTable", flags: "--@upb//:fasttable_enabled=true" }
|
- { name: "FastTable", flags: "--//upb:fasttable_enabled=true" }
|
||||||
- { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-@upb//benchmarks:benchmark -@upb//python/..." }
|
- { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/..." }
|
||||||
- { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-@upb//benchmarks:benchmark -@upb//python/... -@upb//lua/..." }
|
- { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/... -//upb/lua/..." }
|
||||||
- { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-@upb//benchmarks:benchmark -@upb//python/..." }
|
- { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/..." }
|
||||||
# TODO: b/297027295 - Add 32-bit ASAN test
|
# TODO: b/297027295 - Add 32-bit ASAN test
|
||||||
|
|
||||||
name: ${{ matrix.config.name }}
|
name: ${{ matrix.config.name }}
|
||||||
|
@ -39,7 +39,7 @@ jobs:
|
||||||
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize@sha256:04cd765285bc52cbbf51d66c8c66d8603579cf0f19cc42df26b09d2c270541fb
|
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize@sha256:04cd765285bc52cbbf51d66c8c66d8603579cf0f19cc42df26b09d2c270541fb
|
||||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
||||||
bazel-cache: upb-bazel
|
bazel-cache: upb-bazel
|
||||||
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 @upb//... ${{ matrix.config.flags }}
|
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //upb/... ${{ matrix.config.flags }}
|
||||||
exclude-targets: ${{ matrix.config.exclude-targets }}
|
exclude-targets: ${{ matrix.config.exclude-targets }}
|
||||||
|
|
||||||
linux-gcc:
|
linux-gcc:
|
||||||
|
@ -58,12 +58,7 @@ jobs:
|
||||||
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:12.2-6.3.0-518b4fcd8d0ded2484c94f02e835526cacfdac2d"
|
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:12.2-6.3.0-518b4fcd8d0ded2484c94f02e835526cacfdac2d"
|
||||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
||||||
bazel-cache: "upb-bazel-gcc"
|
bazel-cache: "upb-bazel-gcc"
|
||||||
# The other test runs use the protobuf workspace. For this one let's
|
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //upb/...
|
||||||
# cd into upb and use its workspace instead, to make sure we cover
|
|
||||||
# that use case.
|
|
||||||
bash: >-
|
|
||||||
cd upb &&
|
|
||||||
bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //...
|
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -80,7 +75,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
||||||
bazel-cache: "upb-bazel-windows"
|
bazel-cache: "upb-bazel-windows"
|
||||||
bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 @upb//upb/... @upb//upbc/... @upb//python/... @upb//protos/... @upb//protos_generator/...
|
bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 //upb/upb/... //upb/upbc/... //upb/python/... //upb/protos/... //upb/protos_generator/...
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -101,7 +96,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
|
||||||
bazel-cache: "upb-bazel-macos"
|
bazel-cache: "upb-bazel-macos"
|
||||||
bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} @upb//...
|
bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //upb/...
|
||||||
|
|
||||||
no-python:
|
no-python:
|
||||||
strategy:
|
strategy:
|
||||||
|
@ -123,4 +118,4 @@ jobs:
|
||||||
which python3 &&
|
which python3 &&
|
||||||
mv `which python3` /tmp &&
|
mv `which python3` /tmp &&
|
||||||
! which python3 &&
|
! which python3 &&
|
||||||
bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 @upb//python/... -- -@upb//python/dist:source_wheel
|
bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //upb/python/... -- -//upb/python/dist:source_wheel
|
||||||
|
|
|
@ -294,13 +294,13 @@ alias(
|
||||||
alias(
|
alias(
|
||||||
name = "python_srcs",
|
name = "python_srcs",
|
||||||
actual = "//python:python_srcs",
|
actual = "//python:python_srcs",
|
||||||
visibility = ["@upb//:__subpackages__"],
|
visibility = ["//upb:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "python_test_srcs",
|
name = "python_test_srcs",
|
||||||
actual = "//python:python_test_srcs",
|
actual = "//python:python_test_srcs",
|
||||||
visibility = ["@upb//:__subpackages__"],
|
visibility = ["//upb:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
|
|
21
WORKSPACE
21
WORKSPACE
|
@ -7,15 +7,6 @@ local_repository(
|
||||||
path = "examples",
|
path = "examples",
|
||||||
)
|
)
|
||||||
|
|
||||||
# We will soon merge upb and protobuf into the same Bazel repository, but for
|
|
||||||
# now we depend on the separate Bazel repo in the upb/ directory. This is
|
|
||||||
# important to ensure that the CI tests exercise upb at head instead of relying
|
|
||||||
# on a stale version from protobuf_deps.bzl.
|
|
||||||
local_repository(
|
|
||||||
name = "upb",
|
|
||||||
path = "upb",
|
|
||||||
)
|
|
||||||
|
|
||||||
# Load common dependencies first to ensure we use the correct version
|
# Load common dependencies first to ensure we use the correct version
|
||||||
load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
|
load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
|
||||||
|
|
||||||
|
@ -116,13 +107,13 @@ ruby_bundle(
|
||||||
gemfile = "//ruby:Gemfile",
|
gemfile = "//ruby:Gemfile",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@upb//bazel:workspace_deps.bzl", "upb_deps")
|
load("//upb/bazel:workspace_deps.bzl", "upb_deps")
|
||||||
|
|
||||||
upb_deps()
|
upb_deps()
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "lua",
|
name = "lua",
|
||||||
build_file = "@upb//bazel:lua.BUILD",
|
build_file = "//upb/bazel:lua.BUILD",
|
||||||
sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b",
|
sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b",
|
||||||
strip_prefix = "lua-5.2.4",
|
strip_prefix = "lua-5.2.4",
|
||||||
urls = [
|
urls = [
|
||||||
|
@ -143,11 +134,11 @@ http_archive(
|
||||||
urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"],
|
urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"],
|
||||||
strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83",
|
strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83",
|
||||||
sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46",
|
sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46",
|
||||||
build_file = "@upb//benchmarks:BUILD.googleapis",
|
build_file = "//upb/benchmarks:BUILD.googleapis",
|
||||||
patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
|
patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@upb//bazel:system_python.bzl", "system_python")
|
load("//upb/bazel:system_python.bzl", "system_python")
|
||||||
|
|
||||||
system_python(
|
system_python(
|
||||||
name = "system_python",
|
name = "system_python",
|
||||||
|
@ -158,9 +149,9 @@ load("@system_python//:pip.bzl", "pip_parse")
|
||||||
|
|
||||||
pip_parse(
|
pip_parse(
|
||||||
name = "pip_deps",
|
name = "pip_deps",
|
||||||
requirements = "@upb//python:requirements.txt",
|
requirements = "//upb/python:requirements.txt",
|
||||||
requirements_overrides = {
|
requirements_overrides = {
|
||||||
"3.11": "@upb//python:requirements_311.txt",
|
"3.11": "//upb/python:requirements_311.txt",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
load("@rules_cc//cc:defs.bzl", "objc_library")
|
load("@rules_cc//cc:defs.bzl", "objc_library")
|
||||||
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
||||||
load("@upb//cmake:build_defs.bzl", "staleness_test")
|
load("//upb/cmake:build_defs.bzl", "staleness_test")
|
||||||
load("//conformance:defs.bzl", "conformance_test")
|
load("//conformance:defs.bzl", "conformance_test")
|
||||||
load(":defs.bzl", "objc_proto_camel_case_name")
|
load(":defs.bzl", "objc_proto_camel_case_name")
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
load("@rules_pkg//:mappings.bzl", "pkg_files", "pkg_filegroup", "strip_prefix")
|
load("@rules_pkg//:mappings.bzl", "pkg_files", "pkg_filegroup", "strip_prefix")
|
||||||
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
||||||
load("@upb//cmake:build_defs.bzl", "staleness_test")
|
load("//upb/cmake:build_defs.bzl", "staleness_test")
|
||||||
load("//build_defs:internal_shell.bzl", "inline_sh_binary")
|
load("//build_defs:internal_shell.bzl", "inline_sh_binary")
|
||||||
load("//conformance:defs.bzl", "conformance_test")
|
load("//conformance:defs.bzl", "conformance_test")
|
||||||
load("//:protobuf_version.bzl", "PROTOBUF_PHP_VERSION", "PROTOC_VERSION")
|
load("//:protobuf_version.bzl", "PROTOBUF_PHP_VERSION", "PROTOC_VERSION")
|
||||||
|
@ -85,14 +85,14 @@ conformance_test(
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = "copy_php_amalgamation_h",
|
name = "copy_php_amalgamation_h",
|
||||||
srcs = ["@upb//:php-upb.h"],
|
srcs = ["//upb:php-upb.h"],
|
||||||
outs = ["generated-in/ext/google/protobuf/php-upb.h"],
|
outs = ["generated-in/ext/google/protobuf/php-upb.h"],
|
||||||
cmd = "cp $< $@",
|
cmd = "cp $< $@",
|
||||||
)
|
)
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = "copy_php_amalgamation_c",
|
name = "copy_php_amalgamation_c",
|
||||||
srcs = ["@upb//:php-upb.c"],
|
srcs = ["//upb:php-upb.c"],
|
||||||
outs = ["generated-in/ext/google/protobuf/php-upb.c"],
|
outs = ["generated-in/ext/google/protobuf/php-upb.c"],
|
||||||
cmd = "cp $< $@",
|
cmd = "cp $< $@",
|
||||||
)
|
)
|
||||||
|
|
|
@ -46,7 +46,7 @@ internal_py_proto_library(
|
||||||
srcs_version = "PY2AND3",
|
srcs_version = "PY2AND3",
|
||||||
visibility = [
|
visibility = [
|
||||||
"//:__pkg__",
|
"//:__pkg__",
|
||||||
"@upb//:__subpackages__",
|
"//upb:__subpackages__",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ py_library(
|
||||||
srcs_version = "PY2AND3",
|
srcs_version = "PY2AND3",
|
||||||
visibility = [
|
visibility = [
|
||||||
"//:__pkg__",
|
"//:__pkg__",
|
||||||
"@upb//:__subpackages__",
|
"//upb:__subpackages__",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ py_library(
|
||||||
srcs_version = "PY3",
|
srcs_version = "PY3",
|
||||||
visibility = [
|
visibility = [
|
||||||
"//:__pkg__",
|
"//:__pkg__",
|
||||||
"@upb//:__subpackages__",
|
"//upb:__subpackages__",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -437,7 +437,7 @@ pkg_files(
|
||||||
"tox.ini",
|
"tox.ini",
|
||||||
],
|
],
|
||||||
strip_prefix = "",
|
strip_prefix = "",
|
||||||
visibility = ["@upb//:__subpackages__"],
|
visibility = ["//upb:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg_files(
|
pkg_files(
|
||||||
|
|
|
@ -21,8 +21,8 @@ If for some reason you wish to build the packages directly from this repo, you
|
||||||
can use the following Bazel commands:
|
can use the following Bazel commands:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ bazel build @upb//python/dist:source_wheel
|
$ bazel build //upb/python/dist:source_wheel
|
||||||
$ bazel build @upb//python/dist:binary_wheel
|
$ bazel build //upb/python/dist:binary_wheel
|
||||||
```
|
```
|
||||||
|
|
||||||
The binary wheel will build against whatever version of Python is installed on
|
The binary wheel will build against whatever version of Python is installed on
|
||||||
|
@ -49,7 +49,7 @@ following values:
|
||||||
better performance than any of the previous backends, and it is now the
|
better performance than any of the previous backends, and it is now the
|
||||||
default. It is distributed in our PyPI packages, and requires no special
|
default. It is distributed in our PyPI packages, and requires no special
|
||||||
installation. The code for this module lives in
|
installation. The code for this module lives in
|
||||||
[@upb/python](https://github.com/protocolbuffers/upb/tree/main/python).
|
[upb/python](https://github.com/protocolbuffers/protobuf/tree/main/upb/python).
|
||||||
1. **cpp**: This extension module wraps the C++ protobuf library. It is
|
1. **cpp**: This extension module wraps the C++ protobuf library. It is
|
||||||
deprecated and is no longer released in our PyPI packages, however it is
|
deprecated and is no longer released in our PyPI packages, however it is
|
||||||
still used in some legacy cases where apps want to perform zero-copy message
|
still used in some legacy cases where apps want to perform zero-copy message
|
||||||
|
|
|
@ -18,6 +18,6 @@ internal_py_test(
|
||||||
],
|
],
|
||||||
visibility = [
|
visibility = [
|
||||||
"//python:__pkg__",
|
"//python:__pkg__",
|
||||||
"@upb//python/pb_unit_tests:__pkg__",
|
"//upb/python/pb_unit_tests:__pkg__",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,7 +18,7 @@ ${BazelBin} test src/google/protobuf:well_known_types_staleness_test "$@" || ./b
|
||||||
${BazelBin} test objectivec:well_known_types_staleness_test "$@" || ./bazel-bin/objectivec/well_known_types_staleness_test --fix
|
${BazelBin} test objectivec:well_known_types_staleness_test "$@" || ./bazel-bin/objectivec/well_known_types_staleness_test --fix
|
||||||
${BazelBin} test php:test_amalgamation_staleness "$@" || ./bazel-bin/php/test_amalgamation_staleness --fix
|
${BazelBin} test php:test_amalgamation_staleness "$@" || ./bazel-bin/php/test_amalgamation_staleness --fix
|
||||||
${BazelBin} test ruby/ext/google/protobuf_c:test_amalgamation_staleness "$@" || ./bazel-bin/ruby/ext/google/protobuf_c/test_amalgamation_staleness --fix
|
${BazelBin} test ruby/ext/google/protobuf_c:test_amalgamation_staleness "$@" || ./bazel-bin/ruby/ext/google/protobuf_c/test_amalgamation_staleness --fix
|
||||||
(cd upb; ${BazelBin} test cmake:test_generated_files "$@" || ./bazel-bin/cmake/test_generated_files --fix)
|
${BazelBin} test upb/cmake:test_generated_files "$@" || ./bazel-bin/upb/cmake/test_generated_files --fix
|
||||||
|
|
||||||
# Generate C# code.
|
# Generate C# code.
|
||||||
# This doesn't currently have Bazel staleness tests, but there's an existing
|
# This doesn't currently have Bazel staleness tests, but there's an existing
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
load("@build_bazel_rules_apple//apple:apple_binary.bzl", "apple_binary")
|
load("@build_bazel_rules_apple//apple:apple_binary.bzl", "apple_binary")
|
||||||
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
||||||
load("@upb//cmake:build_defs.bzl", "staleness_test")
|
load("//upb/cmake:build_defs.bzl", "staleness_test")
|
||||||
|
|
||||||
package(default_visibility = ["//ruby:__subpackages__"])
|
package(default_visibility = ["//ruby:__subpackages__"])
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ genrule(
|
||||||
name = "copy_sources",
|
name = "copy_sources",
|
||||||
srcs = PROTOBUF_C_SOURCES + [
|
srcs = PROTOBUF_C_SOURCES + [
|
||||||
"glue.c",
|
"glue.c",
|
||||||
"@upb//:gen_ruby_amalgamation",
|
"//upb:gen_ruby_amalgamation",
|
||||||
],
|
],
|
||||||
outs = ["copy/%s" % src for src in PROTOBUF_C_SOURCES] + [
|
outs = ["copy/%s" % src for src in PROTOBUF_C_SOURCES] + [
|
||||||
"copy/glue.c",
|
"copy/glue.c",
|
||||||
|
@ -155,14 +155,14 @@ pkg_files(
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = "copy_ruby_amalgamation_h",
|
name = "copy_ruby_amalgamation_h",
|
||||||
srcs = ["@upb//:ruby-upb.h"],
|
srcs = ["//upb:ruby-upb.h"],
|
||||||
outs = ["generated-in/ruby-upb.h"],
|
outs = ["generated-in/ruby-upb.h"],
|
||||||
cmd = "cp $< $@",
|
cmd = "cp $< $@",
|
||||||
)
|
)
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = "copy_ruby_amalgamation_c",
|
name = "copy_ruby_amalgamation_c",
|
||||||
srcs = ["@upb//:ruby-upb.c"],
|
srcs = ["//upb:ruby-upb.c"],
|
||||||
outs = ["generated-in/ruby-upb.c"],
|
outs = ["generated-in/ruby-upb.c"],
|
||||||
cmd = "cp $< $@",
|
cmd = "cp $< $@",
|
||||||
)
|
)
|
||||||
|
|
|
@ -9,7 +9,7 @@ load("@rules_rust//rust/private:providers.bzl", "CrateInfo", "DepInfo", "DepVari
|
||||||
# buildifier: disable=bzl-visibility
|
# buildifier: disable=bzl-visibility
|
||||||
load("@rules_rust//rust/private:rustc.bzl", "rustc_compile_action")
|
load("@rules_rust//rust/private:rustc.bzl", "rustc_compile_action")
|
||||||
load("@rules_rust//rust:defs.bzl", "rust_common")
|
load("@rules_rust//rust:defs.bzl", "rust_common")
|
||||||
load("@upb//bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect")
|
load("//upb/bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect")
|
||||||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
|
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
|
||||||
|
|
||||||
proto_common = proto_common_do_not_use
|
proto_common = proto_common_do_not_use
|
||||||
|
|
|
@ -8,6 +8,6 @@ cc_library(
|
||||||
"//rust:__subpackages__",
|
"//rust:__subpackages__",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"@upb//:upb",
|
"//upb",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,4 +8,4 @@
|
||||||
|
|
||||||
#define UPB_BUILD_API
|
#define UPB_BUILD_API
|
||||||
|
|
||||||
#include "upb/mem/arena.h" // IWYU pragma: keep
|
#include "upb/upb/mem/arena.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
# Most rules are under google/protobuf. This package exists for convenience.
|
# Most rules are under google/protobuf. This package exists for convenience.
|
||||||
load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
|
load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
|
||||||
load("@upb//cmake:build_defs.bzl", "staleness_test")
|
load("//upb/cmake:build_defs.bzl", "staleness_test")
|
||||||
load("//conformance:defs.bzl", "conformance_test")
|
load("//conformance:defs.bzl", "conformance_test")
|
||||||
|
|
||||||
pkg_files(
|
pkg_files(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library", "cc_test")
|
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library", "cc_test")
|
||||||
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
||||||
load("@rules_proto//proto:defs.bzl", "proto_library")
|
load("@rules_proto//proto:defs.bzl", "proto_library")
|
||||||
load("@upb//cmake:build_defs.bzl", "staleness_test")
|
load("//upb/cmake:build_defs.bzl", "staleness_test")
|
||||||
load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS")
|
load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS")
|
||||||
|
|
||||||
package(
|
package(
|
||||||
|
@ -636,7 +636,6 @@ filegroup(
|
||||||
],
|
],
|
||||||
visibility = [
|
visibility = [
|
||||||
"//:__subpackages__",
|
"//:__subpackages__",
|
||||||
"@upb//:__subpackages__",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -786,7 +785,7 @@ proto_library(
|
||||||
visibility = [
|
visibility = [
|
||||||
"//:__pkg__",
|
"//:__pkg__",
|
||||||
"//conformance:__pkg__",
|
"//conformance:__pkg__",
|
||||||
"@upb//:__subpackages__",
|
"//upb:__subpackages__",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -797,7 +796,7 @@ proto_library(
|
||||||
visibility = [
|
visibility = [
|
||||||
"//:__pkg__",
|
"//:__pkg__",
|
||||||
"//conformance:__pkg__",
|
"//conformance:__pkg__",
|
||||||
"@upb//:__subpackages__",
|
"//upb:__subpackages__",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
":any_proto",
|
":any_proto",
|
||||||
|
|
|
@ -200,7 +200,7 @@ filegroup(
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "plugin_proto_src",
|
name = "plugin_proto_src",
|
||||||
srcs = ["plugin.proto"],
|
srcs = ["plugin.proto"],
|
||||||
visibility = ["@upb//:__subpackages__"],
|
visibility = ["//upb:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
exports_files(
|
exports_files(
|
||||||
|
|
110
upb/BUILD
110
upb/BUILD
|
@ -7,14 +7,14 @@
|
||||||
|
|
||||||
load("@rules_python//python:defs.bzl", "py_binary")
|
load("@rules_python//python:defs.bzl", "py_binary")
|
||||||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_proto_library.bzl",
|
"//upb/bazel:upb_proto_library.bzl",
|
||||||
"upb_proto_library_copts",
|
"upb_proto_library_copts",
|
||||||
"upb_proto_reflection_library",
|
"upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//upbc:bootstrap_compiler.bzl",
|
"//upb/upbc:bootstrap_compiler.bzl",
|
||||||
"bootstrap_cc_library",
|
"bootstrap_cc_library",
|
||||||
"bootstrap_upb_proto_library",
|
"bootstrap_upb_proto_library",
|
||||||
)
|
)
|
||||||
|
@ -26,13 +26,13 @@ load(
|
||||||
|
|
||||||
# begin:github_only
|
# begin:github_only
|
||||||
load(
|
load(
|
||||||
"//bazel:amalgamation.bzl",
|
"//upb/bazel:amalgamation.bzl",
|
||||||
"upb_amalgamation",
|
"upb_amalgamation",
|
||||||
)
|
)
|
||||||
# end:github_only
|
# end:github_only
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
#
|
#
|
||||||
# license(
|
# license(
|
||||||
# name = "license",
|
# name = "license",
|
||||||
|
@ -49,7 +49,7 @@ exports_files(
|
||||||
"BUILD",
|
"BUILD",
|
||||||
"WORKSPACE",
|
"WORKSPACE",
|
||||||
],
|
],
|
||||||
visibility = ["//cmake:__pkg__"],
|
visibility = ["//upb/cmake:__pkg__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
|
@ -66,7 +66,7 @@ bool_flag(
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "fasttable_enabled_setting",
|
name = "fasttable_enabled_setting",
|
||||||
flag_values = {"//:fasttable_enabled": "true"},
|
flag_values = {"//upb:fasttable_enabled": "true"},
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ cc_library(
|
||||||
hdrs = ["upb/generated_code_support.h"],
|
hdrs = ["upb/generated_code_support.h"],
|
||||||
copts = UPB_DEFAULT_COPTS,
|
copts = UPB_DEFAULT_COPTS,
|
||||||
textual_hdrs = [
|
textual_hdrs = [
|
||||||
"//upb/port:inc",
|
"//upb/upb/port:inc",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
@ -133,7 +133,7 @@ cc_library(
|
||||||
name = "generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
name = "generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
||||||
copts = UPB_DEFAULT_COPTS,
|
copts = UPB_DEFAULT_COPTS,
|
||||||
textual_hdrs = [
|
textual_hdrs = [
|
||||||
"//upb/port:inc",
|
"//upb/upb/port:inc",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
@ -146,7 +146,7 @@ cc_library(
|
||||||
],
|
],
|
||||||
copts = UPB_DEFAULT_COPTS,
|
copts = UPB_DEFAULT_COPTS,
|
||||||
textual_hdrs = [
|
textual_hdrs = [
|
||||||
"//upb/port:inc",
|
"//upb/upb/port:inc",
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
@ -164,16 +164,16 @@ bootstrap_upb_proto_library(
|
||||||
google3_src_files = ["net/proto2/proto/descriptor.proto"],
|
google3_src_files = ["net/proto2/proto/descriptor.proto"],
|
||||||
google3_src_rules = ["//net/proto2/proto:descriptor_proto_source"],
|
google3_src_rules = ["//net/proto2/proto:descriptor_proto_source"],
|
||||||
oss_src_files = ["google/protobuf/descriptor.proto"],
|
oss_src_files = ["google/protobuf/descriptor.proto"],
|
||||||
oss_src_rules = ["@com_google_protobuf//:descriptor_proto_srcs"],
|
oss_src_rules = ["//:descriptor_proto_srcs"],
|
||||||
oss_strip_prefix = "third_party/protobuf/github/bootstrap/src",
|
oss_strip_prefix = "third_party/protobuf/github/bootstrap/src",
|
||||||
proto_lib_deps = ["@com_google_protobuf//:descriptor_proto"],
|
proto_lib_deps = ["//:descriptor_proto"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
upb_proto_reflection_library(
|
upb_proto_reflection_library(
|
||||||
name = "descriptor_upb_proto_reflection",
|
name = "descriptor_upb_proto_reflection",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = ["@com_google_protobuf//:descriptor_proto"],
|
deps = ["//:descriptor_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO(b/232091617): Once we can delete the deprecated forwarding headers
|
# TODO(b/232091617): Once we can delete the deprecated forwarding headers
|
||||||
|
@ -273,196 +273,196 @@ bootstrap_cc_library(
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "base",
|
name = "base",
|
||||||
actual = "//upb/base",
|
actual = "//upb/upb/base",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "base_internal",
|
name = "base_internal",
|
||||||
actual = "//upb/base:internal",
|
actual = "//upb/upb/base:internal",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "collections",
|
name = "collections",
|
||||||
actual = "//upb/collections",
|
actual = "//upb/upb/collections",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "collections_internal",
|
name = "collections_internal",
|
||||||
actual = "//upb/collections:internal",
|
actual = "//upb/upb/collections:internal",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "collections_split64",
|
name = "collections_split64",
|
||||||
actual = "//upb/collections:split64",
|
actual = "//upb/upb/collections:split64",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "hash",
|
name = "hash",
|
||||||
actual = "//upb/hash",
|
actual = "//upb/upb/hash",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "json",
|
name = "json",
|
||||||
actual = "//upb/json",
|
actual = "//upb/upb/json",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "lex",
|
name = "lex",
|
||||||
actual = "//upb/lex",
|
actual = "//upb/upb/lex",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "mem",
|
name = "mem",
|
||||||
actual = "//upb/mem",
|
actual = "//upb/upb/mem",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "mem_internal",
|
name = "mem_internal",
|
||||||
actual = "//upb/mem:internal",
|
actual = "//upb/upb/mem:internal",
|
||||||
visibility = ["//:__subpackages__"],
|
visibility = ["//upb:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message",
|
name = "message",
|
||||||
actual = "//upb/message",
|
actual = "//upb/upb/message",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_accessors",
|
name = "message_accessors",
|
||||||
actual = "//upb/message:accessors",
|
actual = "//upb/upb/message:accessors",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_accessors_internal",
|
name = "message_accessors_internal",
|
||||||
actual = "//upb/message:accessors_internal",
|
actual = "//upb/upb/message:accessors_internal",
|
||||||
visibility = ["//:friends"],
|
visibility = ["//upb:friends"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_copy",
|
name = "message_copy",
|
||||||
actual = "//upb/message:copy",
|
actual = "//upb/upb/message:copy",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_internal",
|
name = "message_internal",
|
||||||
actual = "//upb/message:internal",
|
actual = "//upb/upb/message:internal",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_internal_types",
|
name = "message_internal_types",
|
||||||
actual = "//upb/message:internal_types",
|
actual = "//upb/upb/message:internal_types",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_promote",
|
name = "message_promote",
|
||||||
actual = "//upb/message:promote",
|
actual = "//upb/upb/message:promote",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_split64",
|
name = "message_split64",
|
||||||
actual = "//upb/message:split64",
|
actual = "//upb/upb/message:split64",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_tagged_ptr",
|
name = "message_tagged_ptr",
|
||||||
actual = "//upb/message:tagged_ptr",
|
actual = "//upb/upb/message:tagged_ptr",
|
||||||
visibility = ["//:friends"],
|
visibility = ["//upb:friends"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "message_types",
|
name = "message_types",
|
||||||
actual = "//upb/message:types",
|
actual = "//upb/upb/message:types",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "mini_descriptor",
|
name = "mini_descriptor",
|
||||||
actual = "//upb/mini_descriptor",
|
actual = "//upb/upb/mini_descriptor",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "mini_descriptor_internal",
|
name = "mini_descriptor_internal",
|
||||||
actual = "//upb/mini_descriptor:internal",
|
actual = "//upb/upb/mini_descriptor:internal",
|
||||||
visibility = ["//:__subpackages__"],
|
visibility = ["//upb:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "mini_table",
|
name = "mini_table",
|
||||||
actual = "//upb/mini_table",
|
actual = "//upb/upb/mini_table",
|
||||||
visibility = ["//:friends"],
|
visibility = ["//upb:friends"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# alias(
|
# alias(
|
||||||
# name = "mini_table_compat",
|
# name = "mini_table_compat",
|
||||||
# actual = "//upb/mini_table:compat",
|
# actual = "//upb/upb/mini_table:compat",
|
||||||
# compatible_with = ["//buildenv/target:non_prod"],
|
# compatible_with = ["//buildenv/target:non_prod"],
|
||||||
# visibility = ["//:friends"],
|
# visibility = ["//upb:friends"],
|
||||||
# )
|
# )
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "mini_table_internal",
|
name = "mini_table_internal",
|
||||||
actual = "//upb/mini_table:internal",
|
actual = "//upb/upb/mini_table:internal",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "port",
|
name = "port",
|
||||||
actual = "//upb/port",
|
actual = "//upb/upb/port",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "text",
|
name = "text",
|
||||||
actual = "//upb/text",
|
actual = "//upb/upb/text",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "wire",
|
name = "wire",
|
||||||
actual = "//upb/wire",
|
actual = "//upb/upb/wire",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "wire_internal",
|
name = "wire_internal",
|
||||||
actual = "//upb/wire:internal",
|
actual = "//upb/upb/wire:internal",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "wire_reader",
|
name = "wire_reader",
|
||||||
actual = "//upb/wire:reader",
|
actual = "//upb/upb/wire:reader",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "wire_types",
|
name = "wire_types",
|
||||||
actual = "//upb/wire:types",
|
actual = "//upb/upb/wire:types",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "eps_copy_input_stream",
|
name = "eps_copy_input_stream",
|
||||||
actual = "//upb/wire:eps_copy_input_stream",
|
actual = "//upb/upb/wire:eps_copy_input_stream",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ exports_files(
|
||||||
"third_party/lunit/console.lua",
|
"third_party/lunit/console.lua",
|
||||||
"third_party/lunit/lunit.lua",
|
"third_party/lunit/lunit.lua",
|
||||||
],
|
],
|
||||||
visibility = ["//lua:__pkg__"],
|
visibility = ["//upb/lua:__pkg__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
|
@ -681,8 +681,8 @@ filegroup(
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
visibility = [
|
visibility = [
|
||||||
"//cmake:__pkg__",
|
"//upb/cmake:__pkg__",
|
||||||
"//python/dist:__pkg__",
|
"//upb/python/dist:__pkg__",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
# end:github_only
|
# end:github_only
|
||||||
|
@ -720,7 +720,7 @@ filegroup(
|
||||||
# "upb_UnknownToMessage_Status",
|
# "upb_UnknownToMessage_Status",
|
||||||
# "upb_WireType",
|
# "upb_WireType",
|
||||||
# ],
|
# ],
|
||||||
# visibility = ["//:__subpackages__"],
|
# visibility = ["//upb:__subpackages__"],
|
||||||
# )
|
# )
|
||||||
#
|
#
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
workspace(name = "upb")
|
|
||||||
|
|
||||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
||||||
load("//bazel:workspace_deps.bzl", "upb_deps")
|
|
||||||
|
|
||||||
local_repository(
|
|
||||||
name = "com_google_protobuf",
|
|
||||||
path = "..",
|
|
||||||
)
|
|
||||||
|
|
||||||
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
|
|
||||||
protobuf_deps()
|
|
||||||
|
|
||||||
upb_deps()
|
|
||||||
|
|
||||||
load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps")
|
|
||||||
utf8_range_deps()
|
|
||||||
|
|
||||||
http_archive(
|
|
||||||
name = "lua",
|
|
||||||
build_file = "//bazel:lua.BUILD",
|
|
||||||
sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b",
|
|
||||||
strip_prefix = "lua-5.2.4",
|
|
||||||
urls = [
|
|
||||||
"https://mirror.bazel.build/www.lua.org/ftp/lua-5.2.4.tar.gz",
|
|
||||||
"https://www.lua.org/ftp/lua-5.2.4.tar.gz",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
http_archive(
|
|
||||||
name = "com_github_google_benchmark",
|
|
||||||
urls = ["https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.zip"],
|
|
||||||
strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47",
|
|
||||||
sha256 = "62e2f2e6d8a744d67e4bbc212fcfd06647080de4253c97ad5c6749e09faf2cb0",
|
|
||||||
)
|
|
||||||
|
|
||||||
http_archive(
|
|
||||||
name = "com_google_googleapis",
|
|
||||||
urls = ["https://github.com/googleapis/googleapis/archive/refs/heads/master.zip"],
|
|
||||||
build_file = "//benchmarks:BUILD.googleapis",
|
|
||||||
strip_prefix = "googleapis-master",
|
|
||||||
patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
|
|
||||||
)
|
|
||||||
|
|
||||||
http_archive(
|
|
||||||
name = "com_google_absl",
|
|
||||||
sha256 = "e7fdfe0bed87702a22c5b73b6b5fe08bedd25f17d617e52df6061b0f47d480b0",
|
|
||||||
strip_prefix = "abseil-cpp-e6044634dd7caec2d79a13aecc9e765023768757",
|
|
||||||
urls = [
|
|
||||||
"https://github.com/abseil/abseil-cpp/archive/e6044634dd7caec2d79a13aecc9e765023768757.tar.gz"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
http_archive(
|
|
||||||
name = "com_google_googletest",
|
|
||||||
sha256 = "730215d76eace9dd49bf74ce044e8daa065d175f1ac891cc1d6bb184ef94e565",
|
|
||||||
strip_prefix = "googletest-f53219cdcb7b084ef57414efea92ee5b71989558",
|
|
||||||
urls = [
|
|
||||||
"https://github.com/google/googletest/archive/f53219cdcb7b084ef57414efea92ee5b71989558.tar.gz" # 2023-03-16
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps")
|
|
||||||
|
|
||||||
googletest_deps()
|
|
||||||
|
|
||||||
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
|
|
||||||
|
|
||||||
rules_pkg_dependencies()
|
|
||||||
|
|
||||||
load("//bazel:system_python.bzl", "system_python")
|
|
||||||
system_python(
|
|
||||||
name = "system_python",
|
|
||||||
minimum_python_version = "3.7",
|
|
||||||
)
|
|
||||||
|
|
||||||
load("@system_python//:register.bzl", "register_system_python")
|
|
||||||
register_system_python()
|
|
||||||
|
|
||||||
load("@system_python//:pip.bzl", "pip_parse")
|
|
||||||
|
|
||||||
pip_parse(
|
|
||||||
name="pip_deps",
|
|
||||||
requirements = "//python:requirements.txt",
|
|
||||||
requirements_overrides = {
|
|
||||||
"3.11": "//python:requirements_311.txt",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
load("@pip_deps//:requirements.bzl", "install_deps")
|
|
||||||
install_deps()
|
|
|
@ -9,20 +9,20 @@ load("@rules_python//python:defs.bzl", "py_binary")
|
||||||
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
|
||||||
exports_files(
|
exports_files(
|
||||||
["workspace_deps.bzl"],
|
["workspace_deps.bzl"],
|
||||||
visibility = ["//cmake:__pkg__"],
|
visibility = ["//upb/cmake:__pkg__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
py_binary(
|
py_binary(
|
||||||
name = "amalgamate",
|
name = "amalgamate",
|
||||||
srcs = ["amalgamate.py"],
|
srcs = ["amalgamate.py"],
|
||||||
visibility = ["//:__pkg__"],
|
visibility = ["//upb:__pkg__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# py_proto_library() is private rule, only intended for internal use by upb.
|
# py_proto_library() is private rule, only intended for internal use by upb.
|
||||||
|
|
|
@ -54,7 +54,7 @@ upb_amalgamation = rule(
|
||||||
"_amalgamator": attr.label(
|
"_amalgamator": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "//bazel:amalgamate",
|
default = "//upb/bazel:amalgamate",
|
||||||
),
|
),
|
||||||
"prefix": attr.string(
|
"prefix": attr.string(
|
||||||
default = "",
|
default = "",
|
||||||
|
|
|
@ -29,13 +29,13 @@ _DEFAULT_COPTS.extend([
|
||||||
# end:github_only
|
# end:github_only
|
||||||
|
|
||||||
UPB_DEFAULT_CPPOPTS = select({
|
UPB_DEFAULT_CPPOPTS = select({
|
||||||
"//:windows": [],
|
"//upb:windows": [],
|
||||||
"//conditions:default": _DEFAULT_CPPOPTS,
|
"//conditions:default": _DEFAULT_CPPOPTS,
|
||||||
})
|
})
|
||||||
|
|
||||||
UPB_DEFAULT_COPTS = select({
|
UPB_DEFAULT_COPTS = select({
|
||||||
"//:windows": [],
|
"//upb:windows": [],
|
||||||
"//:fasttable_enabled_setting": ["-std=gnu99", "-DUPB_ENABLE_FASTTABLE"],
|
"//upb:fasttable_enabled_setting": ["-std=gnu99", "-DUPB_ENABLE_FASTTABLE"],
|
||||||
"//conditions:default": _DEFAULT_COPTS,
|
"//conditions:default": _DEFAULT_COPTS,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ _py_proto_library_aspect = aspect(
|
||||||
"_protoc": attr.label(
|
"_protoc": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "@com_google_protobuf//:protoc",
|
default = "//:protoc",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
implementation = _py_proto_library_aspect_impl,
|
implementation = _py_proto_library_aspect_impl,
|
||||||
|
|
|
@ -413,25 +413,25 @@ def _get_upb_proto_library_aspect_provides():
|
||||||
upb_proto_library_aspect = aspect(
|
upb_proto_library_aspect = aspect(
|
||||||
attrs = {
|
attrs = {
|
||||||
"_copts": attr.label(
|
"_copts": attr.label(
|
||||||
default = "//:upb_proto_library_copts__for_generated_code_only_do_not_use",
|
default = "//upb:upb_proto_library_copts__for_generated_code_only_do_not_use",
|
||||||
),
|
),
|
||||||
"_gen_upb": attr.label(
|
"_gen_upb": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "//upbc:protoc-gen-upb_stage1",
|
default = "//upb/upbc:protoc-gen-upb_stage1",
|
||||||
),
|
),
|
||||||
"_protoc": attr.label(
|
"_protoc": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "@com_google_protobuf//:protoc",
|
default = "//:protoc",
|
||||||
),
|
),
|
||||||
"_cc_toolchain": attr.label(
|
"_cc_toolchain": attr.label(
|
||||||
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
|
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
|
||||||
),
|
),
|
||||||
"_upb": attr.label_list(default = [
|
"_upb": attr.label_list(default = [
|
||||||
"//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
"//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
||||||
]),
|
]),
|
||||||
"_fasttable_enabled": attr.label(default = "//:fasttable_enabled"),
|
"_fasttable_enabled": attr.label(default = "//upb:fasttable_enabled"),
|
||||||
},
|
},
|
||||||
implementation = upb_proto_library_aspect_impl,
|
implementation = upb_proto_library_aspect_impl,
|
||||||
provides = _get_upb_proto_library_aspect_provides(),
|
provides = _get_upb_proto_library_aspect_provides(),
|
||||||
|
@ -462,24 +462,24 @@ upb_c_proto_library = upb_proto_library
|
||||||
_upb_proto_reflection_library_aspect = aspect(
|
_upb_proto_reflection_library_aspect = aspect(
|
||||||
attrs = {
|
attrs = {
|
||||||
"_copts": attr.label(
|
"_copts": attr.label(
|
||||||
default = "//:upb_proto_library_copts__for_generated_code_only_do_not_use",
|
default = "//upb:upb_proto_library_copts__for_generated_code_only_do_not_use",
|
||||||
),
|
),
|
||||||
"_gen_upbdefs": attr.label(
|
"_gen_upbdefs": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "//upbc:protoc-gen-upbdefs",
|
default = "//upb/upbc:protoc-gen-upbdefs",
|
||||||
),
|
),
|
||||||
"_protoc": attr.label(
|
"_protoc": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "@com_google_protobuf//:protoc",
|
default = "//:protoc",
|
||||||
),
|
),
|
||||||
"_cc_toolchain": attr.label(
|
"_cc_toolchain": attr.label(
|
||||||
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
|
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
|
||||||
),
|
),
|
||||||
"_upbdefs": attr.label_list(
|
"_upbdefs": attr.label_list(
|
||||||
default = [
|
default = [
|
||||||
"//:generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
"//upb:generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
|
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
|
||||||
load("//bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive")
|
load("//upb/bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive")
|
||||||
|
|
||||||
def _github_archive(repo, commit, **kwargs):
|
def _github_archive(repo, commit, **kwargs):
|
||||||
repo_name = repo.split("/")[-1]
|
repo_name = repo.split("/")[-1]
|
||||||
|
|
|
@ -12,7 +12,7 @@ load("@rules_python//python:defs.bzl", "py_binary")
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_proto_library.bzl",
|
"//upb/bazel:upb_proto_library.bzl",
|
||||||
"upb_proto_library",
|
"upb_proto_library",
|
||||||
"upb_proto_reflection_library",
|
"upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
|
@ -25,7 +25,7 @@ load(
|
||||||
)
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
@ -75,14 +75,14 @@ cc_test(
|
||||||
":benchmark_descriptor_sv_cc_proto",
|
":benchmark_descriptor_sv_cc_proto",
|
||||||
":benchmark_descriptor_upb_proto",
|
":benchmark_descriptor_upb_proto",
|
||||||
":benchmark_descriptor_upb_proto_reflection",
|
":benchmark_descriptor_upb_proto_reflection",
|
||||||
"//:base",
|
"//:protobuf",
|
||||||
"//:base_internal",
|
"//upb:base",
|
||||||
"//:descriptor_upb_proto",
|
"//upb:base_internal",
|
||||||
"//:mem",
|
"//upb:descriptor_upb_proto",
|
||||||
"//:reflection",
|
"//upb:mem",
|
||||||
|
"//upb:reflection",
|
||||||
"@com_github_google_benchmark//:benchmark_main",
|
"@com_github_google_benchmark//:benchmark_main",
|
||||||
"@com_google_absl//absl/container:flat_hash_set",
|
"@com_google_absl//absl/container:flat_hash_set",
|
||||||
"@com_google_protobuf//:protobuf",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -38,15 +38,15 @@
|
||||||
#include "google/protobuf/descriptor.pb.h"
|
#include "google/protobuf/descriptor.pb.h"
|
||||||
#include "absl/container/flat_hash_set.h"
|
#include "absl/container/flat_hash_set.h"
|
||||||
#include "google/protobuf/dynamic_message.h"
|
#include "google/protobuf/dynamic_message.h"
|
||||||
#include "benchmarks/descriptor.pb.h"
|
#include "upb/benchmarks/descriptor.pb.h"
|
||||||
#include "benchmarks/descriptor.upb.h"
|
#include "upb/benchmarks/descriptor.upb.h"
|
||||||
#include "benchmarks/descriptor.upbdefs.h"
|
#include "upb/benchmarks/descriptor.upbdefs.h"
|
||||||
#include "benchmarks/descriptor_sv.pb.h"
|
#include "upb/benchmarks/descriptor_sv.pb.h"
|
||||||
#include "upb/base/internal/log2.h"
|
#include "upb/upb/base/internal/log2.h"
|
||||||
#include "upb/mem/arena.h"
|
#include "upb/upb/mem/arena.h"
|
||||||
#include "upb/reflection/def.hpp"
|
#include "upb/upb/reflection/def.hpp"
|
||||||
|
|
||||||
upb_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor;
|
upb_StringView descriptor = upb_benchmarks_descriptor_proto_upbdefinit.descriptor;
|
||||||
namespace protobuf = ::google::protobuf;
|
namespace protobuf = ::google::protobuf;
|
||||||
|
|
||||||
// A buffer big enough to parse descriptor.proto without going to heap.
|
// A buffer big enough to parse descriptor.proto without going to heap.
|
||||||
|
|
|
@ -10,7 +10,7 @@ load(
|
||||||
"staleness_test",
|
"staleness_test",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"make_shell_script",
|
"make_shell_script",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -35,21 +35,17 @@ py_binary(
|
||||||
genrule(
|
genrule(
|
||||||
name = "gen_cmakelists",
|
name = "gen_cmakelists",
|
||||||
srcs = [
|
srcs = [
|
||||||
"//:BUILD",
|
"//upb:BUILD",
|
||||||
"//:WORKSPACE",
|
|
||||||
"//bazel:workspace_deps.bzl",
|
|
||||||
],
|
],
|
||||||
outs = ["generated-in/CMakeLists.txt"],
|
outs = ["generated-in/CMakeLists.txt"],
|
||||||
cmd = "$(location :make_cmakelists) " +
|
cmd = "$(location :make_cmakelists) " +
|
||||||
"$(location //bazel:workspace_deps.bzl) " +
|
"$(location //upb:BUILD) $@",
|
||||||
"$(location //:WORKSPACE) " +
|
|
||||||
"$(location //:BUILD) $@",
|
|
||||||
tools = [":make_cmakelists"],
|
tools = [":make_cmakelists"],
|
||||||
)
|
)
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = "copy_protos",
|
name = "copy_protos",
|
||||||
srcs = ["//:descriptor_upb_proto"],
|
srcs = ["//upb:descriptor_upb_proto"],
|
||||||
outs = [
|
outs = [
|
||||||
"generated-in/google/protobuf/descriptor.upb.c",
|
"generated-in/google/protobuf/descriptor.upb.c",
|
||||||
"generated-in/google/protobuf/descriptor.upb.h",
|
"generated-in/google/protobuf/descriptor.upb.h",
|
||||||
|
@ -85,18 +81,18 @@ sh_test(
|
||||||
data = [
|
data = [
|
||||||
":copy_protos",
|
":copy_protos",
|
||||||
":gen_cmakelists",
|
":gen_cmakelists",
|
||||||
"//:source_files",
|
"//upb:source_files",
|
||||||
"//upb/base:source_files",
|
"//upb/upb/base:source_files",
|
||||||
"//upb/collections:source_files",
|
"//upb/upb/collections:source_files",
|
||||||
"//upb/hash:source_files",
|
"//upb/upb/hash:source_files",
|
||||||
"//upb/lex:source_files",
|
"//upb/upb/lex:source_files",
|
||||||
"//upb/mem:source_files",
|
"//upb/upb/mem:source_files",
|
||||||
"//upb/message:source_files",
|
"//upb/upb/message:source_files",
|
||||||
"//upb/mini_descriptor:source_files",
|
"//upb/upb/mini_descriptor:source_files",
|
||||||
"//upb/mini_table:source_files",
|
"//upb/upb/mini_table:source_files",
|
||||||
"//upb/port:source_files",
|
"//upb/upb/port:source_files",
|
||||||
"//upb/text:source_files",
|
"//upb/upb/text:source_files",
|
||||||
"//upb/wire:source_files",
|
"//upb/upb/wire:source_files",
|
||||||
"@utf8_range//:utf8_range_srcs",
|
"@utf8_range//:utf8_range_srcs",
|
||||||
],
|
],
|
||||||
target_compatible_with = select({
|
target_compatible_with = select({
|
||||||
|
|
|
@ -27,7 +27,7 @@ def staleness_test(name, outs, generated_pattern, target_files = None, tags = []
|
||||||
"""
|
"""
|
||||||
|
|
||||||
script_name = name + ".py"
|
script_name = name + ".py"
|
||||||
script_src = Label("//cmake:staleness_test.py")
|
script_src = Label("//upb/cmake:staleness_test.py")
|
||||||
|
|
||||||
# Filter out non-existing rules so Blaze doesn't error out before we even
|
# Filter out non-existing rules so Blaze doesn't error out before we even
|
||||||
# run the test.
|
# run the test.
|
||||||
|
@ -52,7 +52,7 @@ def staleness_test(name, outs, generated_pattern, target_files = None, tags = []
|
||||||
data = existing_outs + [generated_pattern % file for file in outs],
|
data = existing_outs + [generated_pattern % file for file in outs],
|
||||||
python_version = "PY3",
|
python_version = "PY3",
|
||||||
deps = [
|
deps = [
|
||||||
Label("//cmake:staleness_test_lib"),
|
Label("//upb/cmake:staleness_test_lib"),
|
||||||
],
|
],
|
||||||
tags = ["staleness_test"] + tags,
|
tags = ["staleness_test"] + tags,
|
||||||
**kwargs
|
**kwargs
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
"""A tool to convert {WORKSPACE, BUILD} -> CMakeLists.txt.
|
"""A tool to convert BUILD -> CMakeLists.txt.
|
||||||
|
|
||||||
This tool is very upb-specific at the moment, and should not be seen as a
|
This tool is very upb-specific at the moment, and should not be seen as a
|
||||||
generic Bazel -> CMake converter.
|
generic Bazel -> CMake converter.
|
||||||
|
@ -236,92 +236,14 @@ class BuildFileFunctions(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class WorkspaceFileFunctions(object):
|
|
||||||
def __init__(self, converter):
|
|
||||||
self.converter = converter
|
|
||||||
|
|
||||||
def load(self, *args, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def workspace(self, **kwargs):
|
|
||||||
self.converter.prelude += "project(%s)\n" % (kwargs["name"])
|
|
||||||
self.converter.prelude += "set(CMAKE_C_STANDARD 99)\n"
|
|
||||||
|
|
||||||
def maybe(self, rule, **kwargs):
|
|
||||||
if kwargs["name"] == "utf8_range":
|
|
||||||
self.converter.utf8_range_commit = kwargs["commit"]
|
|
||||||
pass
|
|
||||||
|
|
||||||
def http_archive(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def git_repository(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def new_git_repository(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def bazel_version_repository(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def protobuf_deps(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def utf8_range_deps(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def pip_parse(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def rules_fuzzing_dependencies(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def rules_fuzzing_init(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def rules_pkg_dependencies(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def system_python(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def register_system_python(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def register_toolchains(self, toolchain):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def python_source_archive(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def python_nuget_package(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def install_deps(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def fuzzing_py_install_deps(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def googletest_deps(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def local_repository(self, **kwargs):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class Converter(object):
|
class Converter(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.prelude = ""
|
|
||||||
self.toplevel = ""
|
self.toplevel = ""
|
||||||
self.if_lua = ""
|
self.if_lua = ""
|
||||||
self.utf8_range_commit = ""
|
|
||||||
|
|
||||||
def convert(self):
|
def convert(self):
|
||||||
return self.template % {
|
return self.template % {
|
||||||
"prelude": converter.prelude,
|
|
||||||
"toplevel": converter.toplevel,
|
"toplevel": converter.toplevel,
|
||||||
"utf8_range_commit": converter.utf8_range_commit,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template = textwrap.dedent("""\
|
template = textwrap.dedent("""\
|
||||||
|
@ -329,7 +251,8 @@ class Converter(object):
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.10...3.24)
|
cmake_minimum_required(VERSION 3.10...3.24)
|
||||||
|
|
||||||
%(prelude)s
|
project(upb)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
# Prevent CMake from setting -rdynamic on Linux (!!).
|
# Prevent CMake from setting -rdynamic on Linux (!!).
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||||
|
@ -366,7 +289,7 @@ class Converter(object):
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TARGET utf8_range)
|
if(NOT TARGET utf8_range)
|
||||||
if(EXISTS ../external/utf8_range)
|
if(EXISTS ../../external/utf8_range)
|
||||||
# utf8_range is already installed
|
# utf8_range is already installed
|
||||||
include_directories(../external/utf8_range)
|
include_directories(../external/utf8_range)
|
||||||
elseif(EXISTS ../../utf8_range)
|
elseif(EXISTS ../../utf8_range)
|
||||||
|
@ -376,7 +299,7 @@ class Converter(object):
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
utf8_range
|
utf8_range
|
||||||
GIT_REPOSITORY "https://github.com/protocolbuffers/utf8_range.git"
|
GIT_REPOSITORY "https://github.com/protocolbuffers/utf8_range.git"
|
||||||
GIT_TAG "%(utf8_range_commit)s"
|
GIT_TAG "d863bc33e15cba6d873c878dcca9e6fe52b2f8cb"
|
||||||
)
|
)
|
||||||
FetchContent_GetProperties(utf8_range)
|
FetchContent_GetProperties(utf8_range)
|
||||||
if(NOT utf8_range_POPULATED)
|
if(NOT utf8_range_POPULATED)
|
||||||
|
@ -412,12 +335,9 @@ def GetDict(obj):
|
||||||
|
|
||||||
globs = GetDict(converter)
|
globs = GetDict(converter)
|
||||||
|
|
||||||
workspace_dict = GetDict(WorkspaceFileFunctions(converter))
|
# We take the BUILD path as a command-line argument to ensure that we can find
|
||||||
# We take all file paths as command-line arguments to ensure that we can find
|
# it regardless of how exactly Bazel was invoked.
|
||||||
# each file regardless of how exactly Bazel was invoked.
|
exec(open(sys.argv[1]).read(), GetDict(BuildFileFunctions(converter))) # BUILD
|
||||||
exec(open(sys.argv[1]).read(), workspace_dict) # workspace_deps.bzl
|
|
||||||
exec(open(sys.argv[2]).read(), workspace_dict) # WORKSPACE
|
|
||||||
exec(open(sys.argv[3]).read(), GetDict(BuildFileFunctions(converter))) # BUILD
|
|
||||||
|
|
||||||
with open(sys.argv[4], "w") as f:
|
with open(sys.argv[2], "w") as f:
|
||||||
f.write(converter.convert())
|
f.write(converter.convert())
|
||||||
|
|
|
@ -36,7 +36,7 @@ with the actual list of files before we actually run the script.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from cmake import staleness_test_lib
|
from upb.cmake import staleness_test_lib
|
||||||
import unittest
|
import unittest
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,8 @@ class MyMessage(_message.Message):
|
||||||
|
|
||||||
To use reflection-based access:
|
To use reflection-based access:
|
||||||
|
|
||||||
1. Load and access descriptor data using the interfaces in upb/reflection/def.h.
|
1. Load and access descriptor data using the interfaces in upb/upb/reflection/def.h.
|
||||||
2. Access message data using the interfaces in upb/reflection/message.h.
|
2. Access message data using the interfaces in upb/upb/reflection/message.h.
|
||||||
|
|
||||||
### MiniTables
|
### MiniTables
|
||||||
|
|
||||||
|
@ -234,8 +234,8 @@ APIs to do this do not exist yet.
|
||||||
|
|
||||||
To use MiniTable-based access:
|
To use MiniTable-based access:
|
||||||
|
|
||||||
1. Load and access MiniDescriptors data using the interfaces in upb/mini_descriptor/decode.h.
|
1. Load and access MiniDescriptors data using the interfaces in upb/upb/mini_descriptor/decode.h.
|
||||||
2. Access message data using the interfaces in upb/message/accessors.h.
|
2. Access message data using the interfaces in upb/upb/message/accessors.h.
|
||||||
|
|
||||||
## Memory Management
|
## Memory Management
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"UPB_DEFAULT_COPTS",
|
"UPB_DEFAULT_COPTS",
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//lua:lua_proto_library.bzl",
|
"//upb/lua:lua_proto_library.bzl",
|
||||||
"lua_proto_library",
|
"lua_proto_library",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ cc_library(
|
||||||
copts = UPB_DEFAULT_COPTS,
|
copts = UPB_DEFAULT_COPTS,
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//:json",
|
"//upb:json",
|
||||||
"//:message",
|
"//upb:message",
|
||||||
"//:reflection",
|
"//upb:reflection",
|
||||||
"//:text",
|
"//upb:text",
|
||||||
"@lua//:liblua",
|
"@lua//:liblua",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -44,8 +44,8 @@ cc_binary(
|
||||||
copts = UPB_DEFAULT_CPPOPTS,
|
copts = UPB_DEFAULT_CPPOPTS,
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//src/google/protobuf/compiler:code_generator",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"@com_google_protobuf//src/google/protobuf/compiler:code_generator",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -63,15 +63,15 @@ cc_test(
|
||||||
":test_messages_proto2_proto_lua",
|
":test_messages_proto2_proto_lua",
|
||||||
":test_messages_proto3_proto_lua",
|
":test_messages_proto3_proto_lua",
|
||||||
":test_proto_lua",
|
":test_proto_lua",
|
||||||
"//:third_party/lunit/console.lua",
|
"//:descriptor_proto",
|
||||||
"//:third_party/lunit/lunit.lua",
|
"//conformance:conformance_proto",
|
||||||
"//lua:upb.lua",
|
"//upb:third_party/lunit/console.lua",
|
||||||
"@com_google_protobuf//:descriptor_proto",
|
"//upb:third_party/lunit/lunit.lua",
|
||||||
"@com_google_protobuf//conformance:conformance_proto",
|
"//upb/lua:upb.lua",
|
||||||
],
|
],
|
||||||
linkstatic = 1,
|
linkstatic = 1,
|
||||||
deps = [
|
deps = [
|
||||||
"//lua:lupb",
|
"//upb/lua:lupb",
|
||||||
"@lua//:liblua",
|
"@lua//:liblua",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -80,7 +80,7 @@ proto_library(
|
||||||
name = "test_proto",
|
name = "test_proto",
|
||||||
testonly = 1,
|
testonly = 1,
|
||||||
srcs = ["test.proto"],
|
srcs = ["test.proto"],
|
||||||
deps = ["@com_google_protobuf//:timestamp_proto"],
|
deps = ["//:timestamp_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
lua_proto_library(
|
lua_proto_library(
|
||||||
|
@ -91,22 +91,22 @@ lua_proto_library(
|
||||||
|
|
||||||
lua_proto_library(
|
lua_proto_library(
|
||||||
name = "descriptor_proto_lua",
|
name = "descriptor_proto_lua",
|
||||||
deps = ["@com_google_protobuf//:descriptor_proto"],
|
deps = ["//:descriptor_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
lua_proto_library(
|
lua_proto_library(
|
||||||
name = "empty_proto_lua",
|
name = "empty_proto_lua",
|
||||||
deps = ["@com_google_protobuf//:empty_proto"],
|
deps = ["//:empty_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
lua_proto_library(
|
lua_proto_library(
|
||||||
name = "test_messages_proto3_proto_lua",
|
name = "test_messages_proto3_proto_lua",
|
||||||
testonly = 1,
|
testonly = 1,
|
||||||
deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"],
|
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
lua_proto_library(
|
lua_proto_library(
|
||||||
name = "test_messages_proto2_proto_lua",
|
name = "test_messages_proto2_proto_lua",
|
||||||
testonly = 1,
|
testonly = 1,
|
||||||
deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"],
|
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -36,8 +36,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "lauxlib.h"
|
#include "lauxlib.h"
|
||||||
#include "lua/upb.h"
|
#include "upb/lua/upb.h"
|
||||||
#include "upb/reflection/message.h"
|
#include "upb/upb/reflection/message.h"
|
||||||
|
|
||||||
#define LUPB_ENUMDEF "lupb.enumdef"
|
#define LUPB_ENUMDEF "lupb.enumdef"
|
||||||
#define LUPB_ENUMVALDEF "lupb.enumvaldef"
|
#define LUPB_ENUMVALDEF "lupb.enumvaldef"
|
||||||
|
|
|
@ -109,12 +109,12 @@ _lua_proto_library_aspect = aspect(
|
||||||
"_upbc": attr.label(
|
"_upbc": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "//lua:protoc-gen-lua",
|
default = "//upb/lua:protoc-gen-lua",
|
||||||
),
|
),
|
||||||
"_protoc": attr.label(
|
"_protoc": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "@com_google_protobuf//:protoc",
|
default = "//:protoc",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
implementation = _lua_proto_library_aspect_impl,
|
implementation = _lua_proto_library_aspect_impl,
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "lua/upb.h"
|
#include "upb/lua/upb.h"
|
||||||
|
|
||||||
lua_State* L;
|
lua_State* L;
|
||||||
|
|
||||||
|
@ -53,13 +53,13 @@ const char* init =
|
||||||
"package.preload['lupb'] = ... "
|
"package.preload['lupb'] = ... "
|
||||||
"package.path = '"
|
"package.path = '"
|
||||||
"./?.lua;"
|
"./?.lua;"
|
||||||
"./third_party/lunit/?.lua;"
|
"./upb/third_party/lunit/?.lua;"
|
||||||
"external/com_google_protobuf/?.lua;"
|
"external/com_google_protobuf/?.lua;"
|
||||||
"external/com_google_protobuf/src/?.lua;"
|
"external/com_google_protobuf/src/?.lua;"
|
||||||
"bazel-bin/?.lua;"
|
"bazel-bin/?.lua;"
|
||||||
"bazel-bin/external/com_google_protobuf/src/?.lua;"
|
"bazel-bin/external/com_google_protobuf/src/?.lua;"
|
||||||
"bazel-bin/external/com_google_protobuf/?.lua;"
|
"bazel-bin/external/com_google_protobuf/?.lua;"
|
||||||
"lua/?.lua;"
|
"upb/lua/?.lua;"
|
||||||
// These additional paths handle the case where this test is invoked from
|
// These additional paths handle the case where this test is invoked from
|
||||||
// the protobuf repo's Bazel workspace.
|
// the protobuf repo's Bazel workspace.
|
||||||
"external/upb/?.lua;"
|
"external/upb/?.lua;"
|
||||||
|
|
|
@ -39,14 +39,14 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "lauxlib.h"
|
#include "lauxlib.h"
|
||||||
#include "lua/upb.h"
|
#include "upb/lua/upb.h"
|
||||||
#include "upb/collections/map.h"
|
#include "upb/upb/collections/map.h"
|
||||||
#include "upb/json/decode.h"
|
#include "upb/upb/json/decode.h"
|
||||||
#include "upb/json/encode.h"
|
#include "upb/upb/json/encode.h"
|
||||||
#include "upb/message/message.h"
|
#include "upb/upb/message/message.h"
|
||||||
#include "upb/port/def.inc"
|
#include "upb/upb/port/def.inc"
|
||||||
#include "upb/reflection/message.h"
|
#include "upb/upb/reflection/message.h"
|
||||||
#include "upb/text/encode.h"
|
#include "upb/upb/text/encode.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Message/Map/Array objects. These objects form a directed graph: a message
|
* Message/Map/Array objects. These objects form a directed graph: a message
|
||||||
|
|
|
@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
local upb = require "lupb"
|
local upb = require "lupb"
|
||||||
local lunit = require "lunit"
|
local lunit = require "lunit"
|
||||||
local upb_test = require "lua.test_pb"
|
local upb_test = require "upb.lua.test_pb"
|
||||||
local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb"
|
local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb"
|
||||||
local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb"
|
local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb"
|
||||||
local descriptor = require "google.protobuf.descriptor_pb"
|
local descriptor = require "google.protobuf.descriptor_pb"
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
* domain of [u]int64 values.
|
* domain of [u]int64 values.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lua/upb.h"
|
#include "upb/lua/upb.h"
|
||||||
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "lauxlib.h"
|
#include "lauxlib.h"
|
||||||
#include "upb/message/message.h"
|
#include "upb/upb/message/message.h"
|
||||||
|
|
||||||
/* Lua compatibility code *****************************************************/
|
/* Lua compatibility code *****************************************************/
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,9 @@
|
||||||
#define UPB_LUA_UPB_H_
|
#define UPB_LUA_UPB_H_
|
||||||
|
|
||||||
#include "lauxlib.h"
|
#include "lauxlib.h"
|
||||||
#include "upb/message/message.h"
|
#include "upb/upb/message/message.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
#include "upb/reflection/message.h"
|
#include "upb/upb/reflection/message.h"
|
||||||
|
|
||||||
/* Lua changes its API in incompatible ways in every minor release.
|
/* Lua changes its API in incompatible ways in every minor release.
|
||||||
* This is some shim code to paper over the differences. */
|
* This is some shim code to paper over the differences. */
|
||||||
|
|
|
@ -6,16 +6,16 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//protos/bazel:upb_cc_proto_library.bzl",
|
"//upb/protos/bazel:upb_cc_proto_library.bzl",
|
||||||
"upb_cc_proto_library_copts",
|
"upb_cc_proto_library_copts",
|
||||||
)
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
@ -31,13 +31,13 @@ cc_library(
|
||||||
deps = [
|
deps = [
|
||||||
":protos",
|
":protos",
|
||||||
":protos_traits",
|
":protos_traits",
|
||||||
"//:base",
|
"//upb:base",
|
||||||
"//:collections",
|
"//upb:collections",
|
||||||
"//:collections_internal",
|
"//upb:collections_internal",
|
||||||
"//:mem",
|
"//upb:mem",
|
||||||
"//:message_copy",
|
"//upb:message_copy",
|
||||||
"//:message_types",
|
"//upb:message_types",
|
||||||
"//:port",
|
"//upb:port",
|
||||||
"@com_google_absl//absl/base:core_headers",
|
"@com_google_absl//absl/base:core_headers",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
],
|
],
|
||||||
|
@ -55,16 +55,16 @@ cc_library(
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
":protos_extension_lock",
|
":protos_extension_lock",
|
||||||
"//:base",
|
"//upb:base",
|
||||||
"//:mem",
|
"//upb:mem",
|
||||||
"//:message_accessors_internal",
|
"//upb:message_accessors_internal",
|
||||||
"//:message_copy",
|
"//upb:message_copy",
|
||||||
"//:message_internal",
|
"//upb:message_internal",
|
||||||
"//:message_promote",
|
"//upb:message_promote",
|
||||||
"//:message_types",
|
"//upb:message_types",
|
||||||
"//:mini_table",
|
"//upb:mini_table",
|
||||||
"//:wire",
|
"//upb:wire",
|
||||||
"//:wire_types",
|
"//upb:wire_types",
|
||||||
"@com_google_absl//absl/status",
|
"@com_google_absl//absl/status",
|
||||||
"@com_google_absl//absl/status:statusor",
|
"@com_google_absl//absl/status:statusor",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
|
@ -89,9 +89,9 @@ cc_library(
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
":protos",
|
":protos",
|
||||||
"//:mem",
|
"//upb:mem",
|
||||||
"//:message",
|
"//upb:message",
|
||||||
"//:mini_table",
|
"//upb:mini_table",
|
||||||
"@com_google_absl//absl/status",
|
"@com_google_absl//absl/status",
|
||||||
"@com_google_absl//absl/status:statusor",
|
"@com_google_absl//absl/status:statusor",
|
||||||
"@com_google_absl//absl/strings:str_format",
|
"@com_google_absl//absl/strings:str_format",
|
||||||
|
@ -105,7 +105,7 @@ cc_library(
|
||||||
copts = UPB_DEFAULT_CPPOPTS,
|
copts = UPB_DEFAULT_CPPOPTS,
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//:message",
|
"//upb:message",
|
||||||
"@com_google_absl//absl/base:core_headers",
|
"@com_google_absl//absl/base:core_headers",
|
||||||
"@com_google_absl//absl/synchronization",
|
"@com_google_absl//absl/synchronization",
|
||||||
],
|
],
|
||||||
|
@ -123,8 +123,8 @@ cc_library(
|
||||||
":protos",
|
":protos",
|
||||||
":protos_internal",
|
":protos_internal",
|
||||||
":repeated_field",
|
":repeated_field",
|
||||||
"//:mem",
|
"//upb:mem",
|
||||||
"//:message",
|
"//upb:message",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -134,9 +134,9 @@ cc_test(
|
||||||
copts = UPB_DEFAULT_CPPOPTS,
|
copts = UPB_DEFAULT_CPPOPTS,
|
||||||
deps = [
|
deps = [
|
||||||
":protos_internal",
|
":protos_internal",
|
||||||
"//:mem",
|
"//upb:mem",
|
||||||
"//protos_generator/tests:test_model_upb_cc_proto",
|
"//upb/protos_generator/tests:test_model_upb_cc_proto",
|
||||||
"//protos_generator/tests:test_model_upb_proto",
|
"//upb/protos_generator/tests:test_model_upb_proto",
|
||||||
"@com_google_googletest//:gtest_main",
|
"@com_google_googletest//:gtest_main",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -160,10 +160,10 @@ cc_test(
|
||||||
name = "protos_extension_lock_test",
|
name = "protos_extension_lock_test",
|
||||||
srcs = ["protos_extension_lock_test.cc"],
|
srcs = ["protos_extension_lock_test.cc"],
|
||||||
deps = [
|
deps = [
|
||||||
"//:mem",
|
"//upb:mem",
|
||||||
"//protos",
|
"//upb/protos",
|
||||||
"//protos:protos_extension_lock",
|
"//upb/protos:protos_extension_lock",
|
||||||
"//protos_generator/tests:test_model_upb_cc_proto",
|
"//upb/protos_generator/tests:test_model_upb_cc_proto",
|
||||||
"@com_google_absl//absl/hash",
|
"@com_google_absl//absl/hash",
|
||||||
"@com_google_absl//absl/log:absl_check",
|
"@com_google_absl//absl/log:absl_check",
|
||||||
"@com_google_googletest//:gtest_main",
|
"@com_google_googletest//:gtest_main",
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
@ -18,7 +18,7 @@ bzl_library(
|
||||||
srcs = ["upb_cc_proto_library.bzl"],
|
srcs = ["upb_cc_proto_library.bzl"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//bazel:upb_proto_library_bzl",
|
"//upb/bazel:upb_proto_library_bzl",
|
||||||
"@bazel_skylib//lib:paths",
|
"@bazel_skylib//lib:paths",
|
||||||
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
|
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
|
||||||
],
|
],
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
load("@bazel_skylib//lib:paths.bzl", "paths")
|
load("@bazel_skylib//lib:paths.bzl", "paths")
|
||||||
load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect")
|
load("//upb/bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect")
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
|
# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
|
||||||
|
@ -229,17 +229,17 @@ def _upb_cc_proto_library_aspect_impl(target, ctx):
|
||||||
_upb_cc_proto_library_aspect = aspect(
|
_upb_cc_proto_library_aspect = aspect(
|
||||||
attrs = {
|
attrs = {
|
||||||
"_ccopts": attr.label(
|
"_ccopts": attr.label(
|
||||||
default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
|
default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
|
||||||
),
|
),
|
||||||
"_gen_upbprotos": attr.label(
|
"_gen_upbprotos": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "//protos_generator:protoc-gen-upb-protos",
|
default = "//upb/protos_generator:protoc-gen-upb-protos",
|
||||||
),
|
),
|
||||||
"_protoc": attr.label(
|
"_protoc": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "@com_google_protobuf//:protoc",
|
default = "//:protoc",
|
||||||
),
|
),
|
||||||
"_cc_toolchain": attr.label(
|
"_cc_toolchain": attr.label(
|
||||||
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
|
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
|
||||||
|
@ -247,12 +247,12 @@ _upb_cc_proto_library_aspect = aspect(
|
||||||
"_upbprotos": attr.label_list(
|
"_upbprotos": attr.label_list(
|
||||||
default = [
|
default = [
|
||||||
# TODO: Add dependencies for cc runtime (absl/string etc..)
|
# TODO: Add dependencies for cc runtime (absl/string etc..)
|
||||||
"//:generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
"//upb:generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
||||||
"//protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
"//upb/protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"@com_google_absl//absl/status:statusor",
|
"@com_google_absl//absl/status:statusor",
|
||||||
"//protos",
|
"//upb/protos",
|
||||||
"//protos:repeated_field",
|
"//upb/protos:repeated_field",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
@ -283,7 +283,7 @@ upb_cc_proto_library = rule(
|
||||||
providers = [ProtoInfo],
|
providers = [ProtoInfo],
|
||||||
),
|
),
|
||||||
"_ccopts": attr.label(
|
"_ccopts": attr.label(
|
||||||
default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
|
default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos/protos.h"
|
#include "upb/protos/protos.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
@ -37,18 +37,18 @@
|
||||||
#include "absl/status/statusor.h"
|
#include "absl/status/statusor.h"
|
||||||
#include "absl/strings/str_format.h"
|
#include "absl/strings/str_format.h"
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "protos/protos_extension_lock.h"
|
#include "upb/protos/protos_extension_lock.h"
|
||||||
#include "upb/mem/arena.h"
|
#include "upb/upb/mem/arena.h"
|
||||||
#include "upb/message/copy.h"
|
#include "upb/upb/message/copy.h"
|
||||||
#include "upb/message/internal/extension.h"
|
#include "upb/upb/message/internal/extension.h"
|
||||||
#include "upb/message/promote.h"
|
#include "upb/upb/message/promote.h"
|
||||||
#include "upb/message/types.h"
|
#include "upb/upb/message/types.h"
|
||||||
#include "upb/mini_table/extension.h"
|
#include "upb/upb/mini_table/extension.h"
|
||||||
#include "upb/mini_table/extension_registry.h"
|
#include "upb/upb/mini_table/extension_registry.h"
|
||||||
#include "upb/mini_table/message.h"
|
#include "upb/upb/mini_table/message.h"
|
||||||
#include "upb/wire/decode.h"
|
#include "upb/upb/wire/decode.h"
|
||||||
#include "upb/wire/encode.h"
|
#include "upb/upb/wire/encode.h"
|
||||||
#include "upb/wire/types.h"
|
#include "upb/upb/wire/types.h"
|
||||||
|
|
||||||
namespace protos {
|
namespace protos {
|
||||||
|
|
||||||
|
|
|
@ -36,13 +36,13 @@
|
||||||
|
|
||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
#include "absl/status/statusor.h"
|
#include "absl/status/statusor.h"
|
||||||
#include "upb/base/status.hpp"
|
#include "upb/upb/base/status.hpp"
|
||||||
#include "upb/mem/arena.hpp"
|
#include "upb/upb/mem/arena.hpp"
|
||||||
#include "upb/message/copy.h"
|
#include "upb/upb/message/copy.h"
|
||||||
#include "upb/message/internal/accessors.h"
|
#include "upb/upb/message/internal/accessors.h"
|
||||||
#include "upb/message/internal/extension.h"
|
#include "upb/upb/message/internal/extension.h"
|
||||||
#include "upb/wire/decode.h"
|
#include "upb/upb/wire/decode.h"
|
||||||
#include "upb/wire/encode.h"
|
#include "upb/upb/wire/encode.h"
|
||||||
|
|
||||||
namespace protos {
|
namespace protos {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos/protos_extension_lock.h"
|
#include "upb/protos/protos_extension_lock.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos/protos_extension_lock.h"
|
#include "upb/protos/protos_extension_lock.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
@ -39,9 +39,9 @@
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "absl/hash/hash.h"
|
#include "absl/hash/hash.h"
|
||||||
#include "absl/log/absl_check.h"
|
#include "absl/log/absl_check.h"
|
||||||
#include "protos/protos.h"
|
#include "upb/protos/protos.h"
|
||||||
#include "protos_generator/tests/test_model.upb.proto.h"
|
#include "upb/protos_generator/tests/test_model.upb.proto.h"
|
||||||
#include "upb/mem/arena.hpp"
|
#include "upb/upb/mem/arena.hpp"
|
||||||
|
|
||||||
#ifndef ASSERT_OK
|
#ifndef ASSERT_OK
|
||||||
#define ASSERT_OK(x) ASSERT_TRUE(x.ok())
|
#define ASSERT_OK(x) ASSERT_TRUE(x.ok())
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
#ifndef UPB_PROTOS_PROTOS_INTERNAL_H_
|
#ifndef UPB_PROTOS_PROTOS_INTERNAL_H_
|
||||||
#define UPB_PROTOS_PROTOS_INTERNAL_H_
|
#define UPB_PROTOS_PROTOS_INTERNAL_H_
|
||||||
|
|
||||||
#include "upb/mem/arena.h"
|
#include "upb/upb/mem/arena.h"
|
||||||
#include "upb/message/message.h"
|
#include "upb/upb/message/message.h"
|
||||||
|
|
||||||
namespace protos::internal {
|
namespace protos::internal {
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos/protos_internal.h"
|
#include "upb/protos/protos_internal.h"
|
||||||
|
|
||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "protos_generator/tests/test_model.upb.h"
|
#include "upb/protos_generator/tests/test_model.upb.h"
|
||||||
#include "protos_generator/tests/test_model.upb.proto.h"
|
#include "upb/protos_generator/tests/test_model.upb.proto.h"
|
||||||
#include "upb/mem/arena.h"
|
#include "upb/upb/mem/arena.h"
|
||||||
|
|
||||||
namespace protos::testing {
|
namespace protos::testing {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -37,17 +37,17 @@
|
||||||
|
|
||||||
#include "absl/base/attributes.h"
|
#include "absl/base/attributes.h"
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "protos/protos.h"
|
#include "upb/protos/protos.h"
|
||||||
#include "protos/protos_traits.h"
|
#include "upb/protos/protos_traits.h"
|
||||||
#include "protos/repeated_field_iterator.h"
|
#include "upb/protos/repeated_field_iterator.h"
|
||||||
#include "upb/base/string_view.h"
|
#include "upb/upb/base/string_view.h"
|
||||||
#include "upb/collections/array.h"
|
#include "upb/upb/collections/array.h"
|
||||||
#include "upb/collections/internal/array.h"
|
#include "upb/upb/collections/internal/array.h"
|
||||||
#include "upb/mem/arena.h"
|
#include "upb/upb/mem/arena.h"
|
||||||
#include "upb/message/copy.h"
|
#include "upb/upb/message/copy.h"
|
||||||
|
|
||||||
// Must be last:
|
// Must be last:
|
||||||
#include "upb/port/def.inc"
|
#include "upb/upb/port/def.inc"
|
||||||
|
|
||||||
namespace protos {
|
namespace protos {
|
||||||
|
|
||||||
|
@ -321,6 +321,6 @@ class RepeatedField {
|
||||||
|
|
||||||
} // namespace protos
|
} // namespace protos
|
||||||
|
|
||||||
#include "upb/port/undef.inc"
|
#include "upb/upb/port/undef.inc"
|
||||||
|
|
||||||
#endif // UPB_PROTOS_REPEATED_FIELD_H_
|
#endif // UPB_PROTOS_REPEATED_FIELD_H_
|
||||||
|
|
|
@ -36,15 +36,15 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "protos/protos.h"
|
#include "upb/protos/protos.h"
|
||||||
#include "upb/base/string_view.h"
|
#include "upb/upb/base/string_view.h"
|
||||||
#include "upb/collections/array.h"
|
#include "upb/upb/collections/array.h"
|
||||||
#include "upb/mem/arena.h"
|
#include "upb/upb/mem/arena.h"
|
||||||
#include "upb/message/copy.h"
|
#include "upb/upb/message/copy.h"
|
||||||
|
|
||||||
// Must be last:
|
// Must be last:
|
||||||
#include "upb/message/types.h"
|
#include "upb/upb/message/types.h"
|
||||||
#include "upb/port/def.inc"
|
#include "upb/upb/port/def.inc"
|
||||||
|
|
||||||
namespace protos {
|
namespace protos {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos/repeated_field_iterator.h"
|
#include "upb/protos/repeated_field_iterator.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
)
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
@ -28,9 +28,9 @@ cc_binary(
|
||||||
":generator",
|
":generator",
|
||||||
":names",
|
":names",
|
||||||
":output",
|
":output",
|
||||||
"//upbc:file_layout",
|
"//:protobuf",
|
||||||
"@com_google_protobuf//:protobuf",
|
"//src/google/protobuf/compiler:code_generator",
|
||||||
"@com_google_protobuf//src/google/protobuf/compiler:code_generator",
|
"//upb/upbc:file_layout",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -55,13 +55,13 @@ cc_library(
|
||||||
":gen_utils",
|
":gen_utils",
|
||||||
":names",
|
":names",
|
||||||
":output",
|
":output",
|
||||||
"//upbc:common",
|
"//:protobuf",
|
||||||
"//upbc:file_layout",
|
"//upb/upbc:common",
|
||||||
"//upbc:keywords",
|
"//upb/upbc:file_layout",
|
||||||
"//upbc:names",
|
"//upb/upbc:keywords",
|
||||||
|
"//upb/upbc:names",
|
||||||
"@com_google_absl//absl/container:flat_hash_set",
|
"@com_google_absl//absl/container:flat_hash_set",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"@com_google_protobuf//:protobuf",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -71,9 +71,9 @@ cc_library(
|
||||||
hdrs = ["output.h"],
|
hdrs = ["output.h"],
|
||||||
visibility = ["//visibility:private"],
|
visibility = ["//visibility:private"],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//:protobuf",
|
||||||
"@com_google_absl//absl/log:absl_log",
|
"@com_google_absl//absl/log:absl_log",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"@com_google_protobuf//:protobuf",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -83,9 +83,9 @@ cc_library(
|
||||||
hdrs = ["gen_utils.h"],
|
hdrs = ["gen_utils.h"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//:protobuf",
|
||||||
|
"//src/google/protobuf/compiler:code_generator",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"@com_google_protobuf//:protobuf",
|
|
||||||
"@com_google_protobuf//src/google/protobuf/compiler:code_generator",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -96,6 +96,6 @@ cc_library(
|
||||||
visibility = ["//visibility:private"],
|
visibility = ["//visibility:private"],
|
||||||
deps = [
|
deps = [
|
||||||
":output",
|
":output",
|
||||||
"//upbc:keywords",
|
"//upb/upbc:keywords",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos_generator/gen_accessors.h"
|
#include "upb/protos_generator/gen_accessors.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -37,13 +37,13 @@
|
||||||
#include "absl/strings/str_cat.h"
|
#include "absl/strings/str_cat.h"
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/gen_repeated_fields.h"
|
#include "upb/protos_generator/gen_repeated_fields.h"
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
#include "protos_generator/names.h"
|
#include "upb/protos_generator/names.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
#include "upbc/common.h"
|
#include "upb/upbc/common.h"
|
||||||
#include "upbc/keywords.h"
|
#include "upb/upbc/keywords.h"
|
||||||
#include "upbc/names.h"
|
#include "upb/upbc/names.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#define UPB_PROTOS_GENERATOR_ACCESSORS_H_
|
#define UPB_PROTOS_GENERATOR_ACCESSORS_H_
|
||||||
|
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos_generator/gen_enums.h"
|
#include "upb/protos_generator/gen_enums.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
@ -37,8 +37,8 @@
|
||||||
|
|
||||||
#include "google/protobuf/descriptor.pb.h"
|
#include "google/protobuf/descriptor.pb.h"
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
#include "protos_generator/names.h"
|
#include "upb/protos_generator/names.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define UPB_PROTOS_GENERATOR_ENUMS_H_
|
#define UPB_PROTOS_GENERATOR_ENUMS_H_
|
||||||
|
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos_generator/gen_extensions.h"
|
#include "upb/protos_generator/gen_extensions.h"
|
||||||
|
|
||||||
#include "absl/strings/str_cat.h"
|
#include "absl/strings/str_cat.h"
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
#include "protos_generator/names.h"
|
#include "upb/protos_generator/names.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_
|
#define UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_
|
||||||
|
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos_generator/gen_messages.h"
|
#include "upb/protos_generator/gen_messages.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -36,14 +36,14 @@
|
||||||
#include "google/protobuf/descriptor.pb.h"
|
#include "google/protobuf/descriptor.pb.h"
|
||||||
#include "absl/strings/str_cat.h"
|
#include "absl/strings/str_cat.h"
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/gen_accessors.h"
|
#include "upb/protos_generator/gen_accessors.h"
|
||||||
#include "protos_generator/gen_enums.h"
|
#include "upb/protos_generator/gen_enums.h"
|
||||||
#include "protos_generator/gen_extensions.h"
|
#include "upb/protos_generator/gen_extensions.h"
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
#include "protos_generator/names.h"
|
#include "upb/protos_generator/names.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
#include "upbc/common.h"
|
#include "upb/upbc/common.h"
|
||||||
#include "upbc/file_layout.h"
|
#include "upb/upbc/file_layout.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_
|
#define UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_
|
||||||
|
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
namespace protobuf = ::google::protobuf;
|
namespace protobuf = ::google::protobuf;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "protos_generator/gen_repeated_fields.h"
|
#include "upb/protos_generator/gen_repeated_fields.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -35,15 +35,15 @@
|
||||||
#include "google/protobuf/descriptor.pb.h"
|
#include "google/protobuf/descriptor.pb.h"
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/gen_accessors.h"
|
#include "upb/protos_generator/gen_accessors.h"
|
||||||
#include "protos_generator/gen_enums.h"
|
#include "upb/protos_generator/gen_enums.h"
|
||||||
#include "protos_generator/gen_extensions.h"
|
#include "upb/protos_generator/gen_extensions.h"
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
#include "protos_generator/names.h"
|
#include "upb/protos_generator/names.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
#include "upbc/common.h"
|
#include "upb/upbc/common.h"
|
||||||
#include "upbc/file_layout.h"
|
#include "upb/upbc/file_layout.h"
|
||||||
#include "upbc/names.h"
|
#include "upb/upbc/names.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
namespace protobuf = ::google::protobuf;
|
namespace protobuf = ::google::protobuf;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
namespace protobuf = ::google::protobuf;
|
namespace protobuf = ::google::protobuf;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos_generator/names.h"
|
#include "upb/protos_generator/names.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "upbc/keywords.h"
|
#include "upb/upbc/keywords.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "google/protobuf/descriptor.pb.h"
|
#include "google/protobuf/descriptor.pb.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
|
@ -34,13 +34,13 @@
|
||||||
#include "google/protobuf/compiler/code_generator.h"
|
#include "google/protobuf/compiler/code_generator.h"
|
||||||
#include "google/protobuf/compiler/plugin.h"
|
#include "google/protobuf/compiler/plugin.h"
|
||||||
#include "google/protobuf/descriptor.h"
|
#include "google/protobuf/descriptor.h"
|
||||||
#include "protos_generator/gen_enums.h"
|
#include "upb/protos_generator/gen_enums.h"
|
||||||
#include "protos_generator/gen_extensions.h"
|
#include "upb/protos_generator/gen_extensions.h"
|
||||||
#include "protos_generator/gen_messages.h"
|
#include "upb/protos_generator/gen_messages.h"
|
||||||
#include "protos_generator/gen_utils.h"
|
#include "upb/protos_generator/gen_utils.h"
|
||||||
#include "protos_generator/names.h"
|
#include "upb/protos_generator/names.h"
|
||||||
#include "protos_generator/output.h"
|
#include "upb/protos_generator/output.h"
|
||||||
#include "upbc/file_layout.h"
|
#include "upb/upbc/file_layout.h"
|
||||||
|
|
||||||
namespace protos_generator {
|
namespace protos_generator {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -138,9 +138,9 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
|
||||||
#ifndef $0_UPB_PROTO_H_
|
#ifndef $0_UPB_PROTO_H_
|
||||||
#define $0_UPB_PROTO_H_
|
#define $0_UPB_PROTO_H_
|
||||||
|
|
||||||
#include "protos/protos.h"
|
#include "upb/protos/protos.h"
|
||||||
#include "protos/protos_internal.h"
|
#include "upb/protos/protos_internal.h"
|
||||||
#include "protos/repeated_field.h"
|
#include "upb/protos/repeated_field.h"
|
||||||
|
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "absl/status/statusor.h"
|
#include "absl/status/statusor.h"
|
||||||
|
@ -158,7 +158,7 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output("#include \"upb/port/def.inc\"\n");
|
output("#include \"upb/upb/port/def.inc\"\n");
|
||||||
|
|
||||||
const std::vector<const protobuf::Descriptor*> this_file_messages =
|
const std::vector<const protobuf::Descriptor*> this_file_messages =
|
||||||
SortedMessages(file);
|
SortedMessages(file);
|
||||||
|
@ -190,7 +190,7 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) {
|
||||||
|
|
||||||
WriteEndNamespace(file, output);
|
WriteEndNamespace(file, output);
|
||||||
|
|
||||||
output("\n#include \"upb/port/undef.inc\"\n\n");
|
output("\n#include \"upb/upb/port/undef.inc\"\n\n");
|
||||||
// End of "C" section.
|
// End of "C" section.
|
||||||
|
|
||||||
output("#endif /* $0_UPB_PROTO_H_ */\n", ToPreproc(file->name()));
|
output("#endif /* $0_UPB_PROTO_H_ */\n", ToPreproc(file->name()));
|
||||||
|
@ -205,7 +205,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output,
|
||||||
R"cc(
|
R"cc(
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "protos/protos.h"
|
#include "upb/protos/protos.h"
|
||||||
#include "$0"
|
#include "$0"
|
||||||
)cc",
|
)cc",
|
||||||
CppHeaderFilename(file));
|
CppHeaderFilename(file));
|
||||||
|
@ -213,7 +213,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output,
|
||||||
for (int i = 0; i < file->dependency_count(); i++) {
|
for (int i = 0; i < file->dependency_count(); i++) {
|
||||||
output("#include \"$0\"\n", CppHeaderFilename(file->dependency(i)));
|
output("#include \"$0\"\n", CppHeaderFilename(file->dependency(i)));
|
||||||
}
|
}
|
||||||
output("#include \"upb/port/def.inc\"\n");
|
output("#include \"upb/upb/port/def.inc\"\n");
|
||||||
|
|
||||||
WriteStartNamespace(file, output);
|
WriteStartNamespace(file, output);
|
||||||
WriteMessageImplementations(file, output);
|
WriteMessageImplementations(file, output);
|
||||||
|
@ -222,7 +222,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output,
|
||||||
WriteExtensionIdentifiers(this_file_exts, output);
|
WriteExtensionIdentifiers(this_file_exts, output);
|
||||||
WriteEndNamespace(file, output);
|
WriteEndNamespace(file, output);
|
||||||
|
|
||||||
output("#include \"upb/port/undef.inc\"\n\n");
|
output("#include \"upb/upb/port/undef.inc\"\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteMessageImplementations(const protobuf::FileDescriptor* file,
|
void WriteMessageImplementations(const protobuf::FileDescriptor* file,
|
||||||
|
|
|
@ -6,15 +6,15 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_proto_library.bzl",
|
"//upb/bazel:upb_proto_library.bzl",
|
||||||
"upb_proto_library",
|
"upb_proto_library",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//protos/bazel:upb_cc_proto_library.bzl",
|
"//upb/protos/bazel:upb_cc_proto_library.bzl",
|
||||||
"upb_cc_proto_library",
|
"upb_cc_proto_library",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
|
@ -23,7 +23,7 @@ load(
|
||||||
)
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
@ -63,14 +63,14 @@ proto_library(
|
||||||
upb_proto_library(
|
upb_proto_library(
|
||||||
name = "test_model_upb_proto",
|
name = "test_model_upb_proto",
|
||||||
visibility = [
|
visibility = [
|
||||||
"//protos:__pkg__",
|
"//upb/protos:__pkg__",
|
||||||
],
|
],
|
||||||
deps = [":test_model_proto"],
|
deps = [":test_model_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
upb_cc_proto_library(
|
upb_cc_proto_library(
|
||||||
name = "test_model_upb_cc_proto",
|
name = "test_model_upb_cc_proto",
|
||||||
visibility = ["//protos:__pkg__"],
|
visibility = ["//upb/protos:__pkg__"],
|
||||||
deps = [":test_model_proto"],
|
deps = [":test_model_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -133,8 +133,8 @@ cc_test(
|
||||||
"@com_google_googletest//:gtest_main",
|
"@com_google_googletest//:gtest_main",
|
||||||
"@com_google_absl//absl/status:statusor",
|
"@com_google_absl//absl/status:statusor",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"//protos",
|
"//upb/protos",
|
||||||
"//:mem",
|
"//upb:mem",
|
||||||
"//protos:repeated_field",
|
"//upb/protos:repeated_field",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -32,7 +32,7 @@ syntax = "proto3";
|
||||||
|
|
||||||
package protos_generator.test;
|
package protos_generator.test;
|
||||||
|
|
||||||
import public "protos_generator/tests/test_enum.proto";
|
import public "upb/protos_generator/tests/test_enum.proto";
|
||||||
|
|
||||||
message ChildModel1 {
|
message ChildModel1 {
|
||||||
optional bool child_b1 = 44;
|
optional bool child_b1 = 44;
|
||||||
|
|
|
@ -32,7 +32,7 @@ syntax = "proto2";
|
||||||
|
|
||||||
package protos_generator.tests;
|
package protos_generator.tests;
|
||||||
|
|
||||||
import "protos_generator/tests/no_package.proto";
|
import "upb/protos_generator/tests/no_package.proto";
|
||||||
|
|
||||||
// option java_multiple_files = true;
|
// option java_multiple_files = true;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ syntax = "proto2";
|
||||||
|
|
||||||
package protos_generator.test.someotherpackage;
|
package protos_generator.test.someotherpackage;
|
||||||
|
|
||||||
import "protos_generator/tests/test_model.proto";
|
import "upb/protos_generator/tests/test_model.proto";
|
||||||
|
|
||||||
// Define extension that is extending proto outside this package with a type
|
// Define extension that is extending proto outside this package with a type
|
||||||
// defined in different file.
|
// defined in different file.
|
||||||
|
|
|
@ -38,13 +38,13 @@
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "absl/status/statusor.h"
|
#include "absl/status/statusor.h"
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
#include "protos/protos.h"
|
#include "upb/protos/protos.h"
|
||||||
#include "protos/repeated_field.h"
|
#include "upb/protos/repeated_field.h"
|
||||||
#include "protos/repeated_field_iterator.h"
|
#include "upb/protos/repeated_field_iterator.h"
|
||||||
#include "protos_generator/tests/child_model.upb.proto.h"
|
#include "upb/protos_generator/tests/child_model.upb.proto.h"
|
||||||
#include "protos_generator/tests/no_package.upb.proto.h"
|
#include "upb/protos_generator/tests/no_package.upb.proto.h"
|
||||||
#include "protos_generator/tests/test_model.upb.proto.h"
|
#include "upb/protos_generator/tests/test_model.upb.proto.h"
|
||||||
#include "upb/mem/arena.h"
|
#include "upb/upb/mem/arena.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ syntax = "proto2";
|
||||||
|
|
||||||
package protos_generator.test;
|
package protos_generator.test;
|
||||||
|
|
||||||
import "protos_generator/tests/child_model.proto";
|
import "upb/protos_generator/tests/child_model.proto";
|
||||||
|
|
||||||
message TestModelContainer {
|
message TestModelContainer {
|
||||||
repeated TestModel models = 1;
|
repeated TestModel models = 1;
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//python:py_extension.bzl", "py_extension")
|
load("//upb/python:py_extension.bzl", "py_extension")
|
||||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
|
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
# begin:github_only
|
# begin:github_only
|
||||||
load("@rules_pkg//:mappings.bzl", "pkg_files")
|
load("@rules_pkg//:mappings.bzl", "pkg_files")
|
||||||
|
@ -18,9 +18,9 @@ licenses(["notice"])
|
||||||
|
|
||||||
package(
|
package(
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# default_applicable_licenses = ["//:license"],
|
# default_applicable_licenses = ["//upb:license"],
|
||||||
# end:google_only
|
# end:google_only
|
||||||
default_visibility = ["//python/dist:__pkg__"],
|
default_visibility = ["//upb/python/dist:__pkg__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
LIMITED_API_FLAG_SELECT = {
|
LIMITED_API_FLAG_SELECT = {
|
||||||
|
@ -214,18 +214,18 @@ py_extension(
|
||||||
],
|
],
|
||||||
target_compatible_with = select(_message_target_compatible_with),
|
target_compatible_with = select(_message_target_compatible_with),
|
||||||
deps = [
|
deps = [
|
||||||
"//:collections",
|
"//upb:collections",
|
||||||
"//:descriptor_upb_proto_reflection",
|
"//upb:descriptor_upb_proto_reflection",
|
||||||
"//:eps_copy_input_stream",
|
"//upb:eps_copy_input_stream",
|
||||||
"//:hash",
|
"//upb:hash",
|
||||||
"//:message_copy",
|
"//upb:message_copy",
|
||||||
"//:port",
|
"//upb:port",
|
||||||
"//:reflection",
|
"//upb:reflection",
|
||||||
"//:text",
|
"//upb:text",
|
||||||
"//:wire_reader",
|
"//upb:wire_reader",
|
||||||
"//:wire_types",
|
"//upb:wire_types",
|
||||||
"//upb/util:compare",
|
"//upb/upb/util:compare",
|
||||||
"//upb/util:def_to_proto",
|
"//upb/upb/util:def_to_proto",
|
||||||
"//upb/util:required_fields",
|
"//upb/upb/util:required_fields",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/convert.h"
|
#include "upb/python/convert.h"
|
||||||
|
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/collections/map.h"
|
#include "upb/upb/collections/map.h"
|
||||||
#include "upb/reflection/message.h"
|
#include "upb/upb/reflection/message.h"
|
||||||
#include "upb/util/compare.h"
|
#include "upb/upb/util/compare.h"
|
||||||
|
|
||||||
// Must be last.
|
// Must be last.
|
||||||
#include "upb/port/def.inc"
|
#include "upb/upb/port/def.inc"
|
||||||
|
|
||||||
PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f,
|
PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f,
|
||||||
PyObject* arena) {
|
PyObject* arena) {
|
||||||
|
@ -443,4 +443,4 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2,
|
||||||
kUpb_UnknownCompareResult_Equal;
|
kUpb_UnknownCompareResult_Equal;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "upb/port/undef.inc"
|
#include "upb/upb/port/undef.inc"
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
#define PYUPB_CONVERT_H__
|
#define PYUPB_CONVERT_H__
|
||||||
|
|
||||||
#include "protobuf.h"
|
#include "protobuf.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
#include "upb/reflection/message.h"
|
#include "upb/upb/reflection/message.h"
|
||||||
|
|
||||||
// Converts `val` to a Python object according to the type information in `f`.
|
// Converts `val` to a Python object according to the type information in `f`.
|
||||||
// Any newly-created Python objects that reference non-primitive data from `val`
|
// Any newly-created Python objects that reference non-primitive data from `val`
|
||||||
|
|
|
@ -28,15 +28,15 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/descriptor.h"
|
#include "upb/python/descriptor.h"
|
||||||
|
|
||||||
#include "python/convert.h"
|
#include "upb/python/convert.h"
|
||||||
#include "python/descriptor_containers.h"
|
#include "upb/python/descriptor_containers.h"
|
||||||
#include "python/descriptor_pool.h"
|
#include "upb/python/descriptor_pool.h"
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
#include "upb/util/def_to_proto.h"
|
#include "upb/upb/util/def_to_proto.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// DescriptorBase
|
// DescriptorBase
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "python/python_api.h"
|
#include "upb/python/python_api.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
kPyUpb_Descriptor = 0,
|
kPyUpb_Descriptor = 0,
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/descriptor_containers.h"
|
#include "upb/python/descriptor_containers.h"
|
||||||
|
|
||||||
#include "python/descriptor.h"
|
#include "upb/python/descriptor.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
// Implements __repr__ as str(dict(self)).
|
// Implements __repr__ as str(dict(self)).
|
||||||
static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) {
|
static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) {
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "protobuf.h"
|
#include "protobuf.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// PyUpb_GenericSequence
|
// PyUpb_GenericSequence
|
||||||
|
|
|
@ -28,15 +28,15 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/descriptor_pool.h"
|
#include "upb/python/descriptor_pool.h"
|
||||||
|
|
||||||
#include "google/protobuf/descriptor.upbdefs.h"
|
#include "google/protobuf/descriptor.upbdefs.h"
|
||||||
#include "python/convert.h"
|
#include "upb/python/convert.h"
|
||||||
#include "python/descriptor.h"
|
#include "upb/python/descriptor.h"
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
#include "upb/util/def_to_proto.h"
|
#include "upb/upb/util/def_to_proto.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// DescriptorPool
|
// DescriptorPool
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:py_proto_library.bzl", "py_proto_library")
|
load("//upb/bazel:py_proto_library.bzl", "py_proto_library")
|
||||||
load(":dist.bzl", "py_dist", "py_dist_module")
|
load(":dist.bzl", "py_dist", "py_dist_module")
|
||||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||||
load("@com_google_protobuf//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION")
|
load("//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION")
|
||||||
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
|
||||||
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
||||||
load("@rules_python//python:packaging.bzl", "py_wheel")
|
load("@rules_python//python:packaging.bzl", "py_wheel")
|
||||||
|
@ -18,36 +18,36 @@ licenses(["notice"])
|
||||||
|
|
||||||
py_dist_module(
|
py_dist_module(
|
||||||
name = "message_mod",
|
name = "message_mod",
|
||||||
extension = "//python:_message_binary",
|
extension = "//upb/python:_message_binary",
|
||||||
module_name = "google._upb._message",
|
module_name = "google._upb._message",
|
||||||
)
|
)
|
||||||
|
|
||||||
py_proto_library(
|
py_proto_library(
|
||||||
name = "well_known_proto_py_pb2",
|
name = "well_known_proto_py_pb2",
|
||||||
deps = [
|
deps = [
|
||||||
"@com_google_protobuf//:any_proto",
|
"//:any_proto",
|
||||||
"@com_google_protobuf//:api_proto",
|
"//:api_proto",
|
||||||
"@com_google_protobuf//:descriptor_proto",
|
"//:descriptor_proto",
|
||||||
"@com_google_protobuf//:duration_proto",
|
"//:duration_proto",
|
||||||
"@com_google_protobuf//:empty_proto",
|
"//:empty_proto",
|
||||||
"@com_google_protobuf//:field_mask_proto",
|
"//:field_mask_proto",
|
||||||
"@com_google_protobuf//:source_context_proto",
|
"//:source_context_proto",
|
||||||
"@com_google_protobuf//:struct_proto",
|
"//:struct_proto",
|
||||||
"@com_google_protobuf//:timestamp_proto",
|
"//:timestamp_proto",
|
||||||
"@com_google_protobuf//:type_proto",
|
"//:type_proto",
|
||||||
"@com_google_protobuf//:wrappers_proto",
|
"//:wrappers_proto",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
py_proto_library(
|
py_proto_library(
|
||||||
name = "plugin_py_pb2",
|
name = "plugin_py_pb2",
|
||||||
deps = ["@com_google_protobuf//:compiler_plugin_proto"],
|
deps = ["//:compiler_plugin_proto"],
|
||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "linux_aarch64_release",
|
name = "linux_aarch64_release",
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "True",
|
"//toolchain:release": "True",
|
||||||
},
|
},
|
||||||
values = {"cpu": "linux-aarch_64"},
|
values = {"cpu": "linux-aarch_64"},
|
||||||
)
|
)
|
||||||
|
@ -59,14 +59,14 @@ config_setting(
|
||||||
"@platforms//cpu:aarch64",
|
"@platforms//cpu:aarch64",
|
||||||
],
|
],
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "False",
|
"//toolchain:release": "False",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "linux_x86_64_release",
|
name = "linux_x86_64_release",
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "True",
|
"//toolchain:release": "True",
|
||||||
},
|
},
|
||||||
values = {"cpu": "linux-x86_64"},
|
values = {"cpu": "linux-x86_64"},
|
||||||
)
|
)
|
||||||
|
@ -78,14 +78,14 @@ config_setting(
|
||||||
"@platforms//cpu:x86_64",
|
"@platforms//cpu:x86_64",
|
||||||
],
|
],
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "False",
|
"//toolchain:release": "False",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "osx_x86_64_release",
|
name = "osx_x86_64_release",
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "True",
|
"//toolchain:release": "True",
|
||||||
},
|
},
|
||||||
values = {"cpu": "osx-x86_64"},
|
values = {"cpu": "osx-x86_64"},
|
||||||
)
|
)
|
||||||
|
@ -97,7 +97,7 @@ config_setting(
|
||||||
"@platforms//cpu:x86_64",
|
"@platforms//cpu:x86_64",
|
||||||
],
|
],
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "False",
|
"//toolchain:release": "False",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ selects.config_setting_group(
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "osx_aarch64_release",
|
name = "osx_aarch64_release",
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "True",
|
"//toolchain:release": "True",
|
||||||
},
|
},
|
||||||
values = {"cpu": "osx-aarch_64"},
|
values = {"cpu": "osx-aarch_64"},
|
||||||
)
|
)
|
||||||
|
@ -124,7 +124,7 @@ config_setting(
|
||||||
"@platforms//cpu:aarch64",
|
"@platforms//cpu:aarch64",
|
||||||
],
|
],
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "False",
|
"//toolchain:release": "False",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ config_setting(
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "windows_x86_32_release",
|
name = "windows_x86_32_release",
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "True",
|
"//toolchain:release": "True",
|
||||||
},
|
},
|
||||||
values = {"cpu": "win32"},
|
values = {"cpu": "win32"},
|
||||||
)
|
)
|
||||||
|
@ -156,7 +156,7 @@ config_setting(
|
||||||
"@platforms//cpu:x86_32",
|
"@platforms//cpu:x86_32",
|
||||||
],
|
],
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "False",
|
"//toolchain:release": "False",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ selects.config_setting_group(
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "windows_x86_64_release",
|
name = "windows_x86_64_release",
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "True",
|
"//toolchain:release": "True",
|
||||||
},
|
},
|
||||||
values = {"cpu": "win64"},
|
values = {"cpu": "win64"},
|
||||||
)
|
)
|
||||||
|
@ -183,7 +183,7 @@ config_setting(
|
||||||
"@platforms//cpu:x86_64",
|
"@platforms//cpu:x86_64",
|
||||||
],
|
],
|
||||||
flag_values = {
|
flag_values = {
|
||||||
"@com_google_protobuf//toolchain:release": "False",
|
"//toolchain:release": "False",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -199,8 +199,8 @@ pkg_files(
|
||||||
name = "generated_wkt",
|
name = "generated_wkt",
|
||||||
srcs = [
|
srcs = [
|
||||||
":well_known_proto_py_pb2",
|
":well_known_proto_py_pb2",
|
||||||
"//:descriptor_upb_proto",
|
"//upb:descriptor_upb_proto",
|
||||||
"//:descriptor_upb_proto_reflection",
|
"//upb:descriptor_upb_proto_reflection",
|
||||||
],
|
],
|
||||||
prefix = "google/protobuf",
|
prefix = "google/protobuf",
|
||||||
)
|
)
|
||||||
|
@ -233,21 +233,21 @@ pkg_files(
|
||||||
pkg_files(
|
pkg_files(
|
||||||
name = "filegroup_source_files",
|
name = "filegroup_source_files",
|
||||||
srcs = [
|
srcs = [
|
||||||
"//:LICENSE",
|
"//upb:LICENSE",
|
||||||
"//:source_files",
|
"//upb:source_files",
|
||||||
"//python:message_srcs",
|
"//upb/python:message_srcs",
|
||||||
"//upb/base:source_files",
|
"//upb/upb/base:source_files",
|
||||||
"//upb/collections:source_files",
|
"//upb/upb/collections:source_files",
|
||||||
"//upb/hash:source_files",
|
"//upb/upb/hash:source_files",
|
||||||
"//upb/lex:source_files",
|
"//upb/upb/lex:source_files",
|
||||||
"//upb/mem:source_files",
|
"//upb/upb/mem:source_files",
|
||||||
"//upb/message:source_files",
|
"//upb/upb/message:source_files",
|
||||||
"//upb/mini_descriptor:source_files",
|
"//upb/upb/mini_descriptor:source_files",
|
||||||
"//upb/mini_table:source_files",
|
"//upb/upb/mini_table:source_files",
|
||||||
"//upb/port:source_files",
|
"//upb/upb/port:source_files",
|
||||||
"//upb/text:source_files",
|
"//upb/upb/text:source_files",
|
||||||
"//upb/util:source_files",
|
"//upb/upb/util:source_files",
|
||||||
"//upb/wire:source_files",
|
"//upb/upb/wire:source_files",
|
||||||
],
|
],
|
||||||
strip_prefix = strip_prefix.from_root(""),
|
strip_prefix = strip_prefix.from_root(""),
|
||||||
)
|
)
|
||||||
|
@ -262,7 +262,7 @@ pkg_tar(
|
||||||
":generated_wkt",
|
":generated_wkt",
|
||||||
":generated_wkt_compiler",
|
":generated_wkt_compiler",
|
||||||
":utf8_range_source_files",
|
":utf8_range_source_files",
|
||||||
"@com_google_protobuf//python:python_source_files",
|
"//python:python_source_files",
|
||||||
],
|
],
|
||||||
extension = "tar.gz",
|
extension = "tar.gz",
|
||||||
package_dir = "protobuf",
|
package_dir = "protobuf",
|
||||||
|
@ -295,9 +295,9 @@ genrule(
|
||||||
py_wheel(
|
py_wheel(
|
||||||
name = "binary_wheel",
|
name = "binary_wheel",
|
||||||
abi = select({
|
abi = select({
|
||||||
"//python:full_api_3.7": "cp37m",
|
"//upb/python:full_api_3.7": "cp37m",
|
||||||
"//python:full_api_3.8": "cp38",
|
"//upb/python:full_api_3.8": "cp38",
|
||||||
"//python:full_api_3.9": "cp39",
|
"//upb/python:full_api_3.9": "cp39",
|
||||||
"//conditions:default": "abi3",
|
"//conditions:default": "abi3",
|
||||||
}),
|
}),
|
||||||
author = "protobuf@googlegroups.com",
|
author = "protobuf@googlegroups.com",
|
||||||
|
@ -312,7 +312,7 @@ py_wheel(
|
||||||
],
|
],
|
||||||
distribution = "protobuf",
|
distribution = "protobuf",
|
||||||
extra_distinfo_files = {
|
extra_distinfo_files = {
|
||||||
"//:LICENSE": "LICENSE",
|
"//upb:LICENSE": "LICENSE",
|
||||||
},
|
},
|
||||||
homepage = "https://developers.google.com/protocol-buffers/",
|
homepage = "https://developers.google.com/protocol-buffers/",
|
||||||
license = "3-Clause BSD License",
|
license = "3-Clause BSD License",
|
||||||
|
@ -329,10 +329,10 @@ py_wheel(
|
||||||
}),
|
}),
|
||||||
python_requires = ">=3.7",
|
python_requires = ">=3.7",
|
||||||
python_tag = selects.with_or({
|
python_tag = selects.with_or({
|
||||||
("//python:limited_api_3.7", "//python:full_api_3.7"): "cp37",
|
("//upb/python:limited_api_3.7", "//upb/python:full_api_3.7"): "cp37",
|
||||||
"//python:full_api_3.8": "cp38",
|
"//upb/python:full_api_3.8": "cp38",
|
||||||
"//python:full_api_3.9": "cp39",
|
"//upb/python:full_api_3.9": "cp39",
|
||||||
"//python:limited_api_3.10": "cp310",
|
"//upb/python:limited_api_3.10": "cp310",
|
||||||
"//conditions:default": "cp" + SYSTEM_PYTHON_VERSION,
|
"//conditions:default": "cp" + SYSTEM_PYTHON_VERSION,
|
||||||
}),
|
}),
|
||||||
strip_path_prefixes = [
|
strip_path_prefixes = [
|
||||||
|
@ -349,7 +349,7 @@ py_wheel(
|
||||||
":message_mod",
|
":message_mod",
|
||||||
":plugin_py_pb2",
|
":plugin_py_pb2",
|
||||||
":well_known_proto_py_pb2",
|
":well_known_proto_py_pb2",
|
||||||
"@com_google_protobuf//:python_srcs",
|
"//:python_srcs",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ py_wheel(
|
||||||
],
|
],
|
||||||
distribution = "protobuf",
|
distribution = "protobuf",
|
||||||
extra_distinfo_files = {
|
extra_distinfo_files = {
|
||||||
"//:LICENSE": "LICENSE",
|
"//upb:LICENSE": "LICENSE",
|
||||||
},
|
},
|
||||||
homepage = "https://developers.google.com/protocol-buffers/",
|
homepage = "https://developers.google.com/protocol-buffers/",
|
||||||
license = "3-Clause BSD License",
|
license = "3-Clause BSD License",
|
||||||
|
@ -387,7 +387,7 @@ py_wheel(
|
||||||
deps = [
|
deps = [
|
||||||
":plugin_py_pb2",
|
":plugin_py_pb2",
|
||||||
":well_known_proto_py_pb2",
|
":well_known_proto_py_pb2",
|
||||||
"@com_google_protobuf//:python_srcs",
|
"//:python_srcs",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ py_wheel(
|
||||||
abi = "none",
|
abi = "none",
|
||||||
distribution = "protobuftests",
|
distribution = "protobuftests",
|
||||||
extra_distinfo_files = {
|
extra_distinfo_files = {
|
||||||
"//:LICENSE": "LICENSE",
|
"//upb:LICENSE": "LICENSE",
|
||||||
},
|
},
|
||||||
platform = "any",
|
platform = "any",
|
||||||
python_tag = "py3",
|
python_tag = "py3",
|
||||||
|
@ -411,11 +411,11 @@ py_wheel(
|
||||||
}),
|
}),
|
||||||
version = PROTOBUF_PYTHON_VERSION,
|
version = PROTOBUF_PYTHON_VERSION,
|
||||||
deps = [
|
deps = [
|
||||||
"//python/pb_unit_tests:test_files",
|
"//:python_common_test_protos",
|
||||||
"@com_google_protobuf//:python_common_test_protos",
|
"//:python_specific_test_protos",
|
||||||
"@com_google_protobuf//:python_specific_test_protos",
|
"//:python_test_srcs",
|
||||||
"@com_google_protobuf//:python_test_srcs",
|
"//src/google/protobuf:testdata",
|
||||||
"@com_google_protobuf//src/google/protobuf:testdata",
|
"//upb/python/pb_unit_tests:test_files",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -121,8 +121,8 @@ py_dist_module = rule(
|
||||||
mandatory = True,
|
mandatory = True,
|
||||||
cfg = _py_multiarch_transition,
|
cfg = _py_multiarch_transition,
|
||||||
),
|
),
|
||||||
"_limited_api": attr.label(default = "//python:limited_api"),
|
"_limited_api": attr.label(default = "//upb/python:limited_api"),
|
||||||
"_python_version": attr.label(default = "//python:python_version"),
|
"_python_version": attr.label(default = "//upb/python:python_version"),
|
||||||
"_allowlist_function_transition": attr.label(
|
"_allowlist_function_transition": attr.label(
|
||||||
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
|
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
|
||||||
),
|
),
|
||||||
|
@ -142,16 +142,16 @@ def _py_dist_transition_impl(settings, attr):
|
||||||
for cpu, version in attr.limited_api_wheels.items():
|
for cpu, version in attr.limited_api_wheels.items():
|
||||||
transitions.append({
|
transitions.append({
|
||||||
"//command_line_option:cpu": cpu,
|
"//command_line_option:cpu": cpu,
|
||||||
"//python:python_version": version,
|
"//upb/python:python_version": version,
|
||||||
"//python:limited_api": True,
|
"//upb/python:limited_api": True,
|
||||||
})
|
})
|
||||||
|
|
||||||
for version in attr.full_api_versions:
|
for version in attr.full_api_versions:
|
||||||
for cpu in attr.full_api_cpus:
|
for cpu in attr.full_api_cpus:
|
||||||
transitions.append({
|
transitions.append({
|
||||||
"//command_line_option:cpu": cpu,
|
"//command_line_option:cpu": cpu,
|
||||||
"//python:python_version": version,
|
"//upb/python:python_version": version,
|
||||||
"//python:limited_api": False,
|
"//upb/python:limited_api": False,
|
||||||
})
|
})
|
||||||
|
|
||||||
return transitions
|
return transitions
|
||||||
|
@ -161,8 +161,8 @@ _py_dist_transition = transition(
|
||||||
inputs = [],
|
inputs = [],
|
||||||
outputs = [
|
outputs = [
|
||||||
"//command_line_option:cpu",
|
"//command_line_option:cpu",
|
||||||
"//python:python_version",
|
"//upb/python:python_version",
|
||||||
"//python:limited_api",
|
"//upb/python:limited_api",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/extension_dict.h"
|
#include "upb/python/extension_dict.h"
|
||||||
|
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// ExtensionDict
|
// ExtensionDict
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "python/python_api.h"
|
#include "upb/python/python_api.h"
|
||||||
|
|
||||||
PyObject* PyUpb_ExtensionDict_New(PyObject* msg);
|
PyObject* PyUpb_ExtensionDict_New(PyObject* msg);
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/map.h"
|
#include "upb/python/map.h"
|
||||||
|
|
||||||
#include "python/convert.h"
|
#include "upb/python/convert.h"
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/collections/map.h"
|
#include "upb/upb/collections/map.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// MapContainer
|
// MapContainer
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "python/python_api.h"
|
#include "upb/python/python_api.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
// Creates a new repeated field stub for field `f` of message object `parent`.
|
// Creates a new repeated field stub for field `f` of message object `parent`.
|
||||||
// Precondition: `parent` must be a stub.
|
// Precondition: `parent` must be a stub.
|
||||||
|
|
|
@ -28,18 +28,18 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
|
|
||||||
#include "python/convert.h"
|
#include "upb/python/convert.h"
|
||||||
#include "python/descriptor.h"
|
#include "upb/python/descriptor.h"
|
||||||
#include "python/extension_dict.h"
|
#include "upb/python/extension_dict.h"
|
||||||
#include "python/map.h"
|
#include "upb/python/map.h"
|
||||||
#include "python/repeated.h"
|
#include "upb/python/repeated.h"
|
||||||
#include "upb/message/copy.h"
|
#include "upb/upb/message/copy.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
#include "upb/reflection/message.h"
|
#include "upb/upb/reflection/message.h"
|
||||||
#include "upb/text/encode.h"
|
#include "upb/upb/text/encode.h"
|
||||||
#include "upb/util/required_fields.h"
|
#include "upb/upb/util/required_fields.h"
|
||||||
|
|
||||||
static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls);
|
static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls);
|
||||||
static PyObject* PyUpb_MessageMeta_GetAttr(PyObject* self, PyObject* name);
|
static PyObject* PyUpb_MessageMeta_GetAttr(PyObject* self, PyObject* name);
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/reflection/message.h"
|
#include "upb/upb/reflection/message.h"
|
||||||
|
|
||||||
// Removes the wrapper object for this field from the unset subobject cache.
|
// Removes the wrapper object for this field from the unset subobject cache.
|
||||||
void PyUpb_Message_CacheDelete(PyObject* _self, const upb_FieldDef* f);
|
void PyUpb_Message_CacheDelete(PyObject* _self, const upb_FieldDef* f);
|
||||||
|
|
|
@ -11,7 +11,7 @@ load("@pip_deps//:requirements.bzl", "requirement")
|
||||||
# end:github_only
|
# end:github_only
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
# end:google_only
|
# end:google_only
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
@ -41,8 +41,8 @@ py_test(
|
||||||
main = "numpy_test_wrapper.py",
|
main = "numpy_test_wrapper.py",
|
||||||
deps = [
|
deps = [
|
||||||
requirement("numpy"),
|
requirement("numpy"),
|
||||||
"@com_google_protobuf//python/google/protobuf/internal/numpy:numpy_test",
|
"//python/google/protobuf/internal/numpy:numpy_test",
|
||||||
"//python:_message",
|
"//upb/python:_message",
|
||||||
],
|
],
|
||||||
target_compatible_with = select({
|
target_compatible_with = select({
|
||||||
"@system_python//:supported": [],
|
"@system_python//:supported": [],
|
||||||
|
@ -79,6 +79,6 @@ filegroup(
|
||||||
name = "test_files",
|
name = "test_files",
|
||||||
srcs = glob(["*.py"]),
|
srcs = glob(["*.py"]),
|
||||||
visibility = [
|
visibility = [
|
||||||
"//python/dist:__pkg__", # Scheuklappen: keep
|
"//upb/python/dist:__pkg__", # Scheuklappen: keep
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,13 +7,13 @@ def pyproto_test_wrapper(name, deps = []):
|
||||||
srcs = [src],
|
srcs = [src],
|
||||||
legacy_create_init = False,
|
legacy_create_init = False,
|
||||||
main = src,
|
main = src,
|
||||||
data = ["@com_google_protobuf//src/google/protobuf:testdata"],
|
data = ["//src/google/protobuf:testdata"],
|
||||||
deps = [
|
deps = [
|
||||||
"//python:_message",
|
"//upb/python:_message",
|
||||||
"@com_google_protobuf//:python_common_test_protos",
|
"//:python_common_test_protos",
|
||||||
"@com_google_protobuf//:python_specific_test_protos",
|
"//:python_specific_test_protos",
|
||||||
"@com_google_protobuf//:python_test_srcs",
|
"//:python_test_srcs",
|
||||||
"@com_google_protobuf//:python_srcs",
|
"//:python_srcs",
|
||||||
] + deps,
|
] + deps,
|
||||||
target_compatible_with = select({
|
target_compatible_with = select({
|
||||||
"@system_python//:supported": [],
|
"@system_python//:supported": [],
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
|
|
||||||
#include "python/descriptor.h"
|
#include "upb/python/descriptor.h"
|
||||||
#include "python/descriptor_containers.h"
|
#include "upb/python/descriptor_containers.h"
|
||||||
#include "python/descriptor_pool.h"
|
#include "upb/python/descriptor_pool.h"
|
||||||
#include "python/extension_dict.h"
|
#include "upb/python/extension_dict.h"
|
||||||
#include "python/map.h"
|
#include "upb/python/map.h"
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/repeated.h"
|
#include "upb/python/repeated.h"
|
||||||
#include "python/unknown_fields.h"
|
#include "upb/python/unknown_fields.h"
|
||||||
|
|
||||||
static upb_Arena* PyUpb_NewArena(void);
|
static upb_Arena* PyUpb_NewArena(void);
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "python/descriptor.h"
|
#include "upb/python/descriptor.h"
|
||||||
#include "python/python_api.h"
|
#include "upb/python/python_api.h"
|
||||||
#include "upb/hash/int_table.h"
|
#include "upb/upb/hash/int_table.h"
|
||||||
|
|
||||||
// begin:github_only
|
// begin:github_only
|
||||||
#define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google.protobuf"
|
#define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google.protobuf"
|
||||||
|
|
|
@ -18,24 +18,24 @@ def py_extension(name, srcs, copts, deps = [], **kwargs):
|
||||||
copts = copts + ["-fvisibility=hidden"],
|
copts = copts + ["-fvisibility=hidden"],
|
||||||
linkopts = selects.with_or({
|
linkopts = selects.with_or({
|
||||||
(
|
(
|
||||||
"//python/dist:osx_x86_64",
|
"//upb/python/dist:osx_x86_64",
|
||||||
"//python/dist:osx_aarch64",
|
"//upb/python/dist:osx_aarch64",
|
||||||
): ["-undefined", "dynamic_lookup"],
|
): ["-undefined", "dynamic_lookup"],
|
||||||
"//python/dist:windows_x86_32": ["-static-libgcc"],
|
"//upb/python/dist:windows_x86_32": ["-static-libgcc"],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
}),
|
}),
|
||||||
linkshared = True,
|
linkshared = True,
|
||||||
linkstatic = True,
|
linkstatic = True,
|
||||||
deps = deps + select({
|
deps = deps + select({
|
||||||
"//python:limited_api_3.7": ["@python-3.7.0//:python_headers"],
|
"//upb/python:limited_api_3.7": ["@python-3.7.0//:python_headers"],
|
||||||
"//python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"],
|
"//upb/python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"],
|
||||||
"//python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"],
|
"//upb/python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"],
|
||||||
"//python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"],
|
"//upb/python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"],
|
||||||
"//python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"],
|
"//upb/python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"],
|
||||||
"//python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"],
|
"//upb/python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"],
|
||||||
"//python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"],
|
"//upb/python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"],
|
||||||
"//python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"],
|
"//upb/python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"],
|
||||||
"//python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"],
|
"//upb/python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"],
|
||||||
"//conditions:default": ["@system_python//:python_headers"],
|
"//conditions:default": ["@system_python//:python_headers"],
|
||||||
}),
|
}),
|
||||||
**kwargs
|
**kwargs
|
||||||
|
@ -49,12 +49,12 @@ def py_extension(name, srcs, copts, deps = [], **kwargs):
|
||||||
srcs = [":" + name + "_binary"],
|
srcs = [":" + name + "_binary"],
|
||||||
outs = [output_file],
|
outs = [output_file],
|
||||||
cmd = "cp $< $@",
|
cmd = "cp $< $@",
|
||||||
visibility = ["//python:__subpackages__"],
|
visibility = ["//upb/python:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
native.py_library(
|
native.py_library(
|
||||||
name = name,
|
name = name,
|
||||||
data = [output_file],
|
data = [output_file],
|
||||||
imports = ["."],
|
imports = ["."],
|
||||||
visibility = ["//python:__subpackages__"],
|
visibility = ["//upb/python:__subpackages__"],
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/repeated.h"
|
#include "upb/python/repeated.h"
|
||||||
|
|
||||||
#include "python/convert.h"
|
#include "upb/python/convert.h"
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
|
|
||||||
static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self,
|
static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self,
|
||||||
PyObject* value);
|
PyObject* value);
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "python/python_api.h"
|
#include "upb/python/python_api.h"
|
||||||
#include "upb/reflection/def.h"
|
#include "upb/upb/reflection/def.h"
|
||||||
|
|
||||||
// Creates a new repeated field stub for field `f` of message object `parent`.
|
// Creates a new repeated field stub for field `f` of message object `parent`.
|
||||||
// Precondition: `parent` must be a stub.
|
// Precondition: `parent` must be a stub.
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "python/unknown_fields.h"
|
#include "upb/python/unknown_fields.h"
|
||||||
|
|
||||||
#include "python/message.h"
|
#include "upb/python/message.h"
|
||||||
#include "python/protobuf.h"
|
#include "upb/python/protobuf.h"
|
||||||
#include "upb/wire/eps_copy_input_stream.h"
|
#include "upb/upb/wire/eps_copy_input_stream.h"
|
||||||
#include "upb/wire/reader.h"
|
#include "upb/upb/wire/reader.h"
|
||||||
#include "upb/wire/types.h"
|
#include "upb/upb/wire/types.h"
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// UnknownFieldSet
|
// UnknownFieldSet
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "python/python_api.h"
|
#include "upb/python/python_api.h"
|
||||||
|
|
||||||
PyObject* PyUpb_UnknownFields_New(PyObject* msg);
|
PyObject* PyUpb_UnknownFields_New(PyObject* msg);
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue