diff --git a/.github/BUILD.bazel b/.github/BUILD.bazel index 12daec4a37..3f37e2d32c 100644 --- a/.github/BUILD.bazel +++ b/.github/BUILD.bazel @@ -6,26 +6,29 @@ # of Xcode. xcode_version( name = "version14_2_14C18", - version = "14.2.14C18", aliases = ["14C18"], default_ios_sdk_version = "16.2", - default_tvos_sdk_version = "16.1", default_macos_sdk_version = "13.1", + default_tvos_sdk_version = "16.1", default_watchos_sdk_version = "9.1", + version = "14.2.14C18", ) xcode_version( name = "version14_1_0_14B47b", - version = "14.1.0.14B47b", aliases = ["14B47b"], default_ios_sdk_version = "16.1", - default_tvos_sdk_version = "16.1", default_macos_sdk_version = "13.0", + default_tvos_sdk_version = "16.1", default_watchos_sdk_version = "9.1", + version = "14.1.0.14B47b", ) xcode_config( name = "host_xcodes", - versions = [":version14_2_14C18", ":version14_1_0_14B47b"], default = ":version14_1_0_14B47b", + versions = [ + ":version14_2_14C18", + ":version14_1_0_14B47b", + ], ) diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 1b6cbd3de6..e207ee3a92 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -20,7 +20,7 @@ jobs: version: ["3.8", "3.9", "3.10", "3.11" ] include: - type: Pure - targets: //python/... //upb/python/... //python:python_version_test + targets: //python/... //python:python_version_test flags: --define=use_fast_cpp_protos=false - type: C++ targets: //python/... //python:python_version_test @@ -46,6 +46,7 @@ jobs: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: python_linux/${{ matrix.type }}_${{ matrix.version }} bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_PYTHON_VERSION + exclude-targets: -//python/pb_unit_tests/... macos: @@ -57,7 +58,7 @@ jobs: version: [ "3.11" ] include: - type: Pure - targets: //python/... //upb/python/... //python:python_version_test + targets: //python/... //python:python_version_test - type: C++ targets: //python/... //python:python_version_test flags: --define=use_fast_cpp_protos=true @@ -95,3 +96,4 @@ jobs: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_PYTHON_VERSION=${{ matrix.version }} --macos_minimum_os=10.9 + exclude-targets: -//python/pb_unit_tests/... diff --git a/.github/workflows/test_upb.yml b/.github/workflows/test_upb.yml index 0139a29cce..0412546dc5 100644 --- a/.github/workflows/test_upb.yml +++ b/.github/workflows/test_upb.yml @@ -20,9 +20,9 @@ jobs: - { name: "Fastbuild" } - { name: "Optimized", flags: "-c opt" } - { name: "FastTable", flags: "--//upb:fasttable_enabled=true" } - - { 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: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/..." } + - { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/..." } + - { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-//benchmarks:benchmark -//python/... -//lua/..." } + - { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-//benchmarks:benchmark -//python/..." } # TODO: b/297027295 - Add 32-bit ASAN test name: ${{ matrix.config.name }} @@ -39,7 +39,7 @@ jobs: image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize@sha256:04cd765285bc52cbbf51d66c8c66d8603579cf0f19cc42df26b09d2c270541fb credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} 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 //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upbc/... ${{ matrix.config.flags }} exclude-targets: ${{ matrix.config.exclude-targets }} linux-gcc: @@ -58,7 +58,7 @@ jobs: image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:12.2-6.3.0-63dd26c0c7a808d92673a3e52e848189d4ab0f17" credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: "upb-bazel-gcc" - bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //upb/... + bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upbc/... windows: strategy: @@ -75,7 +75,8 @@ jobs: with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} 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/... //upbc/... //python/... //protos/... //protos_generator/... + exclude-targets: -//python:conformance_test -//upb:def_builder_test macos: strategy: @@ -96,7 +97,7 @@ jobs: with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: "upb-bazel-macos" - bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //upb/... + bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upbc/... no-python: strategy: @@ -118,7 +119,7 @@ jobs: which python3 && mv `which python3` /tmp && ! which python3 && - bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //upb/python/... -- -//upb/python/dist:source_wheel + bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //python/... -- -//python/dist:source_wheel build_wheels: name: Build Wheels @@ -135,7 +136,7 @@ jobs: image: us-docker.pkg.dev/protobuf-build/release-containers/linux/apple@sha256:b3dc9b75d8e599b0e95ed245d89f44b5a4231112f975da89dd02006a484a58df credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: upb-bazel-python - bazel: build --crosstool_top=//toolchain:clang_suite --//toolchain:release=true --symlink_prefix=/ -c dbg //upb/python/dist //upb/python/dist:test_wheel //upb/python/dist:source_wheel + bazel: build --crosstool_top=//toolchain:clang_suite --//toolchain:release=true --symlink_prefix=/ -c dbg //python/dist //python/dist:test_wheel //python/dist:source_wheel - name: Move Wheels run: mkdir wheels && find _build/out \( -name 'protobuf*.whl' -o -name 'protobuf-*.tar.gz' \) -exec mv '{}' wheels ';' - uses: actions/upload-artifact@v3 @@ -146,7 +147,7 @@ jobs: with: name: requirements # Tests shouldn't have access to the whole upb repo, upload the one file we need - path: upb/python/requirements.txt + path: python/requirements.txt test_wheels: name: Test Wheels diff --git a/BUILD.bazel b/BUILD.bazel index dddb5869dc..23efee4a31 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,9 +1,9 @@ # Bazel (https://bazel.build/) BUILD file for Protobuf. load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library") +load("@rules_java//java:defs.bzl", "java_lite_proto_library", "java_proto_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") -load("@rules_java//java:defs.bzl", "java_lite_proto_library", "java_proto_library") load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS") load(":protobuf.bzl", "internal_objc_proto_library", "internal_php_proto_library", "internal_py_proto_library", "internal_ruby_proto_library") @@ -153,8 +153,8 @@ filegroup( internal_ruby_proto_library( name = "well_known_ruby_protos", srcs = [":well_known_protos"], - includes = ["src"], default_runtime = "", + includes = ["src"], visibility = [ "//conformance:__pkg__", "//ruby:__subpackages__", @@ -182,14 +182,14 @@ cc_binary( cc_binary( name = "protoc_static", copts = COPTS, - linkopts = LINK_OPTS, features = select({ - # This isn't possible on mac because there is no static library for lcrt0.o - "@platforms//os:osx": [], - "//build_defs:config_osx": [], - # When cross-compiling we need to statically link all C++ libraries. - "//conditions:default": ["fully_static_link"], + # This isn't possible on mac because there is no static library for lcrt0.o + "@platforms//os:osx": [], + "//build_defs:config_osx": [], + # When cross-compiling we need to statically link all C++ libraries. + "//conditions:default": ["fully_static_link"], }), + linkopts = LINK_OPTS, visibility = ["//visibility:public"], deps = ["//src/google/protobuf/compiler:protoc_lib"], ) @@ -201,9 +201,9 @@ cc_binary( # Expose the runtime for the proto_lang_toolchain so that it can also be used in # a user-defined proto_lang_toolchain. alias( - name = "protobuf_nowkt", - actual = "//src/google/protobuf:protobuf_nowkt", - visibility = ["//visibility:public"], + name = "protobuf_nowkt", + actual = "//src/google/protobuf:protobuf_nowkt", + visibility = ["//visibility:public"], ) # The "lite" runtime works for .proto files that specify the option: @@ -302,13 +302,13 @@ alias( alias( name = "python_srcs", actual = "//python:python_srcs", - visibility = ["//upb:__subpackages__"], + visibility = ["//python:__subpackages__"], ) alias( name = "python_test_srcs", actual = "//python:python_test_srcs", - visibility = ["//upb:__subpackages__"], + visibility = ["//python:__subpackages__"], ) alias( @@ -545,11 +545,11 @@ internal_ruby_proto_library( # The above must come first. "src", ], - deps = [":well_known_ruby_protos"], visibility = [ "//conformance:__pkg__", "//ruby:__subpackages__", ], + deps = [":well_known_ruby_protos"], ) filegroup( diff --git a/WORKSPACE b/WORKSPACE index 6c78cd82ba..d1d193de50 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -107,13 +107,13 @@ ruby_bundle( gemfile = "//ruby:Gemfile", ) -load("//upb/bazel:workspace_deps.bzl", "upb_deps") +load("//bazel:workspace_deps.bzl", "upb_deps") upb_deps() http_archive( name = "lua", - build_file = "//upb/bazel:lua.BUILD", + build_file = "//bazel:lua.BUILD", sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b", strip_prefix = "lua-5.2.4", urls = [ @@ -134,11 +134,11 @@ http_archive( urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"], strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83", sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46", - build_file = "//upb/benchmarks:BUILD.googleapis", + build_file = "//benchmarks:BUILD.googleapis", patch_cmds = ["find google -type f -name BUILD.bazel -delete"], ) -load("//upb/bazel:system_python.bzl", "system_python") +load("//bazel:system_python.bzl", "system_python") system_python( name = "system_python", @@ -149,7 +149,7 @@ load("@system_python//:pip.bzl", "pip_parse") pip_parse( name = "pip_deps", - requirements = "//upb/python:requirements.txt", + requirements = "//python:requirements.txt", ) load("@pip_deps//:requirements.bzl", "install_deps") diff --git a/upb/bazel/BUILD b/bazel/BUILD similarity index 100% rename from upb/bazel/BUILD rename to bazel/BUILD diff --git a/upb/bazel/amalgamate.py b/bazel/amalgamate.py similarity index 100% rename from upb/bazel/amalgamate.py rename to bazel/amalgamate.py diff --git a/upb/bazel/amalgamation.bzl b/bazel/amalgamation.bzl similarity index 97% rename from upb/bazel/amalgamation.bzl rename to bazel/amalgamation.bzl index 206dcb576a..dd8ddf6b66 100644 --- a/upb/bazel/amalgamation.bzl +++ b/bazel/amalgamation.bzl @@ -54,7 +54,7 @@ upb_amalgamation = rule( "_amalgamator": attr.label( executable = True, cfg = "exec", - default = "//upb/bazel:amalgamate", + default = "//bazel:amalgamate", ), "prefix": attr.string( default = "", diff --git a/upb/bazel/build_defs.bzl b/bazel/build_defs.bzl similarity index 100% rename from upb/bazel/build_defs.bzl rename to bazel/build_defs.bzl diff --git a/upb/bazel/lua.BUILD b/bazel/lua.BUILD similarity index 100% rename from upb/bazel/lua.BUILD rename to bazel/lua.BUILD diff --git a/upb/bazel/py_proto_library.bzl b/bazel/py_proto_library.bzl similarity index 100% rename from upb/bazel/py_proto_library.bzl rename to bazel/py_proto_library.bzl diff --git a/upb/bazel/python_downloads.bzl b/bazel/python_downloads.bzl similarity index 95% rename from upb/bazel/python_downloads.bzl rename to bazel/python_downloads.bzl index 28677c1fd4..5ddac20d8a 100644 --- a/upb/bazel/python_downloads.bzl +++ b/bazel/python_downloads.bzl @@ -39,7 +39,7 @@ cc_import( hdrs = glob(["**/*.h"]), shared_library = "python{0}.dll", interface_library = "libs/python{0}.lib", - visibility = ["@com_google_protobuf//upb/python:__pkg__"], + visibility = ["@com_google_protobuf//python:__pkg__"], ) cc_import( @@ -47,7 +47,7 @@ cc_import( hdrs = glob(["**/*.h"]), shared_library = "python{1}.dll", interface_library = "libs/python{1}.lib", - visibility = ["@com_google_protobuf//upb/python:__pkg__"], + visibility = ["@com_google_protobuf//python:__pkg__"], ) """ diff --git a/upb/bazel/system_python.bzl b/bazel/system_python.bzl similarity index 100% rename from upb/bazel/system_python.bzl rename to bazel/system_python.bzl diff --git a/upb/bazel/upb_c_proto_library.bzl b/bazel/upb_c_proto_library.bzl similarity index 84% rename from upb/bazel/upb_c_proto_library.bzl rename to bazel/upb_c_proto_library.bzl index e58dffaa4a..8221b7ea25 100644 --- a/upb/bazel/upb_c_proto_library.bzl +++ b/bazel/upb_c_proto_library.bzl @@ -1,9 +1,9 @@ """upb_c_proto_library() exposes upb's generated C API for protobuf (foo.upb.h)""" -load("//upb/bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect") -load("//upb/bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl") -load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain") -load("//upb/bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl") +load("//bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect") +load("//bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl") +load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain") +load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl") UpbWrappedCcInfo = provider( "Provider for cc_info for protos", @@ -34,7 +34,7 @@ upb_c_proto_library_aspect = aspect( "_gen_upb": attr.label( executable = True, cfg = "exec", - default = "//upb/upbc:protoc-gen-upb_stage1", + default = "//upbc:protoc-gen-upb_stage1", ), "_protoc": attr.label( executable = True, diff --git a/upb/bazel/upb_minitable_proto_library.bzl b/bazel/upb_minitable_proto_library.bzl similarity index 89% rename from upb/bazel/upb_minitable_proto_library.bzl rename to bazel/upb_minitable_proto_library.bzl index 82ea53d5f0..34bab83be5 100644 --- a/upb/bazel/upb_minitable_proto_library.bzl +++ b/bazel/upb_minitable_proto_library.bzl @@ -1,8 +1,8 @@ """upb_minitable_proto_library() exposes upb's generated minitables (foo.upb_minitable.h)""" -load("//upb/bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl") -load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain") -load("//upb/bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl") +load("//bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl") +load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain") +load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl") UpbMinitableCcInfo = provider( "Provider for cc_info for protos", @@ -46,7 +46,7 @@ upb_minitable_proto_library_aspect = aspect( "_gen_upb_minitable": attr.label( executable = True, cfg = "exec", - default = "//upb/upbc:protoc-gen-upb_minitable_stage1", + default = "//upbc:protoc-gen-upb_minitable_stage1", ), "_protoc": attr.label( executable = True, diff --git a/upb/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl similarity index 86% rename from upb/bazel/upb_proto_library.bzl rename to bazel/upb_proto_library.bzl index b6c0aff4f9..e38444e538 100644 --- a/upb/bazel/upb_proto_library.bzl +++ b/bazel/upb_proto_library.bzl @@ -11,17 +11,17 @@ """ load( - "//upb/bazel:upb_c_proto_library.bzl", + "//bazel:upb_c_proto_library.bzl", _UpbWrappedCcInfo = "UpbWrappedCcInfo", _upb_c_proto_library = "upb_c_proto_library", _upb_c_proto_library_aspect = "upb_c_proto_library_aspect", ) load( - "//upb/bazel:upb_proto_library_internal/aspect.bzl", + "//bazel:upb_proto_library_internal/aspect.bzl", _GeneratedSrcsInfo = "GeneratedSrcsInfo", ) load( - "//upb/bazel:upb_proto_reflection_library.bzl", + "//bazel:upb_proto_reflection_library.bzl", _upb_proto_reflection_library = "upb_proto_reflection_library", ) diff --git a/upb/bazel/upb_proto_library_internal/aspect.bzl b/bazel/upb_proto_library_internal/aspect.bzl similarity index 98% rename from upb/bazel/upb_proto_library_internal/aspect.bzl rename to bazel/upb_proto_library_internal/aspect.bzl index f31e29ba4b..d40664e9bd 100644 --- a/upb/bazel/upb_proto_library_internal/aspect.bzl +++ b/bazel/upb_proto_library_internal/aspect.bzl @@ -1,8 +1,8 @@ """Implementation of the aspect that powers the upb_*_proto_library() rules.""" load("@bazel_skylib//lib:paths.bzl", "paths") -load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "cc_library_func") -load("//upb/bazel:upb_proto_library_internal/copts.bzl", "UpbProtoLibraryCoptsInfo") +load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "cc_library_func") +load("//bazel:upb_proto_library_internal/copts.bzl", "UpbProtoLibraryCoptsInfo") # begin:github_only _is_google3 = False diff --git a/upb/bazel/upb_proto_library_internal/cc_library_func.bzl b/bazel/upb_proto_library_internal/cc_library_func.bzl similarity index 100% rename from upb/bazel/upb_proto_library_internal/cc_library_func.bzl rename to bazel/upb_proto_library_internal/cc_library_func.bzl diff --git a/upb/bazel/upb_proto_library_internal/copts.bzl b/bazel/upb_proto_library_internal/copts.bzl similarity index 100% rename from upb/bazel/upb_proto_library_internal/copts.bzl rename to bazel/upb_proto_library_internal/copts.bzl diff --git a/upb/bazel/upb_proto_library_internal/rule.bzl b/bazel/upb_proto_library_internal/rule.bzl similarity index 100% rename from upb/bazel/upb_proto_library_internal/rule.bzl rename to bazel/upb_proto_library_internal/rule.bzl diff --git a/upb/bazel/upb_proto_reflection_library.bzl b/bazel/upb_proto_reflection_library.bzl similarity index 84% rename from upb/bazel/upb_proto_reflection_library.bzl rename to bazel/upb_proto_reflection_library.bzl index 0717bf610b..c4d52aa1a4 100644 --- a/upb/bazel/upb_proto_reflection_library.bzl +++ b/bazel/upb_proto_reflection_library.bzl @@ -1,9 +1,9 @@ """upb_c_proto_reflection_library() exposes upb reflection for protobuf (foo.upbdefs.h)""" -load("//upb/bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect") -load("//upb/bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl") -load("//upb/bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain") -load("//upb/bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl") +load("//bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect") +load("//bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl") +load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain") +load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl") _UpbDefsWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"]) @@ -31,7 +31,7 @@ _upb_proto_reflection_library_aspect = aspect( "_gen_upbdefs": attr.label( executable = True, cfg = "exec", - default = "//upb/upbc:protoc-gen-upbdefs", + default = "//upbc:protoc-gen-upbdefs", ), "_protoc": attr.label( executable = True, diff --git a/upb/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl similarity index 97% rename from upb/bazel/workspace_deps.bzl rename to bazel/workspace_deps.bzl index 1f3ccad99f..14b2fc80a9 100644 --- a/upb/bazel/workspace_deps.bzl +++ b/bazel/workspace_deps.bzl @@ -1,6 +1,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("//upb/bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive") +load("//bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive") def _github_archive(repo, commit, **kwargs): repo_name = repo.split("/")[-1] diff --git a/upb/benchmarks/BUILD b/benchmarks/BUILD similarity index 98% rename from upb/benchmarks/BUILD rename to benchmarks/BUILD index 8839584602..07f87a91e7 100644 --- a/upb/benchmarks/BUILD +++ b/benchmarks/BUILD @@ -12,7 +12,7 @@ load("@rules_python//python:defs.bzl", "py_binary") # end:google_only load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -76,6 +76,7 @@ cc_test( ":benchmark_descriptor_upb_proto", ":benchmark_descriptor_upb_proto_reflection", "//:protobuf", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:base_internal", "//upb:descriptor_upb_proto", diff --git a/upb/benchmarks/BUILD.googleapis b/benchmarks/BUILD.googleapis similarity index 100% rename from upb/benchmarks/BUILD.googleapis rename to benchmarks/BUILD.googleapis diff --git a/upb/benchmarks/benchmark.cc b/benchmarks/benchmark.cc similarity index 97% rename from upb/benchmarks/benchmark.cc rename to benchmarks/benchmark.cc index 689ff1bdf4..a2e2cc20ea 100644 --- a/upb/benchmarks/benchmark.cc +++ b/benchmarks/benchmark.cc @@ -38,15 +38,15 @@ #include "google/protobuf/descriptor.pb.h" #include "absl/container/flat_hash_set.h" #include "google/protobuf/dynamic_message.h" -#include "upb/benchmarks/descriptor.pb.h" -#include "upb/benchmarks/descriptor.upb.h" -#include "upb/benchmarks/descriptor.upbdefs.h" -#include "upb/benchmarks/descriptor_sv.pb.h" -#include "upb/upb/base/internal/log2.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/reflection/def.hpp" +#include "benchmarks/descriptor.pb.h" +#include "benchmarks/descriptor.upb.h" +#include "benchmarks/descriptor.upbdefs.h" +#include "benchmarks/descriptor_sv.pb.h" +#include "upb/base/internal/log2.h" +#include "upb/mem/arena.h" +#include "upb/reflection/def.hpp" -upb_StringView descriptor = upb_benchmarks_descriptor_proto_upbdefinit.descriptor; +upb_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor; namespace protobuf = ::google::protobuf; // A buffer big enough to parse descriptor.proto without going to heap. diff --git a/upb/benchmarks/build_defs.bzl b/benchmarks/build_defs.bzl similarity index 100% rename from upb/benchmarks/build_defs.bzl rename to benchmarks/build_defs.bzl diff --git a/upb/benchmarks/compare.py b/benchmarks/compare.py similarity index 100% rename from upb/benchmarks/compare.py rename to benchmarks/compare.py diff --git a/upb/benchmarks/descriptor.proto b/benchmarks/descriptor.proto similarity index 100% rename from upb/benchmarks/descriptor.proto rename to benchmarks/descriptor.proto diff --git a/upb/benchmarks/descriptor_sv.proto b/benchmarks/descriptor_sv.proto similarity index 100% rename from upb/benchmarks/descriptor_sv.proto rename to benchmarks/descriptor_sv.proto diff --git a/upb/benchmarks/empty.proto b/benchmarks/empty.proto similarity index 100% rename from upb/benchmarks/empty.proto rename to benchmarks/empty.proto diff --git a/upb/benchmarks/gen_protobuf_binary_cc.py b/benchmarks/gen_protobuf_binary_cc.py similarity index 100% rename from upb/benchmarks/gen_protobuf_binary_cc.py rename to benchmarks/gen_protobuf_binary_cc.py diff --git a/upb/benchmarks/gen_synthetic_protos.py b/benchmarks/gen_synthetic_protos.py similarity index 100% rename from upb/benchmarks/gen_synthetic_protos.py rename to benchmarks/gen_synthetic_protos.py diff --git a/upb/benchmarks/gen_upb_binary_c.py b/benchmarks/gen_upb_binary_c.py similarity index 100% rename from upb/benchmarks/gen_upb_binary_c.py rename to benchmarks/gen_upb_binary_c.py diff --git a/build_defs/BUILD.bazel b/build_defs/BUILD.bazel index 0a45eae504..ea8fa18e94 100644 --- a/build_defs/BUILD.bazel +++ b/build_defs/BUILD.bazel @@ -89,7 +89,7 @@ selects.config_setting_group( match_any = [ ":config_win32", ":config_win64", - ] + ], ) config_setting( @@ -107,7 +107,7 @@ selects.config_setting_group( match_any = [ ":config_osx_aarch64", ":config_osx_x86_64", - ] + ], ) # Internal testing: diff --git a/csharp/compatibility_tests/v3.0.0/BUILD.bazel b/csharp/compatibility_tests/v3.0.0/BUILD.bazel index 1f6c713cd5..f7c1b26666 100644 --- a/csharp/compatibility_tests/v3.0.0/BUILD.bazel +++ b/csharp/compatibility_tests/v3.0.0/BUILD.bazel @@ -4,13 +4,13 @@ load("//build_defs:internal_shell.bzl", "inline_sh_test") inline_sh_test( name = "tests", srcs = ["test.sh"], + cmd = "$(location test.sh) 3.0.0 $(rootpath //:protoc)", tools = ["//:protoc"], deps = glob([ - "src/**/*.cs*", # .cs and .csproj - "protos/**/*.proto", + "src/**/*.cs*", # .cs and .csproj + "protos/**/*.proto", ]) + [ - "//csharp:srcs", - "//:well_known_protos", + "//:well_known_protos", + "//csharp:srcs", ], - cmd = "$(location test.sh) 3.0.0 $(rootpath //:protoc)" ) diff --git a/docs/design/editions/edition-zero-converged-semantics.md b/docs/design/editions/edition-zero-converged-semantics.md index 2b9557a240..339f180ed4 100644 --- a/docs/design/editions/edition-zero-converged-semantics.md +++ b/docs/design/editions/edition-zero-converged-semantics.md @@ -129,7 +129,7 @@ build horizon issues since GCL parses protos in prod). Rev'ing `descriptor.proto` is a far more intrusive change that affects many downstream systems. Many systems access descriptors through either a descriptor -API (for example, `proto2::Descriptor` in C++) or by directly accessing a proto +API (for example, `google::protobuf::Descriptor` in C++) or by directly accessing a proto from `descriptor.proto` (eg. `google.protobuf.DescriptorProto`). Any changes here need to be managed much more delicately. diff --git a/docs/design/editions/edition-zero-feature-enum-field-closedness.md b/docs/design/editions/edition-zero-feature-enum-field-closedness.md index 30e1a62efa..aea7fcaabd 100644 --- a/docs/design/editions/edition-zero-feature-enum-field-closedness.md +++ b/docs/design/editions/edition-zero-feature-enum-field-closedness.md @@ -7,7 +7,7 @@ ## Background On 2023-02-10, a CL [@mcy](https://github.com/mcy) submitted to delete -`proto2::Reflection::SupportsUnknownEnumValue()`. Oddly, this function used the +`google::protobuf::Reflection::SupportsUnknownEnumValue()`. Oddly, this function used the containing message's `syntax`, rather than the enum field's, to determine whether the enum was open. diff --git a/upb/docs/design.md b/docs/upb/design.md similarity index 100% rename from upb/docs/design.md rename to docs/upb/design.md diff --git a/upb/docs/render.py b/docs/upb/render.py similarity index 100% rename from upb/docs/render.py rename to docs/upb/render.py diff --git a/upb/docs/style-guide.md b/docs/upb/style-guide.md similarity index 100% rename from upb/docs/style-guide.md rename to docs/upb/style-guide.md diff --git a/upb/docs/vs-cpp-protos.md b/docs/upb/vs-cpp-protos.md similarity index 100% rename from upb/docs/vs-cpp-protos.md rename to docs/upb/vs-cpp-protos.md diff --git a/upb/docs/wrapping-upb.md b/docs/upb/wrapping-upb.md similarity index 98% rename from upb/docs/wrapping-upb.md rename to docs/upb/wrapping-upb.md index cefced6611..bc1bd63a97 100644 --- a/upb/docs/wrapping-upb.md +++ b/docs/upb/wrapping-upb.md @@ -173,8 +173,8 @@ class MyMessage(_message.Message): To use reflection-based access: -1. Load and access descriptor data using the interfaces in upb/upb/reflection/def.h. -2. Access message data using the interfaces in upb/upb/reflection/message.h. +1. Load and access descriptor data using the interfaces in upb/reflection/def.h. +2. Access message data using the interfaces in upb/reflection/message.h. ### MiniTables @@ -234,8 +234,8 @@ APIs to do this do not exist yet. To use MiniTable-based access: -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/upb/message/accessors.h. +1. Load and access MiniDescriptors data using the interfaces in upb/mini_descriptor/decode.h. +2. Access message data using the interfaces in upb/message/accessors.h. ## Memory Management diff --git a/upb/.bazelci/presubmit.yml b/google3/third_party/upb/github/.bazelci/presubmit.yml similarity index 100% rename from upb/.bazelci/presubmit.yml rename to google3/third_party/upb/github/.bazelci/presubmit.yml diff --git a/upb/.bazelignore b/google3/third_party/upb/github/.bazelignore similarity index 100% rename from upb/.bazelignore rename to google3/third_party/upb/github/.bazelignore diff --git a/upb/.bazelrc b/google3/third_party/upb/github/.bazelrc similarity index 100% rename from upb/.bazelrc rename to google3/third_party/upb/github/.bazelrc diff --git a/upb/.clang-format b/google3/third_party/upb/github/.clang-format similarity index 100% rename from upb/.clang-format rename to google3/third_party/upb/github/.clang-format diff --git a/upb/.gitignore b/google3/third_party/upb/github/.gitignore similarity index 100% rename from upb/.gitignore rename to google3/third_party/upb/github/.gitignore diff --git a/upb/README.md b/google3/third_party/upb/github/README.md similarity index 100% rename from upb/README.md rename to google3/third_party/upb/github/README.md diff --git a/java/BUILD.bazel b/java/BUILD.bazel index 1b45507282..14838ae377 100644 --- a/java/BUILD.bazel +++ b/java/BUILD.bazel @@ -4,11 +4,6 @@ load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") sh_test( name = "linkage_monitor", size = "large", - tags = [ - # Exclude this target from wildcard expansion (//...) because it may - # take unnecessary time. - "manual", - ], srcs = [ ":linkage_monitor.sh", ], @@ -28,6 +23,11 @@ sh_test( "*/pom.xml", "test/linkage-monitor-check-bom/pom.xml", ]), + tags = [ + # Exclude this target from wildcard expansion (//...) because it may + # take unnecessary time. + "manual", + ], ) test_suite( diff --git a/java/kotlin/BUILD.bazel b/java/kotlin/BUILD.bazel index 9814c7a0d3..2d17a71d47 100644 --- a/java/kotlin/BUILD.bazel +++ b/java/kotlin/BUILD.bazel @@ -59,8 +59,8 @@ kt_jvm_export( maven_coordinates = "com.google.protobuf:protobuf-kotlin:%s" % PROTOBUF_JAVA_VERSION, pom_template = "//java/kotlin:pom_template.xml", resources = [ - "//src/google/protobuf:descriptor_proto_srcs", "//:well_known_type_protos", + "//src/google/protobuf:descriptor_proto_srcs", ], tags = ["manual"], runtime_deps = [ diff --git a/upb/lua/BUILD.bazel b/lua/BUILD.bazel similarity index 94% rename from upb/lua/BUILD.bazel rename to lua/BUILD.bazel index ba2b156082..6216f9c27a 100644 --- a/upb/lua/BUILD.bazel +++ b/lua/BUILD.bazel @@ -6,12 +6,12 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", ) load( - "//upb/lua:lua_proto_library.bzl", + "//lua:lua_proto_library.bzl", "lua_proto_library", ) @@ -58,6 +58,7 @@ cc_test( copts = UPB_DEFAULT_COPTS, data = [ "test_upb.lua", + "upb.lua", ":descriptor_proto_lua", ":empty_proto_lua", ":test_messages_proto2_proto_lua", @@ -67,11 +68,10 @@ cc_test( "//conformance:conformance_proto", "//third_party/lunit:console.lua", "//third_party/lunit:lunit.lua", - "//upb/lua:upb.lua", ], linkstatic = 1, deps = [ - "//upb/lua:lupb", + ":lupb", "@lua//:liblua", ], ) diff --git a/upb/lua/README.md b/lua/README.md similarity index 100% rename from upb/lua/README.md rename to lua/README.md diff --git a/upb/lua/def.c b/lua/def.c similarity index 99% rename from upb/lua/def.c rename to lua/def.c index 22e0b9f579..9affe52c12 100644 --- a/upb/lua/def.c +++ b/lua/def.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/reflection/def.h" +#include "upb/reflection/def.h" #include #include @@ -36,8 +36,8 @@ #include #include "lauxlib.h" -#include "upb/lua/upb.h" -#include "upb/upb/reflection/message.h" +#include "lua/upb.h" +#include "upb/reflection/message.h" #define LUPB_ENUMDEF "lupb.enumdef" #define LUPB_ENUMVALDEF "lupb.enumvaldef" diff --git a/upb/lua/lua_proto_library.bzl b/lua/lua_proto_library.bzl similarity index 98% rename from upb/lua/lua_proto_library.bzl rename to lua/lua_proto_library.bzl index d7a741c7e3..579eca121b 100644 --- a/upb/lua/lua_proto_library.bzl +++ b/lua/lua_proto_library.bzl @@ -109,7 +109,7 @@ _lua_proto_library_aspect = aspect( "_upbc": attr.label( executable = True, cfg = "exec", - default = "//upb/lua:protoc-gen-lua", + default = "//lua:protoc-gen-lua", ), "_protoc": attr.label( executable = True, diff --git a/upb/lua/main.c b/lua/main.c similarity index 94% rename from upb/lua/main.c rename to lua/main.c index a34069dbc0..7f32209627 100644 --- a/upb/lua/main.c +++ b/lua/main.c @@ -33,7 +33,7 @@ #include #include -#include "upb/lua/upb.h" +#include "lua/upb.h" lua_State* L; @@ -59,14 +59,14 @@ const char* init = "bazel-bin/?.lua;" "bazel-bin/external/com_google_protobuf/src/?.lua;" "bazel-bin/external/com_google_protobuf/?.lua;" - "upb/lua/?.lua;" + "lua/?.lua;" // These additional paths handle the case where this test is invoked from // the protobuf repo's Bazel workspace. - "external/upb/?.lua;" - "external/upb/third_party/lunit/?.lua;" + "external/?.lua;" + "external/third_party/lunit/?.lua;" "src/?.lua;" - "bazel-bin/external/upb/?.lua;" - "external/upb/lua/?.lua" + "bazel-bin/external/?.lua;" + "external/lua/?.lua" "'"; int main(int argc, char** argv) { diff --git a/upb/lua/msg.c b/lua/msg.c similarity index 99% rename from upb/lua/msg.c rename to lua/msg.c index ab487394a4..bdec7a2d09 100644 --- a/upb/lua/msg.c +++ b/lua/msg.c @@ -39,14 +39,14 @@ #include #include "lauxlib.h" -#include "upb/lua/upb.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/json/decode.h" -#include "upb/upb/json/encode.h" -#include "upb/upb/message/message.h" -#include "upb/upb/port/def.inc" -#include "upb/upb/reflection/message.h" -#include "upb/upb/text/encode.h" +#include "lua/upb.h" +#include "upb/collections/map.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/message/message.h" +#include "upb/port/def.inc" +#include "upb/reflection/message.h" +#include "upb/text/encode.h" /* * Message/Map/Array objects. These objects form a directed graph: a message diff --git a/upb/lua/test.proto b/lua/test.proto similarity index 100% rename from upb/lua/test.proto rename to lua/test.proto diff --git a/upb/lua/test_upb.lua b/lua/test_upb.lua similarity index 99% rename from upb/lua/test_upb.lua rename to lua/test_upb.lua index 416fdc7003..8ebf82bd8e 100644 --- a/upb/lua/test_upb.lua +++ b/lua/test_upb.lua @@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local upb = require "lupb" local lunit = require "lunit" -local upb_test = require "upb.lua.test_pb" +local upb_test = require "lua.test_pb" local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb" local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb" local descriptor = require "google.protobuf.descriptor_pb" diff --git a/upb/lua/upb.c b/lua/upb.c similarity index 99% rename from upb/lua/upb.c rename to lua/upb.c index 07dc3f325d..4500fb4e75 100644 --- a/upb/lua/upb.c +++ b/lua/upb.c @@ -50,7 +50,7 @@ * domain of [u]int64 values. */ -#include "upb/lua/upb.h" +#include "lua/upb.h" #include #include @@ -59,7 +59,7 @@ #include #include "lauxlib.h" -#include "upb/upb/message/message.h" +#include "upb/message/message.h" /* Lua compatibility code *****************************************************/ diff --git a/upb/lua/upb.h b/lua/upb.h similarity index 97% rename from upb/lua/upb.h rename to lua/upb.h index 59a4ffeb0c..46ec9118c5 100644 --- a/upb/lua/upb.h +++ b/lua/upb.h @@ -36,9 +36,9 @@ #define UPB_LUA_UPB_H_ #include "lauxlib.h" -#include "upb/upb/message/message.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/message.h" +#include "upb/message/message.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" /* Lua changes its API in incompatible ways in every minor release. * This is some shim code to paper over the differences. */ diff --git a/upb/lua/upb.lua b/lua/upb.lua similarity index 100% rename from upb/lua/upb.lua rename to lua/upb.lua diff --git a/upb/lua/upbc.cc b/lua/upbc.cc similarity index 100% rename from upb/lua/upbc.cc rename to lua/upbc.cc diff --git a/objectivec/BUILD.bazel b/objectivec/BUILD.bazel index 70727ccd1d..cb0d7c8034 100644 --- a/objectivec/BUILD.bazel +++ b/objectivec/BUILD.bazel @@ -42,8 +42,8 @@ genrule( for wkt in _OBJC_WKT_NAMES for ext in _OBJC_EXTS ]), - tools = ["//:protoc"], tags = ["manual"], + tools = ["//:protoc"], ) staleness_test( diff --git a/php/BUILD.bazel b/php/BUILD.bazel index 966b3e2c5e..345d1ab9b1 100644 --- a/php/BUILD.bazel +++ b/php/BUILD.bazel @@ -2,7 +2,7 @@ # # See also code generation logic under /src/google/protobuf/compiler/php. -load("@rules_pkg//:mappings.bzl", "pkg_files", "pkg_filegroup", "strip_prefix") +load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("//upb/cmake:build_defs.bzl", "staleness_test") load("//build_defs:internal_shell.bzl", "inline_sh_binary") @@ -11,10 +11,6 @@ load("//:protobuf_version.bzl", "PROTOBUF_PHP_VERSION", "PROTOC_VERSION") filegroup( name = "source_files", - visibility = [ - "//conformance:__pkg__", - "//php:__pkg__", - ], srcs = glob([ "src/GPBMetadata/Google/Protobuf/**/*.php", "src/Google/Protobuf/**/*.php", @@ -22,6 +18,10 @@ filegroup( "composer.json", ":php_ext_source_files", ], + visibility = [ + "//conformance:__pkg__", + "//php:__pkg__", + ], ) ################################################################################ @@ -48,12 +48,12 @@ genrule( ":source_files", "@utf8_range//:utf8_range_srcs", ], - tools = [":build_extension"], outs = ["protobuf.so"], cmd = """ ./$(execpath :build_extension) $@ cp php/ext/google/protobuf/modules/protobuf.so $(OUTS) """, + tools = [":build_extension"], visibility = ["//visibility:public"], ) @@ -64,23 +64,23 @@ genrule( conformance_test( name = "conformance_test", failure_list = "//conformance:failure_list_php.txt", - testee = "//conformance:conformance_php", - text_format_failure_list = "//conformance:text_format_failure_list_php.txt", target_compatible_with = select({ "@platforms//os:osx": ["@platforms//:incompatible"], "//conditions:default": [], }), + testee = "//conformance:conformance_php", + text_format_failure_list = "//conformance:text_format_failure_list_php.txt", ) conformance_test( name = "conformance_test_c", failure_list = "//conformance:failure_list_php_c.txt", - testee = "//conformance:conformance_php_c", - text_format_failure_list = "//conformance:text_format_failure_list_php.txt", target_compatible_with = select({ "@platforms//os:osx": [], "//conditions:default": ["@platforms//:incompatible"], }), + testee = "//conformance:conformance_php_c", + text_format_failure_list = "//conformance:text_format_failure_list_php.txt", ) genrule( @@ -100,8 +100,8 @@ genrule( staleness_test( name = "test_amalgamation_staleness", outs = [ - "ext/google/protobuf/php-upb.h", "ext/google/protobuf/php-upb.c", + "ext/google/protobuf/php-upb.h", ], generated_pattern = "generated-in/%s", tags = ["manual"], @@ -121,7 +121,6 @@ pkg_files( "tests/proto/**/*.proto", "tests/proto_previous/*.proto", ]) + [ - ":source_files", "BUILD.bazel", "README.md", "REFCOUNTING.md", @@ -131,6 +130,7 @@ pkg_files( "release.sh", "src/phpdoc.dist.xml", "tests/valgrind.supp", + ":source_files", ], prefix = "php", strip_prefix = strip_prefix.from_pkg(""), @@ -142,71 +142,71 @@ pkg_files( ################################################################################ pkg_files( - name = "php_ext_source_files", - srcs = glob([ - "ext/google/protobuf/*.h", - "ext/google/protobuf/*.c", - ]) + [ - "//:LICENSE", - "ext/google/protobuf/config.m4", - "ext/google/protobuf/config.w32", - "ext/google/protobuf/wkt.inc", - ], + name = "php_ext_source_files", + srcs = glob([ + "ext/google/protobuf/*.h", + "ext/google/protobuf/*.c", + ]) + [ + "ext/google/protobuf/config.m4", + "ext/google/protobuf/config.w32", + "ext/google/protobuf/wkt.inc", + "//:LICENSE", + ], ) pkg_files( - name = "utf8_range_files", - srcs = [ - "@utf8_range//:utf8_range_srcs", - "@utf8_range//:LICENSE", - ], - prefix = "third_party/utf8_range", + name = "utf8_range_files", + srcs = [ + "@utf8_range//:LICENSE", + "@utf8_range//:utf8_range_srcs", + ], + prefix = "third_party/utf8_range", ) pkg_filegroup( - name = "pecl_release_files", - srcs = [ - ":php_ext_source_files", - ":utf8_range_files", - ], - prefix = "protobuf-%s" % PROTOBUF_PHP_VERSION, + name = "pecl_release_files", + srcs = [ + ":php_ext_source_files", + ":utf8_range_files", + ], + prefix = "protobuf-%s" % PROTOBUF_PHP_VERSION, ) # PECL .tgz without package.xml pkg_tar( - name = "release_without_package", - extension = "tgz", - srcs = [ - ":pecl_release_files", - ], - out = "release_without_package.tgz", + name = "release_without_package", + srcs = [ + ":pecl_release_files", + ], + out = "release_without_package.tgz", + extension = "tgz", ) # Generate PECL package.xml genrule( name = "generate_package_xml", srcs = [ - ":release_without_package", - "ext/google/protobuf/template_package.xml", + ":release_without_package", + "ext/google/protobuf/template_package.xml", ], outs = ["package.xml"], cmd = " ".join([ - "$(location ext/google/protobuf/generate_package_xml.sh)", - "$(location ext/google/protobuf/template_package.xml)", - PROTOBUF_PHP_VERSION, - PROTOC_VERSION, - "$$(tar -tf $(location :release_without_package) | sed -z -e 's;\\n;,;g')", - "$(location package.xml)" + "$(location ext/google/protobuf/generate_package_xml.sh)", + "$(location ext/google/protobuf/template_package.xml)", + PROTOBUF_PHP_VERSION, + PROTOC_VERSION, + "$$(tar -tf $(location :release_without_package) | sed -z -e 's;\\n;,;g')", + "$(location package.xml)", ]), tools = ["ext/google/protobuf/generate_package_xml.sh"], ) pkg_tar( - name = "release", - extension = "tgz", - srcs = [ - ":pecl_release_files", - ":generate_package_xml", - ], - out = "protobuf-%s.tgz" % PROTOBUF_PHP_VERSION, + name = "release", + srcs = [ + ":generate_package_xml", + ":pecl_release_files", + ], + out = "protobuf-%s.tgz" % PROTOBUF_PHP_VERSION, + extension = "tgz", ) diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index 936edad57f..1d24e44ee9 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -234,10 +234,10 @@ cc_dist_library( ], tags = ["manual"], deps = [ + "//src/google/protobuf:internal_visibility_for_testing", "//src/google/protobuf:test_textproto", "//src/google/protobuf/compiler:command_line_interface_tester", "//src/google/protobuf/compiler:mock_code_generator", "//src/google/protobuf/testing", - "//src/google/protobuf:internal_visibility_for_testing", ], ) diff --git a/upb/protos/BUILD b/protos/BUILD similarity index 91% rename from upb/protos/BUILD rename to protos/BUILD index 67029e443f..648d9388f6 100644 --- a/upb/protos/BUILD +++ b/protos/BUILD @@ -6,11 +6,11 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) load( - "//upb/protos/bazel:upb_cc_proto_library.bzl", + "//protos/bazel:upb_cc_proto_library.bzl", "upb_cc_proto_library_copts", ) @@ -133,10 +133,10 @@ cc_test( copts = UPB_DEFAULT_CPPOPTS, deps = [ ":protos_internal", - "//upb:mem", - "//upb/protos_generator/tests:test_model_upb_cc_proto", - "//upb/protos_generator/tests:test_model_upb_proto", "@com_google_googletest//:gtest_main", + "//upb:mem", + "//protos_generator/tests:test_model_upb_cc_proto", + "//protos_generator/tests:test_model_upb_proto", ], ) @@ -159,12 +159,12 @@ cc_test( name = "protos_extension_lock_test", srcs = ["protos_extension_lock_test.cc"], deps = [ + "@com_google_googletest//:gtest_main", "//upb:mem", - "//upb/protos", - "//upb/protos:protos_extension_lock", - "//upb/protos_generator/tests:test_model_upb_cc_proto", + "//protos", + "//protos:protos_extension_lock", + "//protos_generator/tests:test_model_upb_cc_proto", "@com_google_absl//absl/hash", "@com_google_absl//absl/log:absl_check", - "@com_google_googletest//:gtest_main", ], ) diff --git a/protos/README.md b/protos/README.md new file mode 100644 index 0000000000..dc0920163c --- /dev/null +++ b/protos/README.md @@ -0,0 +1,7 @@ +`protos` C++ API +=============== + +`protos` is a C++ protobuf implementation backed by μpb, introduced in 2022. +The API is currently experimental and may undergo incompatible changes without +notice. The supported C++ implementation is +[here](https://github.com/protocolbuffers/protobuf/tree/main/src). diff --git a/upb/protos/bazel/BUILD b/protos/bazel/BUILD similarity index 93% rename from upb/protos/bazel/BUILD rename to protos/bazel/BUILD index 83e2840584..ea91541adf 100644 --- a/upb/protos/bazel/BUILD +++ b/protos/bazel/BUILD @@ -18,8 +18,8 @@ bzl_library( srcs = ["upb_cc_proto_library.bzl"], visibility = ["//visibility:public"], deps = [ - "//upb/bazel:upb_proto_library_bzl", "@bazel_skylib//lib:paths", + "//bazel:upb_proto_library_bzl", "@bazel_tools//tools/cpp:toolchain_utils.bzl", ], ) diff --git a/upb/protos/bazel/upb_cc_proto_library.bzl b/protos/bazel/upb_cc_proto_library.bzl similarity index 94% rename from upb/protos/bazel/upb_cc_proto_library.bzl rename to protos/bazel/upb_cc_proto_library.bzl index 859a0d8397..b59ae65e57 100644 --- a/upb/protos/bazel/upb_cc_proto_library.bzl +++ b/protos/bazel/upb_cc_proto_library.bzl @@ -10,7 +10,7 @@ """ load("@bazel_skylib//lib:paths.bzl", "paths") -load("//upb/bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") +load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") # begin:google_only # load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") @@ -229,12 +229,12 @@ def _upb_cc_proto_library_aspect_impl(target, ctx): _upb_cc_proto_library_aspect = aspect( attrs = { "_ccopts": attr.label( - default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", + default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", ), "_gen_upbprotos": attr.label( executable = True, cfg = "exec", - default = "//upb/protos_generator:protoc-gen-upb-protos", + default = "//protos_generator:protoc-gen-upb-protos", ), "_protoc": attr.label( executable = True, @@ -248,11 +248,11 @@ _upb_cc_proto_library_aspect = aspect( default = [ # TODO: Add dependencies for cc runtime (absl/string etc..) "//upb:generated_cpp_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", + "//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/status:statusor", - "//upb/protos", - "//upb/protos:repeated_field", + "//protos", + "//protos:repeated_field", ], ), }, @@ -283,7 +283,7 @@ upb_cc_proto_library = rule( providers = [ProtoInfo], ), "_ccopts": attr.label( - default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", + default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", ), }, ) diff --git a/upb/protos/protos.cc b/protos/protos.cc similarity index 94% rename from upb/protos/protos.cc rename to protos/protos.cc index 85929eaaeb..29b9fbe254 100644 --- a/upb/protos/protos.cc +++ b/protos/protos.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos/protos.h" +#include "protos/protos.h" #include #include @@ -37,17 +37,17 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" -#include "upb/protos/protos_extension_lock.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/copy.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/message/promote.h" -#include "upb/upb/message/types.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/extension_registry.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/wire/decode.h" -#include "upb/upb/wire/encode.h" +#include "protos/protos_extension_lock.h" +#include "upb/mem/arena.h" +#include "upb/message/copy.h" +#include "upb/message/internal/extension.h" +#include "upb/message/promote.h" +#include "upb/message/types.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/extension_registry.h" +#include "upb/mini_table/message.h" +#include "upb/wire/decode.h" +#include "upb/wire/encode.h" namespace protos { diff --git a/upb/protos/protos.h b/protos/protos.h similarity index 98% rename from upb/protos/protos.h rename to protos/protos.h index 151c3d72a0..195d793540 100644 --- a/upb/protos/protos.h +++ b/protos/protos.h @@ -36,13 +36,13 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "upb/upb/base/status.hpp" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/message/copy.h" -#include "upb/upb/message/internal/accessors.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/wire/decode.h" -#include "upb/upb/wire/encode.h" +#include "upb/base/status.hpp" +#include "upb/mem/arena.hpp" +#include "upb/message/copy.h" +#include "upb/message/internal/accessors.h" +#include "upb/message/internal/extension.h" +#include "upb/wire/decode.h" +#include "upb/wire/encode.h" namespace protos { diff --git a/upb/protos/protos_extension_lock.cc b/protos/protos_extension_lock.cc similarity index 97% rename from upb/protos/protos_extension_lock.cc rename to protos/protos_extension_lock.cc index bb0dc973f1..dbb2fc2ed2 100644 --- a/upb/protos/protos_extension_lock.cc +++ b/protos/protos_extension_lock.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos/protos_extension_lock.h" +#include "protos/protos_extension_lock.h" #include diff --git a/upb/protos/protos_extension_lock.h b/protos/protos_extension_lock.h similarity index 100% rename from upb/protos/protos_extension_lock.h rename to protos/protos_extension_lock.h diff --git a/upb/protos/protos_extension_lock_test.cc b/protos/protos_extension_lock_test.cc similarity index 96% rename from upb/protos/protos_extension_lock_test.cc rename to protos/protos_extension_lock_test.cc index 0d591b7727..a0ce399cc1 100644 --- a/upb/protos/protos_extension_lock_test.cc +++ b/protos/protos_extension_lock_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos/protos_extension_lock.h" +#include "protos/protos_extension_lock.h" #include #include @@ -39,9 +39,9 @@ #include #include "absl/hash/hash.h" #include "absl/log/absl_check.h" -#include "upb/protos/protos.h" -#include "upb/protos_generator/tests/test_model.upb.proto.h" -#include "upb/upb/mem/arena.hpp" +#include "protos/protos.h" +#include "protos_generator/tests/test_model.upb.proto.h" +#include "upb/mem/arena.hpp" #ifndef ASSERT_OK #define ASSERT_OK(x) ASSERT_TRUE(x.ok()) diff --git a/upb/protos/protos_internal.h b/protos/protos_internal.h similarity index 96% rename from upb/protos/protos_internal.h rename to protos/protos_internal.h index c707ae5229..0a1f194d3a 100644 --- a/upb/protos/protos_internal.h +++ b/protos/protos_internal.h @@ -31,8 +31,8 @@ #ifndef UPB_PROTOS_PROTOS_INTERNAL_H_ #define UPB_PROTOS_PROTOS_INTERNAL_H_ -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/message.h" +#include "upb/mem/arena.h" +#include "upb/message/message.h" namespace protos::internal { diff --git a/upb/protos/protos_internal_test.cc b/protos/protos_internal_test.cc similarity index 92% rename from upb/protos/protos_internal_test.cc rename to protos/protos_internal_test.cc index ac65963203..a173665acc 100644 --- a/upb/protos/protos_internal_test.cc +++ b/protos/protos_internal_test.cc @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos/protos_internal.h" +#include "protos/protos_internal.h" #include #include -#include "upb/protos_generator/tests/test_model.upb.h" -#include "upb/protos_generator/tests/test_model.upb.proto.h" -#include "upb/upb/mem/arena.h" +#include "protos_generator/tests/test_model.upb.h" +#include "protos_generator/tests/test_model.upb.proto.h" +#include "upb/mem/arena.h" namespace protos::testing { namespace { diff --git a/upb/protos/protos_traits.h b/protos/protos_traits.h similarity index 100% rename from upb/protos/protos_traits.h rename to protos/protos_traits.h diff --git a/upb/protos/repeated_field.h b/protos/repeated_field.h similarity index 97% rename from upb/protos/repeated_field.h rename to protos/repeated_field.h index f568f76b28..6edcfb5381 100644 --- a/upb/protos/repeated_field.h +++ b/protos/repeated_field.h @@ -36,17 +36,17 @@ #include #include "absl/strings/string_view.h" -#include "upb/protos/protos.h" -#include "upb/protos/protos_traits.h" -#include "upb/protos/repeated_field_iterator.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/copy.h" -#include "upb/upb/message/types.h" +#include "protos/protos.h" +#include "protos/protos_traits.h" +#include "protos/repeated_field_iterator.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/mem/arena.h" +#include "upb/message/copy.h" +#include "upb/message/types.h" // Must be last: -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace protos { @@ -320,6 +320,6 @@ class RepeatedField { } // namespace protos -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_PROTOS_REPEATED_FIELD_H_ diff --git a/upb/protos/repeated_field_iterator.h b/protos/repeated_field_iterator.h similarity index 98% rename from upb/protos/repeated_field_iterator.h rename to protos/repeated_field_iterator.h index 7593cde3c7..a552d76be1 100644 --- a/upb/protos/repeated_field_iterator.h +++ b/protos/repeated_field_iterator.h @@ -36,15 +36,15 @@ #include #include "absl/strings/string_view.h" -#include "upb/protos/protos.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/copy.h" +#include "protos/protos.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/mem/arena.h" +#include "upb/message/copy.h" // Must be last: -#include "upb/upb/message/types.h" -#include "upb/upb/port/def.inc" +#include "upb/message/types.h" +#include "upb/port/def.inc" namespace protos { namespace internal { diff --git a/upb/protos/repeated_field_iterator_test.cc b/protos/repeated_field_iterator_test.cc similarity index 99% rename from upb/protos/repeated_field_iterator_test.cc rename to protos/repeated_field_iterator_test.cc index a8db041600..a8de90017c 100644 --- a/upb/protos/repeated_field_iterator_test.cc +++ b/protos/repeated_field_iterator_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos/repeated_field_iterator.h" +#include "protos/repeated_field_iterator.h" #include #include diff --git a/upb/protos_generator/BUILD b/protos_generator/BUILD similarity index 90% rename from upb/protos_generator/BUILD rename to protos_generator/BUILD index 3473450fc2..fae587a624 100644 --- a/upb/protos_generator/BUILD +++ b/protos_generator/BUILD @@ -6,7 +6,7 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) @@ -30,7 +30,7 @@ cc_binary( ":output", "//:protobuf", "//src/google/protobuf/compiler:code_generator", - "//upb/upbc:file_layout", + "//upbc:file_layout", ], ) @@ -56,12 +56,12 @@ cc_library( ":names", ":output", "//:protobuf", - "//upb/upbc:common", - "//upb/upbc:file_layout", - "//upb/upbc:keywords", - "//upb/upbc:names", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/strings", + "//upbc:common", + "//upbc:file_layout", + "//upbc:keywords", + "//upbc:names", ], ) @@ -96,6 +96,6 @@ cc_library( visibility = ["//visibility:private"], deps = [ ":output", - "//upb/upbc:keywords", + "//upbc:keywords", ], ) diff --git a/protos_generator/README.md b/protos_generator/README.md new file mode 100644 index 0000000000..05b64c060a --- /dev/null +++ b/protos_generator/README.md @@ -0,0 +1,8 @@ +`protos` Generator +================== + +This directory contains the generator for the [`protos` +API](https://github.com/protocolbuffers/protobuf/tree/main/protos), an +experimental C++ protobuf implementation. Most users should use the standard +C++ implementation +[here](https://github.com/protocolbuffers/protobuf/tree/main/src). diff --git a/upb/protos_generator/gen_accessors.cc b/protos_generator/gen_accessors.cc similarity index 98% rename from upb/protos_generator/gen_accessors.cc rename to protos_generator/gen_accessors.cc index 1d2397985c..410a42b15b 100644 --- a/upb/protos_generator/gen_accessors.cc +++ b/protos_generator/gen_accessors.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/gen_accessors.h" +#include "protos_generator/gen_accessors.h" #include @@ -37,13 +37,13 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/gen_repeated_fields.h" -#include "upb/protos_generator/gen_utils.h" -#include "upb/protos_generator/names.h" -#include "upb/protos_generator/output.h" -#include "upb/upbc/common.h" -#include "upb/upbc/keywords.h" -#include "upb/upbc/names.h" +#include "protos_generator/gen_repeated_fields.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/names.h" +#include "protos_generator/output.h" +#include "upbc/common.h" +#include "upbc/keywords.h" +#include "upbc/names.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_accessors.h b/protos_generator/gen_accessors.h similarity index 96% rename from upb/protos_generator/gen_accessors.h rename to protos_generator/gen_accessors.h index 23e098f04b..8372fc3486 100644 --- a/upb/protos_generator/gen_accessors.h +++ b/protos_generator/gen_accessors.h @@ -32,8 +32,8 @@ #define UPB_PROTOS_GENERATOR_ACCESSORS_H_ #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/gen_utils.h" -#include "upb/protos_generator/output.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_enums.cc b/protos_generator/gen_enums.cc similarity index 97% rename from upb/protos_generator/gen_enums.cc rename to protos_generator/gen_enums.cc index ceea05c7df..7c535a7e3d 100644 --- a/upb/protos_generator/gen_enums.cc +++ b/protos_generator/gen_enums.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/gen_enums.h" +#include "protos_generator/gen_enums.h" #include #include @@ -37,8 +37,8 @@ #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/gen_utils.h" -#include "upb/protos_generator/names.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/names.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_enums.h b/protos_generator/gen_enums.h similarity index 98% rename from upb/protos_generator/gen_enums.h rename to protos_generator/gen_enums.h index fa7cccd18f..607876225a 100644 --- a/upb/protos_generator/gen_enums.h +++ b/protos_generator/gen_enums.h @@ -32,7 +32,7 @@ #define UPB_PROTOS_GENERATOR_ENUMS_H_ #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/output.h" +#include "protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_extensions.cc b/protos_generator/gen_extensions.cc similarity index 96% rename from upb/protos_generator/gen_extensions.cc rename to protos_generator/gen_extensions.cc index ae4030c41f..be0cbc5210 100644 --- a/upb/protos_generator/gen_extensions.cc +++ b/protos_generator/gen_extensions.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/gen_extensions.h" +#include "protos_generator/gen_extensions.h" #include "absl/strings/str_cat.h" -#include "upb/protos_generator/gen_utils.h" -#include "upb/protos_generator/names.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/names.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_extensions.h b/protos_generator/gen_extensions.h similarity index 98% rename from upb/protos_generator/gen_extensions.h rename to protos_generator/gen_extensions.h index 85d1a9a31e..8ec740aadb 100644 --- a/upb/protos_generator/gen_extensions.h +++ b/protos_generator/gen_extensions.h @@ -32,7 +32,7 @@ #define UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_ #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/output.h" +#include "protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_messages.cc b/protos_generator/gen_messages.cc similarity index 98% rename from upb/protos_generator/gen_messages.cc rename to protos_generator/gen_messages.cc index 716562c343..ca75ba70dd 100644 --- a/upb/protos_generator/gen_messages.cc +++ b/protos_generator/gen_messages.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/gen_messages.h" +#include "protos_generator/gen_messages.h" #include #include @@ -36,14 +36,14 @@ #include "google/protobuf/descriptor.pb.h" #include "absl/strings/str_cat.h" #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/gen_accessors.h" -#include "upb/protos_generator/gen_enums.h" -#include "upb/protos_generator/gen_extensions.h" -#include "upb/protos_generator/gen_utils.h" -#include "upb/protos_generator/names.h" -#include "upb/protos_generator/output.h" -#include "upb/upbc/common.h" -#include "upb/upbc/file_layout.h" +#include "protos_generator/gen_accessors.h" +#include "protos_generator/gen_enums.h" +#include "protos_generator/gen_extensions.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/names.h" +#include "protos_generator/output.h" +#include "upbc/common.h" +#include "upbc/file_layout.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_messages.h b/protos_generator/gen_messages.h similarity index 98% rename from upb/protos_generator/gen_messages.h rename to protos_generator/gen_messages.h index 97813cf956..323696449e 100644 --- a/upb/protos_generator/gen_messages.h +++ b/protos_generator/gen_messages.h @@ -32,7 +32,7 @@ #define UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_ #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/output.h" +#include "protos_generator/output.h" namespace protos_generator { namespace protobuf = ::google::protobuf; diff --git a/upb/protos_generator/gen_repeated_fields.cc b/protos_generator/gen_repeated_fields.cc similarity index 96% rename from upb/protos_generator/gen_repeated_fields.cc rename to protos_generator/gen_repeated_fields.cc index 3c962ac46d..d5b4bab650 100644 --- a/upb/protos_generator/gen_repeated_fields.cc +++ b/protos_generator/gen_repeated_fields.cc @@ -27,7 +27,7 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/gen_repeated_fields.h" +#include "protos_generator/gen_repeated_fields.h" #include #include @@ -35,15 +35,15 @@ #include "google/protobuf/descriptor.pb.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/gen_accessors.h" -#include "upb/protos_generator/gen_enums.h" -#include "upb/protos_generator/gen_extensions.h" -#include "upb/protos_generator/gen_utils.h" -#include "upb/protos_generator/names.h" -#include "upb/protos_generator/output.h" -#include "upb/upbc/common.h" -#include "upb/upbc/file_layout.h" -#include "upb/upbc/names.h" +#include "protos_generator/gen_accessors.h" +#include "protos_generator/gen_enums.h" +#include "protos_generator/gen_extensions.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/names.h" +#include "protos_generator/output.h" +#include "upbc/common.h" +#include "upbc/file_layout.h" +#include "upbc/names.h" namespace protos_generator { namespace protobuf = ::google::protobuf; diff --git a/upb/protos_generator/gen_repeated_fields.h b/protos_generator/gen_repeated_fields.h similarity index 98% rename from upb/protos_generator/gen_repeated_fields.h rename to protos_generator/gen_repeated_fields.h index 5902a5ded4..1650eb0c06 100644 --- a/upb/protos_generator/gen_repeated_fields.h +++ b/protos_generator/gen_repeated_fields.h @@ -33,7 +33,7 @@ #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/output.h" +#include "protos_generator/output.h" namespace protos_generator { namespace protobuf = ::google::protobuf; diff --git a/upb/protos_generator/gen_utils.cc b/protos_generator/gen_utils.cc similarity index 99% rename from upb/protos_generator/gen_utils.cc rename to protos_generator/gen_utils.cc index 7c59d7f3a7..79dd5a188d 100644 --- a/upb/protos_generator/gen_utils.cc +++ b/protos_generator/gen_utils.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/gen_utils.h" +#include "protos_generator/gen_utils.h" #include #include diff --git a/upb/protos_generator/gen_utils.h b/protos_generator/gen_utils.h similarity index 100% rename from upb/protos_generator/gen_utils.h rename to protos_generator/gen_utils.h diff --git a/upb/protos_generator/names.cc b/protos_generator/names.cc similarity index 99% rename from upb/protos_generator/names.cc rename to protos_generator/names.cc index c1c3d8e97a..eb3fbee431 100644 --- a/upb/protos_generator/names.cc +++ b/protos_generator/names.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/names.h" +#include "protos_generator/names.h" #include -#include "upb/upbc/keywords.h" +#include "upbc/keywords.h" namespace protos_generator { diff --git a/upb/protos_generator/names.h b/protos_generator/names.h similarity index 98% rename from upb/protos_generator/names.h rename to protos_generator/names.h index 4578703402..efa01ce067 100644 --- a/upb/protos_generator/names.h +++ b/protos_generator/names.h @@ -34,7 +34,7 @@ #include #include "google/protobuf/descriptor.pb.h" -#include "upb/protos_generator/output.h" +#include "protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/output.cc b/protos_generator/output.cc similarity index 98% rename from upb/protos_generator/output.cc rename to protos_generator/output.cc index 67a33b3a21..72cd4e56d8 100644 --- a/upb/protos_generator/output.cc +++ b/protos_generator/output.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/protos_generator/output.h" +#include "protos_generator/output.h" #include diff --git a/upb/protos_generator/output.h b/protos_generator/output.h similarity index 100% rename from upb/protos_generator/output.h rename to protos_generator/output.h diff --git a/upb/protos_generator/protoc-gen-upb-protos.cc b/protos_generator/protoc-gen-upb-protos.cc similarity index 93% rename from upb/protos_generator/protoc-gen-upb-protos.cc rename to protos_generator/protoc-gen-upb-protos.cc index 7907ed5fff..58c37121f8 100644 --- a/upb/protos_generator/protoc-gen-upb-protos.cc +++ b/protos_generator/protoc-gen-upb-protos.cc @@ -34,13 +34,13 @@ #include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/compiler/plugin.h" #include "google/protobuf/descriptor.h" -#include "upb/protos_generator/gen_enums.h" -#include "upb/protos_generator/gen_extensions.h" -#include "upb/protos_generator/gen_messages.h" -#include "upb/protos_generator/gen_utils.h" -#include "upb/protos_generator/names.h" -#include "upb/protos_generator/output.h" -#include "upb/upbc/file_layout.h" +#include "protos_generator/gen_enums.h" +#include "protos_generator/gen_extensions.h" +#include "protos_generator/gen_messages.h" +#include "protos_generator/gen_utils.h" +#include "protos_generator/names.h" +#include "protos_generator/output.h" +#include "upbc/file_layout.h" namespace protos_generator { namespace { @@ -138,9 +138,9 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) { #ifndef $0_UPB_PROTO_H_ #define $0_UPB_PROTO_H_ -#include "upb/protos/protos.h" -#include "upb/protos/protos_internal.h" -#include "upb/protos/repeated_field.h" +#include "protos/protos.h" +#include "protos/protos_internal.h" +#include "protos/repeated_field.h" #include "absl/strings/string_view.h" #include "absl/status/statusor.h" @@ -158,7 +158,7 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) { } } - output("#include \"upb/upb/port/def.inc\"\n"); + output("#include \"upb/port/def.inc\"\n"); const std::vector this_file_messages = SortedMessages(file); @@ -190,7 +190,7 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) { WriteEndNamespace(file, output); - output("\n#include \"upb/upb/port/undef.inc\"\n\n"); + output("\n#include \"upb/port/undef.inc\"\n\n"); // End of "C" section. output("#endif /* $0_UPB_PROTO_H_ */\n", ToPreproc(file->name())); @@ -205,7 +205,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output, R"cc( #include #include "absl/strings/string_view.h" -#include "upb/protos/protos.h" +#include "protos/protos.h" #include "$0" )cc", CppHeaderFilename(file)); @@ -213,7 +213,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output, for (int i = 0; i < file->dependency_count(); i++) { output("#include \"$0\"\n", CppHeaderFilename(file->dependency(i))); } - output("#include \"upb/upb/port/def.inc\"\n"); + output("#include \"upb/port/def.inc\"\n"); WriteStartNamespace(file, output); WriteMessageImplementations(file, output); @@ -222,7 +222,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output, WriteExtensionIdentifiers(this_file_exts, output); WriteEndNamespace(file, output); - output("#include \"upb/upb/port/undef.inc\"\n\n"); + output("#include \"upb/port/undef.inc\"\n\n"); } void WriteMessageImplementations(const protobuf::FileDescriptor* file, diff --git a/upb/protos_generator/tests/BUILD b/protos_generator/tests/BUILD similarity index 91% rename from upb/protos_generator/tests/BUILD rename to protos_generator/tests/BUILD index dfc80b41c5..e5c203f229 100644 --- a/upb/protos_generator/tests/BUILD +++ b/protos_generator/tests/BUILD @@ -6,15 +6,15 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", ) load( - "//upb/protos/bazel:upb_cc_proto_library.bzl", + "//protos/bazel:upb_cc_proto_library.bzl", "upb_cc_proto_library", ) load( @@ -63,14 +63,14 @@ proto_library( upb_proto_library( name = "test_model_upb_proto", visibility = [ - "//upb/protos:__pkg__", + "//protos:__pkg__", ], deps = [":test_model_proto"], ) upb_cc_proto_library( name = "test_model_upb_cc_proto", - visibility = ["//upb/protos:__pkg__"], + visibility = ["//protos:__pkg__"], deps = [":test_model_proto"], ) @@ -133,8 +133,8 @@ cc_test( "@com_google_googletest//:gtest_main", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "//upb/protos", + "//protos", "//upb:mem", - "//upb/protos:repeated_field", + "//protos:repeated_field", ], ) diff --git a/upb/protos_generator/tests/child_model.proto b/protos_generator/tests/child_model.proto similarity index 97% rename from upb/protos_generator/tests/child_model.proto rename to protos_generator/tests/child_model.proto index 79589cc71e..c7af6f13e3 100644 --- a/upb/protos_generator/tests/child_model.proto +++ b/protos_generator/tests/child_model.proto @@ -32,7 +32,7 @@ syntax = "proto3"; package protos_generator.test; -import public "upb/protos_generator/tests/test_enum.proto"; +import public "protos_generator/tests/test_enum.proto"; message ChildModel1 { optional bool child_b1 = 44; diff --git a/upb/protos_generator/tests/legacy-name.proto b/protos_generator/tests/legacy-name.proto similarity index 100% rename from upb/protos_generator/tests/legacy-name.proto rename to protos_generator/tests/legacy-name.proto diff --git a/upb/protos_generator/tests/naming_conflict.proto b/protos_generator/tests/naming_conflict.proto similarity index 100% rename from upb/protos_generator/tests/naming_conflict.proto rename to protos_generator/tests/naming_conflict.proto diff --git a/upb/protos_generator/tests/no_package.proto b/protos_generator/tests/no_package.proto similarity index 100% rename from upb/protos_generator/tests/no_package.proto rename to protos_generator/tests/no_package.proto diff --git a/upb/protos_generator/tests/no_package_enum_user.proto b/protos_generator/tests/no_package_enum_user.proto similarity index 97% rename from upb/protos_generator/tests/no_package_enum_user.proto rename to protos_generator/tests/no_package_enum_user.proto index e34c7fe2db..ebf8c67ad8 100644 --- a/upb/protos_generator/tests/no_package_enum_user.proto +++ b/protos_generator/tests/no_package_enum_user.proto @@ -32,7 +32,7 @@ syntax = "proto2"; package protos_generator.tests; -import "upb/protos_generator/tests/no_package.proto"; +import "protos_generator/tests/no_package.proto"; // option java_multiple_files = true; diff --git a/upb/protos_generator/tests/test_enum.proto b/protos_generator/tests/test_enum.proto similarity index 100% rename from upb/protos_generator/tests/test_enum.proto rename to protos_generator/tests/test_enum.proto diff --git a/upb/protos_generator/tests/test_extension.proto b/protos_generator/tests/test_extension.proto similarity index 97% rename from upb/protos_generator/tests/test_extension.proto rename to protos_generator/tests/test_extension.proto index 17f713125e..3a1a3c67b9 100644 --- a/upb/protos_generator/tests/test_extension.proto +++ b/protos_generator/tests/test_extension.proto @@ -32,7 +32,7 @@ syntax = "proto2"; package protos_generator.test.someotherpackage; -import "upb/protos_generator/tests/test_model.proto"; +import "protos_generator/tests/test_model.proto"; // Define extension that is extending proto outside this package with a type // defined in different file. diff --git a/upb/protos_generator/tests/test_generated.cc b/protos_generator/tests/test_generated.cc similarity index 99% rename from upb/protos_generator/tests/test_generated.cc rename to protos_generator/tests/test_generated.cc index 4d0cf80e74..1206b6a998 100644 --- a/upb/protos_generator/tests/test_generated.cc +++ b/protos_generator/tests/test_generated.cc @@ -38,13 +38,13 @@ #include #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "upb/protos/protos.h" -#include "upb/protos/repeated_field.h" -#include "upb/protos/repeated_field_iterator.h" -#include "upb/protos_generator/tests/child_model.upb.proto.h" -#include "upb/protos_generator/tests/no_package.upb.proto.h" -#include "upb/protos_generator/tests/test_model.upb.proto.h" -#include "upb/upb/mem/arena.h" +#include "protos/protos.h" +#include "protos/repeated_field.h" +#include "protos/repeated_field_iterator.h" +#include "protos_generator/tests/child_model.upb.proto.h" +#include "protos_generator/tests/no_package.upb.proto.h" +#include "protos_generator/tests/test_model.upb.proto.h" +#include "upb/mem/arena.h" namespace { diff --git a/upb/protos_generator/tests/test_model.proto b/protos_generator/tests/test_model.proto similarity index 99% rename from upb/protos_generator/tests/test_model.proto rename to protos_generator/tests/test_model.proto index 89372f54f4..e133624215 100644 --- a/upb/protos_generator/tests/test_model.proto +++ b/protos_generator/tests/test_model.proto @@ -32,7 +32,7 @@ syntax = "proto2"; package protos_generator.test; -import "upb/protos_generator/tests/child_model.proto"; +import "protos_generator/tests/child_model.proto"; message TestModelContainer { repeated TestModel models = 1; diff --git a/upb/python/BUILD b/python/BUILD similarity index 93% rename from upb/python/BUILD rename to python/BUILD index 8987b0d290..c1e044c013 100644 --- a/upb/python/BUILD +++ b/python/BUILD @@ -5,13 +5,15 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/python:py_extension.bzl", "py_extension") +load("//python:py_extension.bzl", "py_extension") load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") # begin:github_only load("@rules_pkg//:mappings.bzl", "pkg_files") +load("//python:build_targets.bzl", "build_targets") +build_targets(name = "python") # end:github_only licenses(["notice"]) @@ -20,7 +22,7 @@ package( # begin:google_only # default_applicable_licenses = ["//upb:license"], # end:google_only - default_visibility = ["//upb/python/dist:__pkg__"], + default_visibility = ["//python/dist:__pkg__"], ) LIMITED_API_FLAG_SELECT = { @@ -224,8 +226,8 @@ py_extension( "//upb:text", "//upb:wire_reader", "//upb:wire_types", - "//upb/upb/util:compare", - "//upb/upb/util:def_to_proto", - "//upb/upb/util:required_fields", + "//upb/util:compare", + "//upb/util:def_to_proto", + "//upb/util:required_fields", ], ) diff --git a/python/BUILD.bazel b/python/BUILD.bazel deleted file mode 100644 index b42d0b25d5..0000000000 --- a/python/BUILD.bazel +++ /dev/null @@ -1,6 +0,0 @@ -load("//python:build_targets.bzl", "build_targets") - -# The build targets for this package have been temporarily moved into a Bazel -# macro to facilitate merging upb's Python support into this directory. Once -# that merge is complete, we will move the build targets back here. -build_targets(name = "python") diff --git a/python/README.md b/python/README.md index baa58c2c99..ab39350254 100644 --- a/python/README.md +++ b/python/README.md @@ -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: ``` -$ bazel build //upb/python/dist:source_wheel -$ bazel build //upb/python/dist:binary_wheel +$ bazel build //python/dist:source_wheel +$ bazel build //python/dist:binary_wheel ``` The binary wheel will build against whatever version of Python is installed on @@ -43,13 +43,12 @@ you can request a specific backend by setting the following values: 1. **upb**: Built on the - [upb C library](https://github.com/protocolbuffers/upb), this is a new - extension module + [upb C library](https://github.com/protocolbuffers/protobuf/tree/main/upb), + this is a new extension module [released in 4.21.0](https://protobuf.dev/news/2022-05-06/). It offers 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 - installation. The code for this module lives in - [upb/python](https://github.com/protocolbuffers/protobuf/tree/main/upb/python). + installation. The code for this module lives in this directory. 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 still used in some legacy cases where apps want to perform zero-copy message diff --git a/python/build_targets.bzl b/python/build_targets.bzl index 546ef0129f..026292c5d5 100644 --- a/python/build_targets.bzl +++ b/python/build_targets.bzl @@ -444,7 +444,7 @@ def build_targets(name): "tox.ini", ], strip_prefix = "", - visibility = ["//upb:__subpackages__"], + visibility = ["//python/dist:__pkg__"], ) pkg_files( @@ -456,9 +456,10 @@ def build_targets(name): "google/protobuf/pyext/*.cc", "google/protobuf/pyext/*.h", ]) + [ - "BUILD.bazel", + "BUILD", "MANIFEST.in", "README.md", + "build_targets.bzl", "google/protobuf/proto_api.h", "google/protobuf/pyext/README", "google/protobuf/python_protobuf.h", diff --git a/upb/python/convert.c b/python/convert.c similarity index 98% rename from upb/python/convert.c rename to python/convert.c index f26324c71c..98d9b75dcf 100644 --- a/upb/python/convert.c +++ b/python/convert.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/convert.h" +#include "python/convert.h" -#include "upb/python/message.h" -#include "upb/python/protobuf.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/util/compare.h" +#include "python/message.h" +#include "python/protobuf.h" +#include "upb/collections/map.h" +#include "upb/reflection/message.h" +#include "upb/util/compare.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f, PyObject* arena) { @@ -443,4 +443,4 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, kUpb_UnknownCompareResult_Equal; } -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" diff --git a/upb/python/convert.h b/python/convert.h similarity index 97% rename from upb/python/convert.h rename to python/convert.h index 8233f7e561..1c594d3b4a 100644 --- a/upb/python/convert.h +++ b/python/convert.h @@ -32,8 +32,8 @@ #define PYUPB_CONVERT_H__ #include "protobuf.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/message.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" // 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` diff --git a/upb/python/descriptor.c b/python/descriptor.c similarity index 99% rename from upb/python/descriptor.c rename to python/descriptor.c index f979108c51..d1726e4753 100644 --- a/upb/python/descriptor.c +++ b/python/descriptor.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/descriptor.h" +#include "python/descriptor.h" -#include "upb/python/convert.h" -#include "upb/python/descriptor_containers.h" -#include "upb/python/descriptor_pool.h" -#include "upb/python/message.h" -#include "upb/python/protobuf.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/util/def_to_proto.h" +#include "python/convert.h" +#include "python/descriptor_containers.h" +#include "python/descriptor_pool.h" +#include "python/message.h" +#include "python/protobuf.h" +#include "upb/reflection/def.h" +#include "upb/util/def_to_proto.h" // ----------------------------------------------------------------------------- // DescriptorBase diff --git a/upb/python/descriptor.h b/python/descriptor.h similarity index 98% rename from upb/python/descriptor.h rename to python/descriptor.h index 14cdfadeaf..7fa0164f0b 100644 --- a/upb/python/descriptor.h +++ b/python/descriptor.h @@ -33,8 +33,8 @@ #include -#include "upb/python/python_api.h" -#include "upb/upb/reflection/def.h" +#include "python/python_api.h" +#include "upb/reflection/def.h" typedef enum { kPyUpb_Descriptor = 0, diff --git a/upb/python/descriptor_containers.c b/python/descriptor_containers.c similarity index 99% rename from upb/python/descriptor_containers.c rename to python/descriptor_containers.c index 7aeafc56be..e1eacb2a77 100644 --- a/upb/python/descriptor_containers.c +++ b/python/descriptor_containers.c @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/descriptor_containers.h" +#include "python/descriptor_containers.h" -#include "upb/python/descriptor.h" -#include "upb/python/protobuf.h" -#include "upb/upb/reflection/def.h" +#include "python/descriptor.h" +#include "python/protobuf.h" +#include "upb/reflection/def.h" // Implements __repr__ as str(dict(self)). static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) { diff --git a/upb/python/descriptor_containers.h b/python/descriptor_containers.h similarity index 99% rename from upb/python/descriptor_containers.h rename to python/descriptor_containers.h index 004607b67e..5b2b1facf6 100644 --- a/upb/python/descriptor_containers.h +++ b/python/descriptor_containers.h @@ -46,7 +46,7 @@ #include #include "protobuf.h" -#include "upb/upb/reflection/def.h" +#include "upb/reflection/def.h" // ----------------------------------------------------------------------------- // PyUpb_GenericSequence diff --git a/upb/python/descriptor_pool.c b/python/descriptor_pool.c similarity index 98% rename from upb/python/descriptor_pool.c rename to python/descriptor_pool.c index db95259470..ee4167754c 100644 --- a/upb/python/descriptor_pool.c +++ b/python/descriptor_pool.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/descriptor_pool.h" +#include "python/descriptor_pool.h" #include "google/protobuf/descriptor.upbdefs.h" -#include "upb/python/convert.h" -#include "upb/python/descriptor.h" -#include "upb/python/message.h" -#include "upb/python/protobuf.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/util/def_to_proto.h" +#include "python/convert.h" +#include "python/descriptor.h" +#include "python/message.h" +#include "python/protobuf.h" +#include "upb/reflection/def.h" +#include "upb/util/def_to_proto.h" // ----------------------------------------------------------------------------- // DescriptorPool diff --git a/upb/python/descriptor_pool.h b/python/descriptor_pool.h similarity index 100% rename from upb/python/descriptor_pool.h rename to python/descriptor_pool.h diff --git a/upb/python/dist/BUILD.bazel b/python/dist/BUILD.bazel similarity index 90% rename from upb/python/dist/BUILD.bazel rename to python/dist/BUILD.bazel index c14757a899..aa03fbe8ce 100644 --- a/upb/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -10,15 +10,15 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@rules_python//python:packaging.bzl", "py_wheel") load("@system_python//:version.bzl", "SYSTEM_PYTHON_VERSION") load("//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION") +load("//bazel:py_proto_library.bzl", "py_proto_library") load("@bazel_skylib//lib:selects.bzl", "selects") -load("//upb/bazel:py_proto_library.bzl", "py_proto_library") load(":dist.bzl", "py_dist", "py_dist_module") licenses(["notice"]) py_dist_module( name = "message_mod", - extension = "//upb/python:_message_binary", + extension = "//python:_message_binary", module_name = "google._upb._message", ) @@ -235,20 +235,20 @@ pkg_files( name = "filegroup_source_files", srcs = [ "//:LICENSE", + "//python:message_srcs", "//upb:source_files", - "//upb/python:message_srcs", - "//upb/upb/base:source_files", - "//upb/upb/collections:source_files", - "//upb/upb/hash:source_files", - "//upb/upb/lex:source_files", - "//upb/upb/mem:source_files", - "//upb/upb/message:source_files", - "//upb/upb/mini_descriptor:source_files", - "//upb/upb/mini_table:source_files", - "//upb/upb/port:source_files", - "//upb/upb/text:source_files", - "//upb/upb/util:source_files", - "//upb/upb/wire:source_files", + "//upb/base:source_files", + "//upb/collections:source_files", + "//upb/hash:source_files", + "//upb/lex:source_files", + "//upb/mem:source_files", + "//upb/message:source_files", + "//upb/mini_descriptor:source_files", + "//upb/mini_table:source_files", + "//upb/port:source_files", + "//upb/text:source_files", + "//upb/util:source_files", + "//upb/wire:source_files", ], strip_prefix = strip_prefix.from_root(""), ) @@ -296,9 +296,9 @@ genrule( py_wheel( name = "binary_wheel", abi = select({ - "//upb/python:full_api_3.7": "cp37m", - "//upb/python:full_api_3.8": "cp38", - "//upb/python:full_api_3.9": "cp39", + "//python:full_api_3.7": "cp37m", + "//python:full_api_3.8": "cp38", + "//python:full_api_3.9": "cp39", "//conditions:default": "abi3", }), author = "protobuf@googlegroups.com", @@ -330,14 +330,14 @@ py_wheel( }), python_requires = ">=3.7", python_tag = selects.with_or({ - ("//upb/python:limited_api_3.7", "//upb/python:full_api_3.7"): "cp37", - "//upb/python:full_api_3.8": "cp38", - "//upb/python:full_api_3.9": "cp39", - "//upb/python:limited_api_3.10": "cp310", + ("//python:limited_api_3.7", "//python:full_api_3.7"): "cp37", + "//python:full_api_3.8": "cp38", + "//python:full_api_3.9": "cp39", + "//python:limited_api_3.10": "cp310", "//conditions:default": "cp" + SYSTEM_PYTHON_VERSION, }), strip_path_prefixes = [ - "upb/python/dist/", + "python/dist/", "python/", "src/", ], @@ -415,8 +415,8 @@ py_wheel( "//:python_common_test_protos", "//:python_specific_test_protos", "//:python_test_srcs", + "//python/pb_unit_tests:test_files", "//src/google/protobuf:testdata", - "//upb/python/pb_unit_tests:test_files", ], ) diff --git a/upb/python/dist/MANIFEST.in b/python/dist/MANIFEST.in similarity index 100% rename from upb/python/dist/MANIFEST.in rename to python/dist/MANIFEST.in diff --git a/upb/python/dist/dist.bzl b/python/dist/dist.bzl similarity index 93% rename from upb/python/dist/dist.bzl rename to python/dist/dist.bzl index 3545fa9f3a..75c21c31c3 100644 --- a/upb/python/dist/dist.bzl +++ b/python/dist/dist.bzl @@ -121,8 +121,8 @@ py_dist_module = rule( mandatory = True, cfg = _py_multiarch_transition, ), - "_limited_api": attr.label(default = "//upb/python:limited_api"), - "_python_version": attr.label(default = "//upb/python:python_version"), + "_limited_api": attr.label(default = "//python:limited_api"), + "_python_version": attr.label(default = "//python:python_version"), "_allowlist_function_transition": attr.label( 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(): transitions.append({ "//command_line_option:cpu": cpu, - "//upb/python:python_version": version, - "//upb/python:limited_api": True, + "//python:python_version": version, + "//python:limited_api": True, }) for version in attr.full_api_versions: for cpu in attr.full_api_cpus: transitions.append({ "//command_line_option:cpu": cpu, - "//upb/python:python_version": version, - "//upb/python:limited_api": False, + "//python:python_version": version, + "//python:limited_api": False, }) return transitions @@ -161,8 +161,8 @@ _py_dist_transition = transition( inputs = [], outputs = [ "//command_line_option:cpu", - "//upb/python:python_version", - "//upb/python:limited_api", + "//python:python_version", + "//python:limited_api", ], ) diff --git a/upb/python/dist/setup.py b/python/dist/setup.py similarity index 100% rename from upb/python/dist/setup.py rename to python/dist/setup.py diff --git a/upb/python/extension_dict.c b/python/extension_dict.c similarity index 98% rename from upb/python/extension_dict.c rename to python/extension_dict.c index 914957a624..d4b4ddadac 100644 --- a/upb/python/extension_dict.c +++ b/python/extension_dict.c @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/extension_dict.h" +#include "python/extension_dict.h" -#include "upb/python/message.h" -#include "upb/python/protobuf.h" -#include "upb/upb/reflection/def.h" +#include "python/message.h" +#include "python/protobuf.h" +#include "upb/reflection/def.h" // ----------------------------------------------------------------------------- // ExtensionDict diff --git a/upb/python/extension_dict.h b/python/extension_dict.h similarity index 98% rename from upb/python/extension_dict.h rename to python/extension_dict.h index 724054f9f1..99d2addf23 100644 --- a/upb/python/extension_dict.h +++ b/python/extension_dict.h @@ -33,7 +33,7 @@ #include -#include "upb/python/python_api.h" +#include "python/python_api.h" PyObject* PyUpb_ExtensionDict_New(PyObject* msg); diff --git a/python/google/protobuf/internal/numpy/BUILD.bazel b/python/google/protobuf/internal/numpy/BUILD.bazel index 5c1c16627d..ffdc4e565c 100644 --- a/python/google/protobuf/internal/numpy/BUILD.bazel +++ b/python/google/protobuf/internal/numpy/BUILD.bazel @@ -6,18 +6,18 @@ load("//python:internal.bzl", "internal_py_test") # TODO: b/278896688 - Remove this target and replace with py_library exports_files([ - "__init__.py", - "numpy_test.py", + "__init__.py", + "numpy_test.py", ]) internal_py_test( name = "numpy_test", srcs = ["numpy_test.py"], + visibility = [ + "//python:__pkg__", + "//python/pb_unit_tests:__pkg__", + ], deps = [ requirement("numpy"), ], - visibility = [ - "//python:__pkg__", - "//upb/python/pb_unit_tests:__pkg__", - ] ) diff --git a/upb/python/map.c b/python/map.c similarity index 99% rename from upb/python/map.c rename to python/map.c index ec0133c399..bd9022d847 100644 --- a/upb/python/map.c +++ b/python/map.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/map.h" +#include "python/map.h" -#include "upb/python/convert.h" -#include "upb/python/message.h" -#include "upb/python/protobuf.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/reflection/def.h" +#include "python/convert.h" +#include "python/message.h" +#include "python/protobuf.h" +#include "upb/collections/map.h" +#include "upb/reflection/def.h" // ----------------------------------------------------------------------------- // MapContainer diff --git a/upb/python/map.h b/python/map.h similarity index 97% rename from upb/python/map.h rename to python/map.h index 6a240688d3..6c2c47d4d4 100644 --- a/upb/python/map.h +++ b/python/map.h @@ -33,8 +33,8 @@ #include -#include "upb/python/python_api.h" -#include "upb/upb/reflection/def.h" +#include "python/python_api.h" +#include "upb/reflection/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. // Precondition: `parent` must be a stub. diff --git a/upb/python/message.c b/python/message.c similarity index 99% rename from upb/python/message.c rename to python/message.c index f418938e3e..0777e7ed5f 100644 --- a/upb/python/message.c +++ b/python/message.c @@ -28,18 +28,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/message.h" +#include "python/message.h" -#include "upb/python/convert.h" -#include "upb/python/descriptor.h" -#include "upb/python/extension_dict.h" -#include "upb/python/map.h" -#include "upb/python/repeated.h" -#include "upb/upb/message/copy.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/text/encode.h" -#include "upb/upb/util/required_fields.h" +#include "python/convert.h" +#include "python/descriptor.h" +#include "python/extension_dict.h" +#include "python/map.h" +#include "python/repeated.h" +#include "upb/message/copy.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" +#include "upb/text/encode.h" +#include "upb/util/required_fields.h" static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls); static PyObject* PyUpb_MessageMeta_GetAttr(PyObject* self, PyObject* name); diff --git a/upb/python/message.h b/python/message.h similarity index 98% rename from upb/python/message.h rename to python/message.h index eb673a7df0..d497f617f6 100644 --- a/upb/python/message.h +++ b/python/message.h @@ -33,8 +33,8 @@ #include -#include "upb/python/protobuf.h" -#include "upb/upb/reflection/message.h" +#include "python/protobuf.h" +#include "upb/reflection/message.h" // Removes the wrapper object for this field from the unset subobject cache. void PyUpb_Message_CacheDelete(PyObject* _self, const upb_FieldDef* f); diff --git a/upb/python/minimal_test.py b/python/minimal_test.py similarity index 100% rename from upb/python/minimal_test.py rename to python/minimal_test.py diff --git a/upb/python/pb_unit_tests/BUILD b/python/pb_unit_tests/BUILD similarity index 95% rename from upb/python/pb_unit_tests/BUILD rename to python/pb_unit_tests/BUILD index 8aecac9463..56ee25086d 100644 --- a/upb/python/pb_unit_tests/BUILD +++ b/python/pb_unit_tests/BUILD @@ -42,7 +42,7 @@ py_test( deps = [ requirement("numpy"), "//python/google/protobuf/internal/numpy:numpy_test", - "//upb/python:_message", + "//python:_message", ], target_compatible_with = select({ "@system_python//:supported": [], @@ -79,6 +79,6 @@ filegroup( name = "test_files", srcs = glob(["*.py"]), visibility = [ - "//upb/python/dist:__pkg__", # Scheuklappen: keep + "//python/dist:__pkg__", # Scheuklappen: keep ], ) diff --git a/upb/python/pb_unit_tests/README.md b/python/pb_unit_tests/README.md similarity index 100% rename from upb/python/pb_unit_tests/README.md rename to python/pb_unit_tests/README.md diff --git a/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py b/python/pb_unit_tests/descriptor_database_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/descriptor_database_test_wrapper.py rename to python/pb_unit_tests/descriptor_database_test_wrapper.py diff --git a/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py b/python/pb_unit_tests/descriptor_pool_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py rename to python/pb_unit_tests/descriptor_pool_test_wrapper.py diff --git a/upb/python/pb_unit_tests/descriptor_test_wrapper.py b/python/pb_unit_tests/descriptor_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/descriptor_test_wrapper.py rename to python/pb_unit_tests/descriptor_test_wrapper.py diff --git a/upb/python/pb_unit_tests/generator_test_wrapper.py b/python/pb_unit_tests/generator_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/generator_test_wrapper.py rename to python/pb_unit_tests/generator_test_wrapper.py diff --git a/upb/python/pb_unit_tests/json_format_test_wrapper.py b/python/pb_unit_tests/json_format_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/json_format_test_wrapper.py rename to python/pb_unit_tests/json_format_test_wrapper.py diff --git a/upb/python/pb_unit_tests/keywords_test_wrapper.py b/python/pb_unit_tests/keywords_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/keywords_test_wrapper.py rename to python/pb_unit_tests/keywords_test_wrapper.py diff --git a/upb/python/pb_unit_tests/message_factory_test_wrapper.py b/python/pb_unit_tests/message_factory_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/message_factory_test_wrapper.py rename to python/pb_unit_tests/message_factory_test_wrapper.py diff --git a/upb/python/pb_unit_tests/message_test_wrapper.py b/python/pb_unit_tests/message_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/message_test_wrapper.py rename to python/pb_unit_tests/message_test_wrapper.py diff --git a/upb/python/pb_unit_tests/numpy_test_wrapper.py b/python/pb_unit_tests/numpy_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/numpy_test_wrapper.py rename to python/pb_unit_tests/numpy_test_wrapper.py diff --git a/upb/python/pb_unit_tests/proto_builder_test_wrapper.py b/python/pb_unit_tests/proto_builder_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/proto_builder_test_wrapper.py rename to python/pb_unit_tests/proto_builder_test_wrapper.py diff --git a/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl b/python/pb_unit_tests/pyproto_test_wrapper.bzl similarity index 97% rename from upb/python/pb_unit_tests/pyproto_test_wrapper.bzl rename to python/pb_unit_tests/pyproto_test_wrapper.bzl index a6a31b3222..5691e886fa 100644 --- a/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl +++ b/python/pb_unit_tests/pyproto_test_wrapper.bzl @@ -9,7 +9,7 @@ def pyproto_test_wrapper(name, deps = []): main = src, data = ["//src/google/protobuf:testdata"], deps = [ - "//upb/python:_message", + "//python:_message", "//:python_common_test_protos", "//:python_specific_test_protos", "//:python_test_srcs", diff --git a/upb/python/pb_unit_tests/reflection_test_wrapper.py b/python/pb_unit_tests/reflection_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/reflection_test_wrapper.py rename to python/pb_unit_tests/reflection_test_wrapper.py diff --git a/upb/python/pb_unit_tests/service_reflection_test_wrapper.py b/python/pb_unit_tests/service_reflection_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/service_reflection_test_wrapper.py rename to python/pb_unit_tests/service_reflection_test_wrapper.py diff --git a/upb/python/pb_unit_tests/symbol_database_test_wrapper.py b/python/pb_unit_tests/symbol_database_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/symbol_database_test_wrapper.py rename to python/pb_unit_tests/symbol_database_test_wrapper.py diff --git a/upb/python/pb_unit_tests/text_encoding_test_wrapper.py b/python/pb_unit_tests/text_encoding_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/text_encoding_test_wrapper.py rename to python/pb_unit_tests/text_encoding_test_wrapper.py diff --git a/upb/python/pb_unit_tests/text_format_test_wrapper.py b/python/pb_unit_tests/text_format_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/text_format_test_wrapper.py rename to python/pb_unit_tests/text_format_test_wrapper.py diff --git a/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py b/python/pb_unit_tests/unknown_fields_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/unknown_fields_test_wrapper.py rename to python/pb_unit_tests/unknown_fields_test_wrapper.py diff --git a/upb/python/pb_unit_tests/well_known_types_test_wrapper.py b/python/pb_unit_tests/well_known_types_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/well_known_types_test_wrapper.py rename to python/pb_unit_tests/well_known_types_test_wrapper.py diff --git a/upb/python/pb_unit_tests/wire_format_test_wrapper.py b/python/pb_unit_tests/wire_format_test_wrapper.py similarity index 100% rename from upb/python/pb_unit_tests/wire_format_test_wrapper.py rename to python/pb_unit_tests/wire_format_test_wrapper.py diff --git a/upb/python/protobuf.c b/python/protobuf.c similarity index 97% rename from upb/python/protobuf.c rename to python/protobuf.c index 79b2e3f895..324b1edb3e 100644 --- a/upb/python/protobuf.c +++ b/python/protobuf.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/protobuf.h" +#include "python/protobuf.h" -#include "upb/python/descriptor.h" -#include "upb/python/descriptor_containers.h" -#include "upb/python/descriptor_pool.h" -#include "upb/python/extension_dict.h" -#include "upb/python/map.h" -#include "upb/python/message.h" -#include "upb/python/repeated.h" -#include "upb/python/unknown_fields.h" +#include "python/descriptor.h" +#include "python/descriptor_containers.h" +#include "python/descriptor_pool.h" +#include "python/extension_dict.h" +#include "python/map.h" +#include "python/message.h" +#include "python/repeated.h" +#include "python/unknown_fields.h" static upb_Arena* PyUpb_NewArena(void); diff --git a/upb/python/protobuf.h b/python/protobuf.h similarity index 97% rename from upb/python/protobuf.h rename to python/protobuf.h index 8ed2d2da29..e9839be625 100644 --- a/upb/python/protobuf.h +++ b/python/protobuf.h @@ -33,9 +33,9 @@ #include -#include "upb/python/descriptor.h" -#include "upb/python/python_api.h" -#include "upb/upb/hash/int_table.h" +#include "python/descriptor.h" +#include "python/python_api.h" +#include "upb/hash/int_table.h" // begin:github_only #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google.protobuf" @@ -45,8 +45,8 @@ // end:github_only // begin:google_only -// #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google3.net.proto2.python.public" -// #define PYUPB_PROTOBUF_INTERNAL_PACKAGE "google3.net.proto2.python.internal" +// #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google3.net.google.protobuf.python.public" +// #define PYUPB_PROTOBUF_INTERNAL_PACKAGE "google3.net.google.protobuf.python.internal" // #define PYUPB_DESCRIPTOR_PROTO_PACKAGE "proto2" // #define PYUPB_MODULE_NAME "google3.third_party.upb.python._message" // end:google_only diff --git a/upb/python/py_extension.bzl b/python/py_extension.bzl similarity index 51% rename from upb/python/py_extension.bzl rename to python/py_extension.bzl index aafe846eef..7b918bc78e 100644 --- a/upb/python/py_extension.bzl +++ b/python/py_extension.bzl @@ -18,24 +18,24 @@ def py_extension(name, srcs, copts, deps = [], **kwargs): copts = copts + ["-fvisibility=hidden"], linkopts = selects.with_or({ ( - "//upb/python/dist:osx_x86_64", - "//upb/python/dist:osx_aarch64", + "//python/dist:osx_x86_64", + "//python/dist:osx_aarch64", ): ["-undefined", "dynamic_lookup"], - "//upb/python/dist:windows_x86_32": ["-static-libgcc"], + "//python/dist:windows_x86_32": ["-static-libgcc"], "//conditions:default": [], }), linkshared = True, linkstatic = True, deps = deps + select({ - "//upb/python:limited_api_3.7": ["@python-3.7.0//:python_headers"], - "//upb/python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"], - "//upb/python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"], - "//upb/python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"], - "//upb/python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"], - "//upb/python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"], - "//upb/python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"], - "//upb/python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"], - "//upb/python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"], + "//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"], + "//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"], + "//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"], + "//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"], + "//python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"], "//conditions:default": ["@system_python//:python_headers"], }), **kwargs @@ -49,12 +49,12 @@ def py_extension(name, srcs, copts, deps = [], **kwargs): srcs = [":" + name + "_binary"], outs = [output_file], cmd = "cp $< $@", - visibility = ["//upb/python:__subpackages__"], + visibility = ["//python:__subpackages__"], ) native.py_library( name = name, data = [output_file], imports = ["."], - visibility = ["//upb/python:__subpackages__"], + visibility = ["//python:__subpackages__"], ) diff --git a/upb/python/python_api.h b/python/python_api.h similarity index 100% rename from upb/python/python_api.h rename to python/python_api.h diff --git a/upb/python/repeated.c b/python/repeated.c similarity index 99% rename from upb/python/repeated.c rename to python/repeated.c index 656b42c102..abb34e880a 100644 --- a/upb/python/repeated.c +++ b/python/repeated.c @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/repeated.h" +#include "python/repeated.h" -#include "upb/python/convert.h" -#include "upb/python/message.h" -#include "upb/python/protobuf.h" +#include "python/convert.h" +#include "python/message.h" +#include "python/protobuf.h" static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self, PyObject* value); diff --git a/upb/python/repeated.h b/python/repeated.h similarity index 97% rename from upb/python/repeated.h rename to python/repeated.h index 413e4f11f8..54670e7e80 100644 --- a/upb/python/repeated.h +++ b/python/repeated.h @@ -33,8 +33,8 @@ #include -#include "upb/python/python_api.h" -#include "upb/upb/reflection/def.h" +#include "python/python_api.h" +#include "upb/reflection/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. // Precondition: `parent` must be a stub. diff --git a/upb/python/requirements.txt b/python/requirements.txt similarity index 100% rename from upb/python/requirements.txt rename to python/requirements.txt diff --git a/upb/python/unknown_fields.c b/python/unknown_fields.c similarity index 98% rename from upb/python/unknown_fields.c rename to python/unknown_fields.c index 65a1383b4e..f228f237b7 100644 --- a/upb/python/unknown_fields.c +++ b/python/unknown_fields.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/python/unknown_fields.h" +#include "python/unknown_fields.h" -#include "upb/python/message.h" -#include "upb/python/protobuf.h" -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/reader.h" -#include "upb/upb/wire/types.h" +#include "python/message.h" +#include "python/protobuf.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" +#include "upb/wire/types.h" // ----------------------------------------------------------------------------- // UnknownFieldSet diff --git a/upb/python/unknown_fields.h b/python/unknown_fields.h similarity index 98% rename from upb/python/unknown_fields.h rename to python/unknown_fields.h index 72bf2e9759..85ea40c995 100644 --- a/upb/python/unknown_fields.h +++ b/python/unknown_fields.h @@ -33,7 +33,7 @@ #include -#include "upb/python/python_api.h" +#include "python/python_api.h" PyObject* PyUpb_UnknownFields_New(PyObject* msg); diff --git a/upb/python/version_script.lds b/python/version_script.lds similarity index 100% rename from upb/python/version_script.lds rename to python/version_script.lds diff --git a/ruby/compatibility_tests/v3.0.0/BUILD.bazel b/ruby/compatibility_tests/v3.0.0/BUILD.bazel index d62c352801..60c4985f39 100644 --- a/ruby/compatibility_tests/v3.0.0/BUILD.bazel +++ b/ruby/compatibility_tests/v3.0.0/BUILD.bazel @@ -23,11 +23,11 @@ genrule( pkg_files( name = "dist_files", srcs = [ - "//ruby/compatibility_tests/v3.0.0/tests:dist_files", "BUILD.bazel", - "Rakefile", "README.md", + "Rakefile", "test.sh", + "//ruby/compatibility_tests/v3.0.0/tests:dist_files", ], strip_prefix = strip_prefix.from_root(""), visibility = ["//pkg:__pkg__"], diff --git a/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel b/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel index e165b0bb2b..34a5391727 100644 --- a/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel +++ b/ruby/compatibility_tests/v3.0.0/tests/BUILD.bazel @@ -11,42 +11,42 @@ internal_ruby_proto_library( ruby_test( name = "basic", + srcs = ["basic.rb"], deps = [ ":test_ruby_protos", "//ruby:protobuf", - "@protobuf_bundle//:test-unit" + "@protobuf_bundle//:test-unit", ], - srcs = ["basic.rb"], ) ruby_test( name = "generated_code_test", + srcs = ["generated_code_test.rb"], deps = [ ":test_ruby_protos", "//ruby:protobuf", - "@protobuf_bundle//:test-unit" + "@protobuf_bundle//:test-unit", ], - srcs = ["generated_code_test.rb"], ) ruby_test( name = "repeated_field_test", + srcs = ["repeated_field_test.rb"], deps = [ ":test_ruby_protos", "//ruby:protobuf", - "@protobuf_bundle//:test-unit" + "@protobuf_bundle//:test-unit", ], - srcs = ["repeated_field_test.rb"], ) ruby_test( name = "stress", + srcs = ["stress.rb"], deps = [ ":test_ruby_protos", "//ruby:protobuf", - "@protobuf_bundle//:test-unit" + "@protobuf_bundle//:test-unit", ], - srcs = ["stress.rb"], ) ################################################################################ @@ -57,7 +57,7 @@ pkg_files( name = "dist_files", srcs = glob([ "**/*.rb", - "**/*.proto" + "**/*.proto", ]), strip_prefix = strip_prefix.from_root(""), visibility = ["//ruby/compatibility_tests/v3.0.0:__pkg__"], diff --git a/ruby/src/main/java/BUILD.bazel b/ruby/src/main/java/BUILD.bazel index 34242d41a2..43945345ab 100644 --- a/ruby/src/main/java/BUILD.bazel +++ b/ruby/src/main/java/BUILD.bazel @@ -5,20 +5,20 @@ load("@rules_proto//proto:defs.bzl", "proto_library") java_library( name = "protobuf_java", srcs = glob([ - "com/google/protobuf/jruby/*.java" + "com/google/protobuf/jruby/*.java", ]) + [ - "google/ProtobufJavaService.java" - ], - deps = [ - "@rules_ruby//ruby/runtime:jars", - "//java/core", - "//java/util", + "google/ProtobufJavaService.java", ], target_compatible_with = select({ "@rules_ruby//ruby/runtime:config_jruby": [], "//conditions:default": ["@platforms//:incompatible"], }), visibility = ["//ruby:__subpackages__"], + deps = [ + "//java/core", + "//java/util", + "@rules_ruby//ruby/runtime:jars", + ], ) proto_library( @@ -31,7 +31,6 @@ java_proto_library( deps = [":sentinel_proto"], ) - pkg_files( name = "dist_files", srcs = glob([ diff --git a/rust/aspects.bzl b/rust/aspects.bzl index 7e68a12324..d0c877db0d 100644 --- a/rust/aspects.bzl +++ b/rust/aspects.bzl @@ -9,7 +9,7 @@ load("@rules_rust//rust/private:providers.bzl", "CrateInfo", "DepInfo", "DepVari # buildifier: disable=bzl-visibility load("@rules_rust//rust/private:rustc.bzl", "rustc_compile_action") load("@rules_rust//rust:defs.bzl", "rust_common") -load("//upb/bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect") +load("//bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect") load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") proto_common = proto_common_do_not_use diff --git a/rust/cpp_kernel/BUILD b/rust/cpp_kernel/BUILD index 0b9594b2e8..9d9c5bf15b 100644 --- a/rust/cpp_kernel/BUILD +++ b/rust/cpp_kernel/BUILD @@ -11,7 +11,7 @@ cc_library( ], deps = [ ":rust_alloc_for_cpp_api", - "//src/google/protobuf", + "//:protobuf", ], ) diff --git a/rust/test/cpp/interop/BUILD b/rust/test/cpp/interop/BUILD index 5cbd99348c..1a4d88d640 100644 --- a/rust/test/cpp/interop/BUILD +++ b/rust/test/cpp/interop/BUILD @@ -6,7 +6,7 @@ cc_library( name = "test_utils", srcs = ["test_utils.cc"], deps = [ - "//third_party/absl/strings", + "@com_google_absl//absl/strings", "//rust/cpp_kernel:cpp_api", "//rust/test:unittest_cc_proto", ], diff --git a/rust/upb_kernel/upb_api.c b/rust/upb_kernel/upb_api.c index c4eb226ba3..985749da23 100644 --- a/rust/upb_kernel/upb_api.c +++ b/rust/upb_kernel/upb_api.c @@ -8,4 +8,4 @@ #define UPB_BUILD_API -#include "upb/upb/mem/arena.h" // IWYU pragma: keep +#include "upb/mem/arena.h" // IWYU pragma: keep diff --git a/src/BUILD.bazel b/src/BUILD.bazel index 96b7001169..2ce3449845 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -49,8 +49,8 @@ genrule( srcs = ["//pkg:gen_src_file_lists"], outs = ["cmake_copy/file_lists.cmake"], cmd = "cp $< $@", - visibility = ["//visibility:private"], tags = ["manual"], + visibility = ["//visibility:private"], ) staleness_test( diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index 328e8226d7..b1542e9617 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -5,8 +5,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library", "cc_test") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") -load("//upb/cmake:build_defs.bzl", "staleness_test") load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS") +load("//upb/cmake:build_defs.bzl", "staleness_test") package( default_visibility = [ @@ -786,6 +786,8 @@ proto_library( visibility = [ "//:__pkg__", "//conformance:__pkg__", + "//lua:__subpackages__", + "//python:__subpackages__", "//upb:__subpackages__", ], ) @@ -797,6 +799,8 @@ proto_library( visibility = [ "//:__pkg__", "//conformance:__pkg__", + "//lua:__subpackages__", + "//python:__subpackages__", "//upb:__subpackages__", ], deps = [ diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index 87e075347c..d1c43cdbee 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -212,7 +212,7 @@ filegroup( name = "plugin_proto_src", srcs = ["plugin.proto"], visibility = [ - "//upb:__subpackages__", + "//upbc:__subpackages__", # For compatibility with workspaces that still use the old upb repo "@upb//:__subpackages__", ], diff --git a/src/google/protobuf/compiler/allowlists/BUILD.bazel b/src/google/protobuf/compiler/allowlists/BUILD.bazel index 9c457f4c87..ebedfadf91 100644 --- a/src/google/protobuf/compiler/allowlists/BUILD.bazel +++ b/src/google/protobuf/compiler/allowlists/BUILD.bazel @@ -57,4 +57,4 @@ filegroup( allow_empty = True, ), visibility = ["//src/google/protobuf/compiler:__pkg__"], -) \ No newline at end of file +) diff --git a/src/google/protobuf/compiler/objectivec/BUILD.bazel b/src/google/protobuf/compiler/objectivec/BUILD.bazel index 8ca54ee26e..5ab3381afa 100644 --- a/src/google/protobuf/compiler/objectivec/BUILD.bazel +++ b/src/google/protobuf/compiler/objectivec/BUILD.bazel @@ -155,9 +155,12 @@ pkg_files( filegroup( name = "test_srcs", - srcs = glob([ - "*_test.cc", - "*unittest.cc", - ], allow_empty = True), + srcs = glob( + [ + "*_test.cc", + "*unittest.cc", + ], + allow_empty = True, + ), visibility = ["//src/google/protobuf/compiler:__pkg__"], ) diff --git a/src/google/protobuf/compiler/ruby/BUILD.bazel b/src/google/protobuf/compiler/ruby/BUILD.bazel index 2aee20e96e..d01764c2ff 100644 --- a/src/google/protobuf/compiler/ruby/BUILD.bazel +++ b/src/google/protobuf/compiler/ruby/BUILD.bazel @@ -64,9 +64,12 @@ pkg_files( filegroup( name = "test_srcs", - srcs = glob([ - "*_test.cc", - "*unittest.cc", - ], allow_empty = True), + srcs = glob( + [ + "*_test.cc", + "*unittest.cc", + ], + allow_empty = True, + ), visibility = ["//src/google/protobuf/compiler:__pkg__"], ) diff --git a/src/google/protobuf/editions/BUILD b/src/google/protobuf/editions/BUILD index 7add8dcbb2..cd38e08217 100644 --- a/src/google/protobuf/editions/BUILD +++ b/src/google/protobuf/editions/BUILD @@ -56,7 +56,7 @@ cc_test( ":test_editions_default_features_cc_proto", ":test_messages_proto2_cc_proto", ":test_messages_proto3_cc_proto", - "//src/google/protobuf", + "//:protobuf", "//src/google/protobuf:test_textproto", "@com_google_googletest//:gtest_main", ], diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel index 5888a900bd..0578742d62 100644 --- a/src/google/protobuf/io/BUILD.bazel +++ b/src/google/protobuf/io/BUILD.bazel @@ -142,7 +142,7 @@ cc_library( "@com_google_absl//absl/log:absl_log", ] + select({ "//build_defs:config_msvc": [], - "//conditions:default": ["@zlib//:zlib"], + "//conditions:default": ["@zlib"], }), ) diff --git a/src/google/protobuf/json/BUILD.bazel b/src/google/protobuf/json/BUILD.bazel index d6019f9399..dece74e4d0 100644 --- a/src/google/protobuf/json/BUILD.bazel +++ b/src/google/protobuf/json/BUILD.bazel @@ -141,9 +141,9 @@ cc_library( cc_test( name = "lexer_test", + timeout = "long", srcs = ["internal/lexer_test.cc"], copts = COPTS, - timeout = "long", deps = [ ":lexer", ":test_input_stream", diff --git a/src/google/protobuf/stubs/BUILD.bazel b/src/google/protobuf/stubs/BUILD.bazel index c8fc3e9d07..740e43e815 100644 --- a/src/google/protobuf/stubs/BUILD.bazel +++ b/src/google/protobuf/stubs/BUILD.bazel @@ -92,9 +92,12 @@ pkg_files( filegroup( name = "test_srcs", - srcs = glob([ - "*_test.cc", - "*unittest.cc", - ], allow_empty = True), + srcs = glob( + [ + "*_test.cc", + "*unittest.cc", + ], + allow_empty = True, + ), visibility = ["//pkg:__pkg__"], ) diff --git a/upb/BUILD b/upb/BUILD index 0eac0e5391..9f1cf4bc8e 100644 --- a/upb/BUILD +++ b/upb/BUILD @@ -7,12 +7,12 @@ load("@rules_python//python:defs.bzl", "py_binary") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") -load("//upb/bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library") -load("//upb/bazel:upb_proto_library.bzl", "upb_proto_reflection_library") -load("//upb/bazel:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library") +load("//bazel:upb_proto_library.bzl", "upb_proto_reflection_library") +load("//bazel:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts") load( - "//upb/upbc:bootstrap_compiler.bzl", + "//upbc:bootstrap_compiler.bzl", "bootstrap_cc_library", "bootstrap_upb_proto_library", ) @@ -24,7 +24,7 @@ load( # begin:github_only load( - "//upb/bazel:amalgamation.bzl", + "//bazel:amalgamation.bzl", "upb_amalgamation", ) # end:github_only @@ -86,7 +86,7 @@ package_group( cc_library( name = "upb", hdrs = [ - "upb/upb.hpp", + "upb.hpp", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], @@ -104,10 +104,10 @@ cc_library( # give up any backward compatibility guarantees. cc_library( name = "generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - hdrs = ["upb/generated_code_support.h"], + hdrs = ["generated_code_support.h"], copts = UPB_DEFAULT_COPTS, textual_hdrs = [ - "//upb/upb/port:inc", + "//upb/port:inc", ], visibility = ["//visibility:public"], deps = [ @@ -131,7 +131,7 @@ cc_library( name = "generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", copts = UPB_DEFAULT_COPTS, textual_hdrs = [ - "//upb/upb/port:inc", + "//upb/port:inc", ], visibility = ["//visibility:public"], ) @@ -139,12 +139,12 @@ cc_library( cc_library( name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", hdrs = [ - "upb/reflection/def.h", - "upb/reflection/internal/def_pool.h", + "reflection/def.h", + "reflection/internal/def_pool.h", ], copts = UPB_DEFAULT_COPTS, textual_hdrs = [ - "//upb/upb/port:inc", + "//upb/port:inc", ], visibility = ["//visibility:public"], deps = [ @@ -156,7 +156,7 @@ cc_library( bootstrap_upb_proto_library( name = "descriptor_upb_proto", - base_dir = "upb/reflection/", + base_dir = "reflection/", # TODO: Export 'net/proto2/proto/descriptor.upb.h' and remove "-layering_check". features = ["-layering_check"], google3_src_files = ["net/proto2/proto/descriptor.proto"], @@ -176,7 +176,12 @@ upb_proto_reflection_library( upb_minitable_proto_library( name = "descriptor_upb_minitable_proto", - visibility = ["//upb:__subpackages__"], + visibility = [ + "//upb:__subpackages__", + # begin:github_only + "//python:__subpackages__", + # end:github_only + ], deps = ["//:descriptor_proto"], ) @@ -185,10 +190,10 @@ upb_minitable_proto_library( bootstrap_cc_library( name = "reflection", hdrs = [ - "upb/reflection/def.h", - "upb/reflection/def.hpp", - "upb/reflection/message.h", - "upb/reflection/message.hpp", + "reflection/def.h", + "reflection/def.hpp", + "reflection/message.h", + "reflection/message.hpp", ], bootstrap_deps = [":reflection_internal"], copts = UPB_DEFAULT_COPTS, @@ -206,58 +211,58 @@ bootstrap_cc_library( bootstrap_cc_library( name = "reflection_internal", srcs = [ - "upb/reflection/def_pool.c", - "upb/reflection/def_type.c", - "upb/reflection/desc_state.c", - "upb/reflection/enum_def.c", - "upb/reflection/enum_reserved_range.c", - "upb/reflection/enum_value_def.c", - "upb/reflection/extension_range.c", - "upb/reflection/field_def.c", - "upb/reflection/file_def.c", - "upb/reflection/internal/def_builder.c", - "upb/reflection/internal/def_builder.h", - "upb/reflection/internal/strdup2.c", - "upb/reflection/internal/strdup2.h", - "upb/reflection/message.c", - "upb/reflection/message_def.c", - "upb/reflection/message_reserved_range.c", - "upb/reflection/method_def.c", - "upb/reflection/oneof_def.c", - "upb/reflection/service_def.c", + "reflection/def_pool.c", + "reflection/def_type.c", + "reflection/desc_state.c", + "reflection/enum_def.c", + "reflection/enum_reserved_range.c", + "reflection/enum_value_def.c", + "reflection/extension_range.c", + "reflection/field_def.c", + "reflection/file_def.c", + "reflection/internal/def_builder.c", + "reflection/internal/def_builder.h", + "reflection/internal/strdup2.c", + "reflection/internal/strdup2.h", + "reflection/message.c", + "reflection/message_def.c", + "reflection/message_reserved_range.c", + "reflection/method_def.c", + "reflection/oneof_def.c", + "reflection/service_def.c", ], hdrs = [ - "upb/reflection/common.h", - "upb/reflection/def.h", - "upb/reflection/def.hpp", - "upb/reflection/def_pool.h", - "upb/reflection/def_type.h", - "upb/reflection/enum_def.h", - "upb/reflection/enum_reserved_range.h", - "upb/reflection/enum_value_def.h", - "upb/reflection/extension_range.h", - "upb/reflection/field_def.h", - "upb/reflection/file_def.h", - "upb/reflection/internal/def_pool.h", - "upb/reflection/internal/desc_state.h", - "upb/reflection/internal/enum_def.h", - "upb/reflection/internal/enum_reserved_range.h", - "upb/reflection/internal/enum_value_def.h", - "upb/reflection/internal/extension_range.h", - "upb/reflection/internal/field_def.h", - "upb/reflection/internal/file_def.h", - "upb/reflection/internal/message_def.h", - "upb/reflection/internal/message_reserved_range.h", - "upb/reflection/internal/method_def.h", - "upb/reflection/internal/oneof_def.h", - "upb/reflection/internal/service_def.h", - "upb/reflection/message.h", - "upb/reflection/message.hpp", - "upb/reflection/message_def.h", - "upb/reflection/message_reserved_range.h", - "upb/reflection/method_def.h", - "upb/reflection/oneof_def.h", - "upb/reflection/service_def.h", + "reflection/common.h", + "reflection/def.h", + "reflection/def.hpp", + "reflection/def_pool.h", + "reflection/def_type.h", + "reflection/enum_def.h", + "reflection/enum_reserved_range.h", + "reflection/enum_value_def.h", + "reflection/extension_range.h", + "reflection/field_def.h", + "reflection/file_def.h", + "reflection/internal/def_pool.h", + "reflection/internal/desc_state.h", + "reflection/internal/enum_def.h", + "reflection/internal/enum_reserved_range.h", + "reflection/internal/enum_value_def.h", + "reflection/internal/extension_range.h", + "reflection/internal/field_def.h", + "reflection/internal/file_def.h", + "reflection/internal/message_def.h", + "reflection/internal/message_reserved_range.h", + "reflection/internal/method_def.h", + "reflection/internal/oneof_def.h", + "reflection/internal/service_def.h", + "reflection/message.h", + "reflection/message.hpp", + "reflection/message_def.h", + "reflection/message_reserved_range.h", + "reflection/method_def.h", + "reflection/oneof_def.h", + "reflection/service_def.h", ], bootstrap_deps = [":descriptor_upb_proto"], copts = UPB_DEFAULT_COPTS, @@ -283,199 +288,199 @@ bootstrap_cc_library( alias( name = "base", - actual = "//upb/upb/base", + actual = "//upb/base", visibility = ["//visibility:public"], ) alias( name = "base_internal", - actual = "//upb/upb/base:internal", + actual = "//upb/base:internal", visibility = ["//visibility:public"], ) alias( name = "collections", - actual = "//upb/upb/collections", + actual = "//upb/collections", visibility = ["//visibility:public"], ) alias( name = "collections_internal", - actual = "//upb/upb/collections:internal", + actual = "//upb/collections:internal", visibility = ["//visibility:public"], ) alias( name = "collections_split64", - actual = "//upb/upb/collections:split64", + actual = "//upb/collections:split64", visibility = ["//visibility:public"], ) alias( name = "hash", - actual = "//upb/upb/hash", + actual = "//upb/hash", visibility = ["//visibility:public"], ) alias( name = "json", - actual = "//upb/upb/json", + actual = "//upb/json", visibility = ["//visibility:public"], ) alias( name = "lex", - actual = "//upb/upb/lex", + actual = "//upb/lex", visibility = ["//visibility:public"], ) alias( name = "mem", - actual = "//upb/upb/mem", + actual = "//upb/mem", visibility = ["//visibility:public"], ) alias( name = "mem_internal", - actual = "//upb/upb/mem:internal", + actual = "//upb/mem:internal", visibility = ["//upb:__subpackages__"], ) alias( name = "message", - actual = "//upb/upb/message", + actual = "//upb/message", visibility = ["//visibility:public"], ) alias( name = "message_accessors", - actual = "//upb/upb/message:accessors", + actual = "//upb/message:accessors", visibility = ["//visibility:public"], ) alias( name = "message_accessors_internal", - actual = "//upb/upb/message:accessors_internal", + actual = "//upb/message:accessors_internal", visibility = ["//upb:friends"], ) alias( name = "message_copy", - actual = "//upb/upb/message:copy", + actual = "//upb/message:copy", visibility = ["//visibility:public"], ) alias( name = "message_internal", - actual = "//upb/upb/message:internal", + actual = "//upb/message:internal", visibility = ["//visibility:public"], ) alias( name = "message_internal_types", - actual = "//upb/upb/message:internal_types", + actual = "//upb/message:internal_types", visibility = ["//visibility:public"], ) alias( name = "message_promote", - actual = "//upb/upb/message:promote", + actual = "//upb/message:promote", visibility = ["//visibility:public"], ) alias( name = "message_split64", - actual = "//upb/upb/message:split64", + actual = "//upb/message:split64", visibility = ["//visibility:public"], ) alias( name = "message_tagged_ptr", - actual = "//upb/upb/message:tagged_ptr", + actual = "//upb/message:tagged_ptr", visibility = ["//upb:friends"], ) alias( name = "message_types", - actual = "//upb/upb/message:types", + actual = "//upb/message:types", visibility = ["//visibility:public"], ) alias( name = "message_value", - actual = "//upb/upb/message:value", + actual = "//upb/message:value", visibility = ["//visibility:public"], ) alias( name = "mini_descriptor", - actual = "//upb/upb/mini_descriptor", + actual = "//upb/mini_descriptor", visibility = ["//visibility:public"], ) alias( name = "mini_descriptor_internal", - actual = "//upb/upb/mini_descriptor:internal", + actual = "//upb/mini_descriptor:internal", visibility = ["//upb:__subpackages__"], ) alias( name = "mini_table", - actual = "//upb/upb/mini_table", + actual = "//upb/mini_table", visibility = ["//upb:friends"], ) alias( name = "mini_table_compat", - actual = "//upb/upb/mini_table:compat", + actual = "//upb/mini_table:compat", visibility = ["//upb:friends"], ) alias( name = "mini_table_internal", - actual = "//upb/upb/mini_table:internal", + actual = "//upb/mini_table:internal", visibility = ["//visibility:public"], ) alias( name = "port", - actual = "//upb/upb/port", + actual = "//upb/port", visibility = ["//visibility:public"], ) alias( name = "text", - actual = "//upb/upb/text", + actual = "//upb/text", visibility = ["//visibility:public"], ) alias( name = "wire", - actual = "//upb/upb/wire", + actual = "//upb/wire", visibility = ["//visibility:public"], ) alias( name = "wire_internal", - actual = "//upb/upb/wire:internal", + actual = "//upb/wire:internal", visibility = ["//visibility:public"], ) alias( name = "wire_reader", - actual = "//upb/upb/wire:reader", + actual = "//upb/wire:reader", visibility = ["//visibility:public"], ) alias( name = "wire_types", - actual = "//upb/upb/wire:types", + actual = "//upb/wire:types", visibility = ["//visibility:public"], ) alias( name = "eps_copy_input_stream", - actual = "//upb/upb/wire:eps_copy_input_stream", + actual = "//upb/wire:eps_copy_input_stream", visibility = ["//visibility:public"], ) @@ -484,10 +489,10 @@ alias( cc_test( name = "def_builder_test", srcs = [ - "upb/reflection/common.h", - "upb/reflection/def_type.h", - "upb/reflection/internal/def_builder.h", - "upb/reflection/internal/def_builder_test.cc", + "reflection/common.h", + "reflection/def_type.h", + "reflection/internal/def_builder.h", + "reflection/internal/def_builder_test.cc", ], deps = [ ":descriptor_upb_proto", @@ -496,8 +501,8 @@ cc_test( ":port", ":reflection", ":reflection_internal", - "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_absl//absl/strings", ], ) @@ -505,7 +510,7 @@ cc_test( cc_binary( name = "libupb.so", - srcs = ["upb/upb_so.c"], + srcs = ["upb_so.c"], copts = UPB_DEFAULT_COPTS + ["-DUPB_BUILD_API"], linkshared = 1, linkstatic = 1, @@ -687,25 +692,25 @@ exports_files( "third_party/lunit/console.lua", "third_party/lunit/lunit.lua", ], - visibility = ["//upb/lua:__pkg__"], + visibility = ["//lua:__pkg__"], ) filegroup( name = "source_files", srcs = glob( [ - "upb/**/*.c", - "upb/**/*.h", - "upb/**/*.hpp", + "**/*.c", + "**/*.h", + "**/*.hpp", ], exclude = [ - "upb/**/conformance_upb.c", - "upb/reflection/stage0/**/*", + "**/conformance_upb.c", + "reflection/stage0/**/*", ], ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/base/BUILD b/upb/base/BUILD similarity index 91% rename from upb/upb/base/BUILD rename to upb/base/BUILD index c64f9ad12f..54ef6d1867 100644 --- a/upb/upb/base/BUILD +++ b/upb/base/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "base", @@ -47,7 +47,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/base/descriptor_constants.h b/upb/base/descriptor_constants.h similarity index 97% rename from upb/upb/base/descriptor_constants.h rename to upb/base/descriptor_constants.h index fd6d5e0b5d..638649a9ca 100644 --- a/upb/upb/base/descriptor_constants.h +++ b/upb/base/descriptor_constants.h @@ -9,7 +9,7 @@ #define UPB_BASE_DESCRIPTOR_CONSTANTS_H_ // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // The types a field can have. Note that this list is not identical to the // types defined in descriptor.proto, which gives INT32 and SINT32 separate @@ -79,6 +79,6 @@ UPB_INLINE bool upb_FieldType_IsPackable(upb_FieldType type) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_BASE_DESCRIPTOR_CONSTANTS_H_ */ diff --git a/upb/upb/base/internal/log2.h b/upb/base/internal/log2.h similarity index 92% rename from upb/upb/base/internal/log2.h rename to upb/base/internal/log2.h index 3d5f381d5a..486e3b0e35 100644 --- a/upb/upb/base/internal/log2.h +++ b/upb/base/internal/log2.h @@ -10,7 +10,7 @@ #define UPB_BASE_INTERNAL_LOG2_H_ // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -33,6 +33,6 @@ UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); } } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_BASE_INTERNAL_LOG2_H_ */ diff --git a/upb/upb/base/status.c b/upb/base/status.c similarity index 96% rename from upb/upb/base/status.c rename to upb/base/status.c index 83f059be69..f2cd0a6229 100644 --- a/upb/upb/base/status.c +++ b/upb/base/status.c @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/base/status.h" +#include "upb/base/status.h" #include #include @@ -14,7 +14,7 @@ #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" void upb_Status_Clear(upb_Status* status) { if (!status) return; diff --git a/upb/upb/base/status.h b/upb/base/status.h similarity index 95% rename from upb/upb/base/status.h rename to upb/base/status.h index adf9f1758f..5b75f880fd 100644 --- a/upb/upb/base/status.h +++ b/upb/base/status.h @@ -11,7 +11,7 @@ #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define _kUpb_Status_MaxMessage 127 @@ -41,6 +41,6 @@ void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_BASE_STATUS_H_ */ diff --git a/upb/upb/base/status.hpp b/upb/base/status.hpp similarity index 97% rename from upb/upb/base/status.hpp rename to upb/base/status.hpp index f52ba69042..4d7152b26b 100644 --- a/upb/upb/base/status.hpp +++ b/upb/base/status.hpp @@ -8,7 +8,7 @@ #ifndef UPB_BASE_STATUS_HPP_ #define UPB_BASE_STATUS_HPP_ -#include "upb/upb/base/status.h" +#include "upb/base/status.h" namespace upb { diff --git a/upb/upb/base/string_view.h b/upb/base/string_view.h similarity index 95% rename from upb/upb/base/string_view.h rename to upb/base/string_view.h index 5d2d96731a..28b17962f5 100644 --- a/upb/upb/base/string_view.h +++ b/upb/base/string_view.h @@ -11,7 +11,7 @@ #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define UPB_STRINGVIEW_INIT(ptr, len) \ { ptr, len } @@ -53,6 +53,6 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_BASE_STRING_VIEW_H_ */ diff --git a/upb/cmake/BUILD.bazel b/upb/cmake/BUILD.bazel index c897b8fe30..b2a5e5a7f8 100644 --- a/upb/cmake/BUILD.bazel +++ b/upb/cmake/BUILD.bazel @@ -6,12 +6,12 @@ # https://developers.google.com/open-source/licenses/bsd load( - ":build_defs.bzl", - "staleness_test", + "//bazel:build_defs.bzl", + "make_shell_script", ) load( - "//upb/bazel:build_defs.bzl", - "make_shell_script", + ":build_defs.bzl", + "staleness_test", ) licenses(["notice"]) @@ -87,17 +87,17 @@ sh_test( ":copy_protos", ":gen_cmakelists", "//upb:source_files", - "//upb/upb/base:source_files", - "//upb/upb/collections:source_files", - "//upb/upb/hash:source_files", - "//upb/upb/lex:source_files", - "//upb/upb/mem:source_files", - "//upb/upb/message:source_files", - "//upb/upb/mini_descriptor:source_files", - "//upb/upb/mini_table:source_files", - "//upb/upb/port:source_files", - "//upb/upb/text:source_files", - "//upb/upb/wire:source_files", + "//upb/base:source_files", + "//upb/collections:source_files", + "//upb/hash:source_files", + "//upb/lex:source_files", + "//upb/mem:source_files", + "//upb/message:source_files", + "//upb/mini_descriptor:source_files", + "//upb/mini_table:source_files", + "//upb/port:source_files", + "//upb/text:source_files", + "//upb/wire:source_files", "@utf8_range//:utf8_range_srcs", ], target_compatible_with = select({ diff --git a/upb/upb/collections/BUILD b/upb/collections/BUILD similarity index 95% rename from upb/upb/collections/BUILD rename to upb/collections/BUILD index 66bb6193da..c043e688f2 100644 --- a/upb/upb/collections/BUILD +++ b/upb/collections/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "collections", @@ -73,9 +73,9 @@ cc_test( srcs = ["array_test.cc"], deps = [ ":collections", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:mem", - "@com_google_googletest//:gtest_main", ], ) @@ -84,9 +84,9 @@ cc_test( srcs = ["map_test.cc"], deps = [ ":collections", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:mem", - "@com_google_googletest//:gtest_main", ], ) @@ -101,7 +101,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/collections/array.c b/upb/collections/array.c similarity index 98% rename from upb/upb/collections/array.c rename to upb/collections/array.c index b51c586937..f46fc3e88f 100644 --- a/upb/upb/collections/array.c +++ b/upb/collections/array.c @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/collections/internal/array.h" +#include "upb/collections/internal/array.h" #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" const char _upb_Array_CTypeSizeLg2Table[] = { [kUpb_CType_Bool] = 0, diff --git a/upb/upb/collections/array.h b/upb/collections/array.h similarity index 94% rename from upb/upb/collections/array.h rename to upb/collections/array.h index f74c9faf71..6fb1e8f350 100644 --- a/upb/upb/collections/array.h +++ b/upb/collections/array.h @@ -33,12 +33,12 @@ #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/value.h" // IWYU pragma: export +#include "upb/base/descriptor_constants.h" +#include "upb/mem/arena.h" +#include "upb/message/value.h" // IWYU pragma: export // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct upb_Array upb_Array; @@ -93,6 +93,6 @@ UPB_API void* upb_Array_MutableDataPtr(upb_Array* arr); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_COLLECTIONS_ARRAY_H_ */ diff --git a/upb/upb/collections/array_split64.h b/upb/collections/array_split64.h similarity index 97% rename from upb/upb/collections/array_split64.h rename to upb/collections/array_split64.h index 9afd40eff6..69ea57906b 100644 --- a/upb/upb/collections/array_split64.h +++ b/upb/collections/array_split64.h @@ -31,10 +31,10 @@ #ifndef UPB_COLLECTIONS_ARRAY_SPLIT64_H_ #define UPB_COLLECTIONS_ARRAY_SPLIT64_H_ -#include "upb/upb/collections/array.h" +#include "upb/collections/array.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -88,6 +88,6 @@ UPB_API_INLINE bool upb_Array_AppendUInt64Split(upb_Array* array, uint32_t hi, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_COLLECTIONS_ARRAY_SPLIT64_H_ */ diff --git a/upb/upb/collections/array_test.cc b/upb/collections/array_test.cc similarity index 95% rename from upb/upb/collections/array_test.cc rename to upb/collections/array_test.cc index 08fcfe794f..fb1762e0d7 100644 --- a/upb/upb/collections/array_test.cc +++ b/upb/collections/array_test.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/collections/array.h" +#include "upb/collections/array.h" #include -#include "upb/upb/base/status.hpp" -#include "upb/upb/mem/arena.hpp" +#include "upb/base/status.hpp" +#include "upb/mem/arena.hpp" TEST(ArrayTest, Resize) { upb::Arena arena; diff --git a/upb/upb/collections/internal/array.h b/upb/collections/internal/array.h similarity index 97% rename from upb/upb/collections/internal/array.h rename to upb/collections/internal/array.h index 8d1d322356..1c2f3f50d0 100644 --- a/upb/upb/collections/internal/array.h +++ b/upb/collections/internal/array.h @@ -33,10 +33,10 @@ #include -#include "upb/upb/collections/array.h" +#include "upb/collections/array.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -133,6 +133,6 @@ UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_COLLECTIONS_INTERNAL_ARRAY_H_ */ diff --git a/upb/upb/collections/internal/map.h b/upb/collections/internal/map.h similarity index 96% rename from upb/upb/collections/internal/map.h rename to upb/collections/internal/map.h index b32d4486f7..b009254d9d 100644 --- a/upb/upb/collections/internal/map.h +++ b/upb/collections/internal/map.h @@ -33,13 +33,13 @@ #ifndef UPB_COLLECTIONS_INTERNAL_MAP_H_ #define UPB_COLLECTIONS_INTERNAL_MAP_H_ -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/mem/arena.h" +#include "upb/base/string_view.h" +#include "upb/collections/map.h" +#include "upb/hash/str_table.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_Map { // Size of key and val, based on the map type. @@ -168,6 +168,6 @@ upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_COLLECTIONS_INTERNAL_MAP_H_ */ diff --git a/upb/upb/collections/internal/map_entry.h b/upb/collections/internal/map_entry.h similarity index 95% rename from upb/upb/collections/internal/map_entry.h rename to upb/collections/internal/map_entry.h index 56bd44b4b1..27185447cb 100644 --- a/upb/upb/collections/internal/map_entry.h +++ b/upb/collections/internal/map_entry.h @@ -31,9 +31,9 @@ #ifndef UPB_COLLECTIONS_INTERNAL_MAP_ENTRY_H_ #define UPB_COLLECTIONS_INTERNAL_MAP_ENTRY_H_ -#include "upb/upb/base/string_view.h" -#include "upb/upb/hash/common.h" -#include "upb/upb/message/internal/types.h" +#include "upb/base/string_view.h" +#include "upb/hash/common.h" +#include "upb/message/internal/types.h" // Map entries aren't actually stored for map fields, they are only used during // parsing. For parsing, it helps a lot if all map entry messages have the same diff --git a/upb/upb/collections/internal/map_sorter.h b/upb/collections/internal/map_sorter.h similarity index 94% rename from upb/upb/collections/internal/map_sorter.h rename to upb/collections/internal/map_sorter.h index 4e1ff51b5c..a464959b79 100644 --- a/upb/upb/collections/internal/map_sorter.h +++ b/upb/collections/internal/map_sorter.h @@ -35,12 +35,12 @@ #include -#include "upb/upb/collections/internal/map.h" -#include "upb/upb/collections/internal/map_entry.h" -#include "upb/upb/message/internal/extension.h" +#include "upb/collections/internal/map.h" +#include "upb/collections/internal/map_entry.h" +#include "upb/message/internal/extension.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -107,6 +107,6 @@ bool _upb_mapsorter_pushexts(_upb_mapsorter* s, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_COLLECTIONS_INTERNAL_MAP_SORTER_H_ */ diff --git a/upb/upb/collections/map.c b/upb/collections/map.c similarity index 97% rename from upb/upb/collections/map.c rename to upb/collections/map.c index d6792ebbae..a445e591c2 100644 --- a/upb/upb/collections/map.c +++ b/upb/collections/map.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/collections/map.h" +#include "upb/collections/map.h" #include -#include "upb/upb/collections/internal/map.h" -#include "upb/upb/mem/arena.h" +#include "upb/collections/internal/map.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Strings/bytes are special-cased in maps. char _upb_Map_CTypeSizeTable[12] = { diff --git a/upb/upb/collections/map.h b/upb/collections/map.h similarity index 96% rename from upb/upb/collections/map.h rename to upb/collections/map.h index e2b58cb279..9377eaca49 100644 --- a/upb/upb/collections/map.h +++ b/upb/collections/map.h @@ -33,12 +33,12 @@ #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/value.h" // IWYU pragma: export +#include "upb/base/descriptor_constants.h" +#include "upb/mem/arena.h" +#include "upb/message/value.h" // IWYU pragma: export // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct upb_Map upb_Map; @@ -142,6 +142,6 @@ UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_COLLECTIONS_MAP_H_ */ diff --git a/upb/upb/collections/map_gencode_util.h b/upb/collections/map_gencode_util.h similarity index 96% rename from upb/upb/collections/map_gencode_util.h rename to upb/collections/map_gencode_util.h index 135ec6233b..c6df5451c1 100644 --- a/upb/upb/collections/map_gencode_util.h +++ b/upb/collections/map_gencode_util.h @@ -33,10 +33,10 @@ #ifndef UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ #define UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ -#include "upb/upb/collections/internal/map.h" +#include "upb/collections/internal/map.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -76,6 +76,6 @@ UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ */ diff --git a/upb/upb/collections/map_sorter.c b/upb/collections/map_sorter.c similarity index 97% rename from upb/upb/collections/map_sorter.c rename to upb/collections/map_sorter.c index 8725cd661e..9ad2a66087 100644 --- a/upb/upb/collections/map_sorter.c +++ b/upb/collections/map_sorter.c @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/collections/internal/map_sorter.h" +#include "upb/collections/internal/map_sorter.h" -#include "upb/upb/base/internal/log2.h" +#include "upb/base/internal/log2.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" static void _upb_mapsorter_getkeys(const void* _a, const void* _b, void* a_key, void* b_key, size_t size) { diff --git a/upb/upb/collections/map_test.cc b/upb/collections/map_test.cc similarity index 95% rename from upb/upb/collections/map_test.cc rename to upb/collections/map_test.cc index 1a30456653..0a2400092e 100644 --- a/upb/upb/collections/map_test.cc +++ b/upb/collections/map_test.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/collections/map.h" +#include "upb/collections/map.h" #include -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.hpp" +#include "upb/base/string_view.h" +#include "upb/mem/arena.hpp" TEST(MapTest, DeleteRegression) { upb::Arena arena; diff --git a/upb/upb/conformance/BUILD b/upb/conformance/BUILD similarity index 98% rename from upb/upb/conformance/BUILD rename to upb/conformance/BUILD index a8b63ab110..c22ea41301 100644 --- a/upb/upb/conformance/BUILD +++ b/upb/conformance/BUILD @@ -6,12 +6,12 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "make_shell_script", ) load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) diff --git a/upb/upb/conformance/conformance_upb.c b/upb/conformance/conformance_upb.c similarity index 97% rename from upb/upb/conformance/conformance_upb.c rename to upb/conformance/conformance_upb.c index 47104051e9..a91224bf35 100644 --- a/upb/upb/conformance/conformance_upb.c +++ b/upb/conformance/conformance_upb.c @@ -18,15 +18,15 @@ #include "conformance/conformance.upbdefs.h" #include "google/protobuf/test_messages_proto2.upbdefs.h" #include "google/protobuf/test_messages_proto3.upbdefs.h" -#include "upb/upb/json/decode.h" -#include "upb/upb/json/encode.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/text/encode.h" -#include "upb/upb/wire/decode.h" -#include "upb/upb/wire/encode.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/reflection/message.h" +#include "upb/text/encode.h" +#include "upb/wire/decode.h" +#include "upb/wire/encode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" int test_count = 0; bool verbose = false; /* Set to true to get req/resp printed on stderr. */ diff --git a/upb/upb/conformance/conformance_upb_failures.txt b/upb/conformance/conformance_upb_failures.txt similarity index 100% rename from upb/upb/conformance/conformance_upb_failures.txt rename to upb/conformance/conformance_upb_failures.txt diff --git a/upb/generated_code_support.h b/upb/generated_code_support.h new file mode 100644 index 0000000000..9f222cc418 --- /dev/null +++ b/upb/generated_code_support.h @@ -0,0 +1,33 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2023 Google LLC. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +#ifndef UPB_GENERATED_CODE_SUPPORT_H_ +#define UPB_GENERATED_CODE_SUPPORT_H_ + +// IWYU pragma: begin_exports +#include "upb/collections/array.h" +#include "upb/collections/internal/array.h" +#include "upb/collections/map_gencode_util.h" +#include "upb/message/accessors.h" +#include "upb/message/internal/accessors.h" +#include "upb/message/internal/extension.h" +#include "upb/message/internal/message.h" +#include "upb/message/message.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/mini_table/enum.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/extension_registry.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/file.h" +#include "upb/mini_table/message.h" +#include "upb/mini_table/sub.h" +#include "upb/wire/decode.h" +#include "upb/wire/decode_fast.h" +#include "upb/wire/encode.h" +// IWYU pragma: end_exports + +#endif // UPB_GENERATED_CODE_SUPPORT_H_ diff --git a/upb/upb/hash/BUILD b/upb/hash/BUILD similarity index 91% rename from upb/upb/hash/BUILD rename to upb/hash/BUILD index a83ee68f6a..4c18e0cc4d 100644 --- a/upb/upb/hash/BUILD +++ b/upb/hash/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "hash", @@ -32,10 +32,10 @@ cc_test( srcs = ["test.cc"], deps = [ ":hash", + "@com_google_googletest//:gtest_main", "//upb:mem", "//upb:port", "@com_google_absl//absl/container:flat_hash_map", - "@com_google_googletest//:gtest_main", ], ) @@ -50,7 +50,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/hash/common.c b/upb/hash/common.c similarity index 99% rename from upb/upb/hash/common.c rename to upb/hash/common.c index f0622fb773..f8bb7fc00a 100644 --- a/upb/upb/hash/common.c +++ b/upb/hash/common.c @@ -13,12 +13,12 @@ #include -#include "upb/upb/base/internal/log2.h" -#include "upb/upb/hash/int_table.h" -#include "upb/upb/hash/str_table.h" +#include "upb/base/internal/log2.h" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define UPB_MAXARRSIZE 16 // 2**16 = 64k. diff --git a/upb/upb/hash/common.h b/upb/hash/common.h similarity index 97% rename from upb/upb/hash/common.h rename to upb/hash/common.h index c972f3ec5a..889d375657 100644 --- a/upb/upb/hash/common.h +++ b/upb/hash/common.h @@ -29,11 +29,11 @@ #include -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -169,6 +169,6 @@ uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_HASH_COMMON_H_ */ diff --git a/upb/upb/hash/int_table.h b/upb/hash/int_table.h similarity index 96% rename from upb/upb/hash/int_table.h rename to upb/hash/int_table.h index 3986d6468a..f7a41ea9f7 100644 --- a/upb/upb/hash/int_table.h +++ b/upb/hash/int_table.h @@ -8,10 +8,10 @@ #ifndef UPB_HASH_INT_TABLE_H_ #define UPB_HASH_INT_TABLE_H_ -#include "upb/upb/hash/common.h" +#include "upb/hash/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { upb_table t; // For entries that don't fit in the array part. @@ -77,6 +77,6 @@ void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_HASH_INT_TABLE_H_ */ diff --git a/upb/upb/hash/str_table.h b/upb/hash/str_table.h similarity index 97% rename from upb/upb/hash/str_table.h rename to upb/hash/str_table.h index 5ead44557e..c90c1e973a 100644 --- a/upb/upb/hash/str_table.h +++ b/upb/hash/str_table.h @@ -8,10 +8,10 @@ #ifndef UPB_HASH_STR_TABLE_H_ #define UPB_HASH_STR_TABLE_H_ -#include "upb/upb/hash/common.h" +#include "upb/hash/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { upb_table t; @@ -137,6 +137,6 @@ bool upb_strtable_iter_isequal(const upb_strtable_iter* i1, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_HASH_STR_TABLE_H_ */ diff --git a/upb/upb/hash/test.cc b/upb/hash/test.cc similarity index 98% rename from upb/upb/hash/test.cc rename to upb/hash/test.cc index f0dcbee7fb..e85940bb3d 100644 --- a/upb/upb/hash/test.cc +++ b/upb/hash/test.cc @@ -18,12 +18,12 @@ #include #include "absl/container/flat_hash_map.h" -#include "upb/upb/hash/int_table.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/mem/arena.hpp" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/mem/arena.hpp" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" using std::vector; diff --git a/upb/upb/io/BUILD b/upb/io/BUILD similarity index 100% rename from upb/upb/io/BUILD rename to upb/io/BUILD index 9874948ed2..31648646ba 100644 --- a/upb/upb/io/BUILD +++ b/upb/io/BUILD @@ -64,8 +64,8 @@ cc_test( srcs = ["string_test.cc"], deps = [ ":string", - "//upb:mem", "@com_google_googletest//:gtest_main", + "//upb:mem", ], ) @@ -78,12 +78,12 @@ cc_test( ":string", ":tokenizer", ":zero_copy_stream", + "@com_google_googletest//:gtest_main", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:str_format", "//upb:lex", "//upb:mem", "//upb:port", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", - "@com_google_googletest//:gtest_main", ], ) @@ -96,8 +96,8 @@ cc_test( deps = [ ":chunked_stream", ":zero_copy_stream", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:mem", - "@com_google_googletest//:gtest_main", ], ) diff --git a/upb/upb/io/README.md b/upb/io/README.md similarity index 100% rename from upb/upb/io/README.md rename to upb/io/README.md diff --git a/upb/upb/io/chunked_input_stream.c b/upb/io/chunked_input_stream.c similarity index 97% rename from upb/upb/io/chunked_input_stream.c rename to upb/io/chunked_input_stream.c index 5a3af240fb..0493cf59b1 100644 --- a/upb/upb/io/chunked_input_stream.c +++ b/upb/io/chunked_input_stream.c @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/io/chunked_input_stream.h" +#include "upb/io/chunked_input_stream.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { upb_ZeroCopyInputStream base; diff --git a/upb/upb/io/chunked_input_stream.h b/upb/io/chunked_input_stream.h similarity index 85% rename from upb/upb/io/chunked_input_stream.h rename to upb/io/chunked_input_stream.h index 610f1fb3cf..e872075c6c 100644 --- a/upb/upb/io/chunked_input_stream.h +++ b/upb/io/chunked_input_stream.h @@ -8,11 +8,11 @@ #ifndef UPB_IO_CHUNKED_INPUT_STREAM_H_ #define UPB_IO_CHUNKED_INPUT_STREAM_H_ -#include "upb/upb/io/zero_copy_input_stream.h" -#include "upb/upb/mem/arena.h" +#include "upb/io/zero_copy_input_stream.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -28,6 +28,6 @@ upb_ZeroCopyInputStream* upb_ChunkedInputStream_New(const void* data, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_IO_CHUNKED_INPUT_STREAM_H_ */ diff --git a/upb/upb/io/chunked_output_stream.c b/upb/io/chunked_output_stream.c similarity index 96% rename from upb/upb/io/chunked_output_stream.c rename to upb/io/chunked_output_stream.c index 0a2891d63c..a960fbf665 100644 --- a/upb/upb/io/chunked_output_stream.c +++ b/upb/io/chunked_output_stream.c @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/io/chunked_output_stream.h" +#include "upb/io/chunked_output_stream.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { upb_ZeroCopyOutputStream base; diff --git a/upb/upb/io/chunked_output_stream.h b/upb/io/chunked_output_stream.h similarity index 85% rename from upb/upb/io/chunked_output_stream.h rename to upb/io/chunked_output_stream.h index d3af9fe1fd..2e1e31f4fb 100644 --- a/upb/upb/io/chunked_output_stream.h +++ b/upb/io/chunked_output_stream.h @@ -8,11 +8,11 @@ #ifndef UPB_IO_CHUNKED_OUTPUT_STREAM_H_ #define UPB_IO_CHUNKED_OUTPUT_STREAM_H_ -#include "upb/upb/io/zero_copy_output_stream.h" -#include "upb/upb/mem/arena.h" +#include "upb/io/zero_copy_output_stream.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -28,6 +28,6 @@ upb_ZeroCopyOutputStream* upb_ChunkedOutputStream_New(void* data, size_t size, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_IO_CHUNKED_OUTPUT_STREAM_H_ */ diff --git a/upb/upb/io/string.h b/upb/io/string.h similarity index 96% rename from upb/upb/io/string.h rename to upb/io/string.h index a56f25b44c..ffaffb009b 100644 --- a/upb/upb/io/string.h +++ b/upb/io/string.h @@ -18,11 +18,11 @@ #include #include -#include "upb/upb/mem/arena.h" -#include "upb/upb/port/vsnprintf_compat.h" +#include "upb/mem/arena.h" +#include "upb/port/vsnprintf_compat.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -142,6 +142,6 @@ UPB_INLINE bool upb_String_PushBack(upb_String* s, char ch) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_IO_STRING_H_ */ diff --git a/upb/upb/io/string_test.cc b/upb/io/string_test.cc similarity index 98% rename from upb/upb/io/string_test.cc rename to upb/io/string_test.cc index 36f48c692c..dcdaa4d77f 100644 --- a/upb/upb/io/string_test.cc +++ b/upb/io/string_test.cc @@ -5,12 +5,12 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/io/string.h" +#include "upb/io/string.h" #include #include -#include "upb/upb/mem/arena.hpp" +#include "upb/mem/arena.hpp" TEST(StringTest, Append) { upb::Arena arena; diff --git a/upb/upb/io/tokenizer.c b/upb/io/tokenizer.c similarity index 99% rename from upb/upb/io/tokenizer.c rename to upb/io/tokenizer.c index 2eafda0103..cfc1d400f7 100644 --- a/upb/upb/io/tokenizer.c +++ b/upb/io/tokenizer.c @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/io/tokenizer.h" +#include "upb/io/tokenizer.h" -#include "upb/upb/io/string.h" -#include "upb/upb/lex/strtod.h" -#include "upb/upb/lex/unicode.h" +#include "upb/io/string.h" +#include "upb/lex/strtod.h" +#include "upb/lex/unicode.h" // Must be included last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef enum { // Started a line comment. diff --git a/upb/upb/io/tokenizer.h b/upb/io/tokenizer.h similarity index 95% rename from upb/upb/io/tokenizer.h rename to upb/io/tokenizer.h index 993c204394..3ef7f30a6e 100644 --- a/upb/upb/io/tokenizer.h +++ b/upb/io/tokenizer.h @@ -10,13 +10,13 @@ #ifndef UPB_IO_TOKENIZER_H_ #define UPB_IO_TOKENIZER_H_ -#include "upb/upb/base/status.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/io/zero_copy_input_stream.h" -#include "upb/upb/mem/arena.h" +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/io/zero_copy_input_stream.h" +#include "upb/mem/arena.h" // Must be included last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -128,6 +128,6 @@ upb_StringView upb_Parse_String(const char* text, upb_Arena* arena); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_IO_TOKENIZER_H_ diff --git a/upb/upb/io/tokenizer_test.cc b/upb/io/tokenizer_test.cc similarity index 99% rename from upb/upb/io/tokenizer_test.cc rename to upb/io/tokenizer_test.cc index e7c24f7a95..70027d356b 100644 --- a/upb/upb/io/tokenizer_test.cc +++ b/upb/io/tokenizer_test.cc @@ -5,18 +5,18 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/io/tokenizer.h" +#include "upb/io/tokenizer.h" #include #include "absl/strings/escaping.h" #include "absl/strings/str_format.h" -#include "upb/upb/io/chunked_input_stream.h" -#include "upb/upb/io/string.h" -#include "upb/upb/lex/unicode.h" -#include "upb/upb/mem/arena.hpp" +#include "upb/io/chunked_input_stream.h" +#include "upb/io/string.h" +#include "upb/lex/unicode.h" +#include "upb/mem/arena.hpp" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace google { namespace protobuf { diff --git a/upb/upb/io/zero_copy_input_stream.h b/upb/io/zero_copy_input_stream.h similarity index 97% rename from upb/upb/io/zero_copy_input_stream.h rename to upb/io/zero_copy_input_stream.h index e8bd38016e..e5b05ec2fd 100644 --- a/upb/upb/io/zero_copy_input_stream.h +++ b/upb/io/zero_copy_input_stream.h @@ -8,10 +8,10 @@ #ifndef UPB_IO_ZERO_COPY_INPUT_STREAM_H_ #define UPB_IO_ZERO_COPY_INPUT_STREAM_H_ -#include "upb/upb/base/status.h" +#include "upb/base/status.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -104,6 +104,6 @@ upb_ZeroCopyInputStream_ByteCount(const upb_ZeroCopyInputStream* z) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_IO_ZERO_COPY_INPUT_STREAM_H_ */ diff --git a/upb/upb/io/zero_copy_output_stream.h b/upb/io/zero_copy_output_stream.h similarity index 97% rename from upb/upb/io/zero_copy_output_stream.h rename to upb/io/zero_copy_output_stream.h index e63855ca8b..dae386a4e3 100644 --- a/upb/upb/io/zero_copy_output_stream.h +++ b/upb/io/zero_copy_output_stream.h @@ -8,10 +8,10 @@ #ifndef UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ #define UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ -#include "upb/upb/base/status.h" +#include "upb/base/status.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -105,6 +105,6 @@ upb_ZeroCopyOutputStream_ByteCount(const upb_ZeroCopyOutputStream* z) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ */ diff --git a/upb/upb/io/zero_copy_stream_test.cc b/upb/io/zero_copy_stream_test.cc similarity index 98% rename from upb/upb/io/zero_copy_stream_test.cc rename to upb/io/zero_copy_stream_test.cc index 991e7dd706..392d924848 100644 --- a/upb/upb/io/zero_copy_stream_test.cc +++ b/upb/io/zero_copy_stream_test.cc @@ -15,10 +15,10 @@ // the output. #include -#include "upb/upb/base/status.hpp" -#include "upb/upb/io/chunked_input_stream.h" -#include "upb/upb/io/chunked_output_stream.h" -#include "upb/upb/mem/arena.hpp" +#include "upb/base/status.hpp" +#include "upb/io/chunked_input_stream.h" +#include "upb/io/chunked_output_stream.h" +#include "upb/mem/arena.hpp" namespace upb { namespace { diff --git a/upb/upb/json/BUILD b/upb/json/BUILD similarity index 94% rename from upb/upb/json/BUILD rename to upb/json/BUILD index 2a75d35245..fc09d39397 100644 --- a/upb/upb/json/BUILD +++ b/upb/json/BUILD @@ -1,8 +1,8 @@ # TODO: describe this package. -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -36,9 +36,9 @@ cc_test( ":struct_upb_proto", ":test_upb_proto", ":test_upb_proto_reflection", + "@com_google_googletest//:gtest_main", "//upb:mem", "//upb:reflection", - "@com_google_googletest//:gtest_main", ], ) @@ -50,10 +50,10 @@ cc_test( ":struct_upb_proto", ":test_upb_proto", ":test_upb_proto_reflection", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:mem", "//upb:reflection", - "@com_google_googletest//:gtest_main", ], ) diff --git a/upb/upb/json/decode.c b/upb/json/decode.c similarity index 99% rename from upb/upb/json/decode.c rename to upb/json/decode.c index 06fd267e6c..0f4346bb71 100644 --- a/upb/upb/json/decode.c +++ b/upb/json/decode.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/json/decode.h" +#include "upb/json/decode.h" #include #include @@ -38,14 +38,14 @@ #include #include -#include "upb/upb/collections/map.h" -#include "upb/upb/lex/atoi.h" -#include "upb/upb/lex/unicode.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/wire/encode.h" +#include "upb/collections/map.h" +#include "upb/lex/atoi.h" +#include "upb/lex/unicode.h" +#include "upb/reflection/message.h" +#include "upb/wire/encode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { const char *ptr, *end; diff --git a/upb/upb/json/decode.h b/upb/json/decode.h similarity index 95% rename from upb/upb/json/decode.h rename to upb/json/decode.h index 52882a9bc1..8f5879738a 100644 --- a/upb/upb/json/decode.h +++ b/upb/json/decode.h @@ -31,10 +31,10 @@ #ifndef UPB_JSON_DECODE_H_ #define UPB_JSON_DECODE_H_ -#include "upb/upb/reflection/def.h" +#include "upb/reflection/def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -50,6 +50,6 @@ UPB_API bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_JSONDECODE_H_ */ diff --git a/upb/upb/json/decode_test.cc b/upb/json/decode_test.cc similarity index 94% rename from upb/upb/json/decode_test.cc rename to upb/json/decode_test.cc index 1f4df2de71..75fa9bea42 100644 --- a/upb/upb/json/decode_test.cc +++ b/upb/json/decode_test.cc @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/json/decode.h" +#include "upb/json/decode.h" #include "google/protobuf/struct.upb.h" #include -#include "upb/upb/json/test.upb.h" -#include "upb/upb/json/test.upbdefs.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/reflection/def.hpp" +#include "upb/json/test.upb.h" +#include "upb/json/test.upbdefs.h" +#include "upb/mem/arena.hpp" +#include "upb/reflection/def.hpp" static upb_test_Box* JsonDecode(const char* json, upb_Arena* a) { upb::Status status; diff --git a/upb/upb/json/encode.c b/upb/json/encode.c similarity index 98% rename from upb/upb/json/encode.c rename to upb/json/encode.c index b103a64f00..656bee958c 100644 --- a/upb/upb/json/encode.c +++ b/upb/json/encode.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/json/encode.h" +#include "upb/json/encode.h" #include #include @@ -37,14 +37,14 @@ #include #include -#include "upb/upb/collections/map.h" -#include "upb/upb/lex/round_trip.h" -#include "upb/upb/port/vsnprintf_compat.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/wire/decode.h" +#include "upb/collections/map.h" +#include "upb/lex/round_trip.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/message.h" +#include "upb/wire/decode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { char *buf, *ptr, *end; diff --git a/upb/upb/json/encode.h b/upb/json/encode.h similarity index 96% rename from upb/upb/json/encode.h rename to upb/json/encode.h index 34c1551566..ec8b25b3e4 100644 --- a/upb/upb/json/encode.h +++ b/upb/json/encode.h @@ -31,10 +31,10 @@ #ifndef UPB_JSON_ENCODE_H_ #define UPB_JSON_ENCODE_H_ -#include "upb/upb/reflection/def.h" +#include "upb/reflection/def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -68,6 +68,6 @@ UPB_API size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_JSONENCODE_H_ */ diff --git a/upb/upb/json/encode_test.cc b/upb/json/encode_test.cc similarity index 94% rename from upb/upb/json/encode_test.cc rename to upb/json/encode_test.cc index c7c48b2cfa..67adcc0059 100644 --- a/upb/upb/json/encode_test.cc +++ b/upb/json/encode_test.cc @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upb/json/encode.h" +#include "upb/json/encode.h" #include "google/protobuf/struct.upb.h" #include -#include "upb/upb/base/status.hpp" -#include "upb/upb/json/test.upb.h" -#include "upb/upb/json/test.upbdefs.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/reflection/def.hpp" +#include "upb/base/status.hpp" +#include "upb/json/test.upb.h" +#include "upb/json/test.upbdefs.h" +#include "upb/mem/arena.hpp" +#include "upb/reflection/def.hpp" static std::string JsonEncode(const upb_test_Box* msg, int options) { upb::Arena a; diff --git a/upb/upb/json/test.proto b/upb/json/test.proto similarity index 100% rename from upb/upb/json/test.proto rename to upb/json/test.proto diff --git a/upb/upb/lex/BUILD b/upb/lex/BUILD similarity index 91% rename from upb/upb/lex/BUILD rename to upb/lex/BUILD index c40c362708..664074b85f 100644 --- a/upb/upb/lex/BUILD +++ b/upb/lex/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "lex", @@ -31,8 +31,8 @@ cc_test( srcs = ["atoi_test.cc"], deps = [ ":lex", - "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_absl//absl/strings", ], ) @@ -47,7 +47,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/lex/atoi.c b/upb/lex/atoi.c similarity index 94% rename from upb/upb/lex/atoi.c rename to upb/lex/atoi.c index 76312fc487..720aacf29b 100644 --- a/upb/upb/lex/atoi.c +++ b/upb/lex/atoi.c @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/lex/atoi.h" +#include "upb/lex/atoi.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val) { uint64_t u64 = 0; diff --git a/upb/upb/lex/atoi.h b/upb/lex/atoi.h similarity index 93% rename from upb/upb/lex/atoi.h rename to upb/lex/atoi.h index 8d9c601063..6d57fa07f7 100644 --- a/upb/upb/lex/atoi.h +++ b/upb/lex/atoi.h @@ -11,7 +11,7 @@ #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -30,6 +30,6 @@ const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_LEX_ATOI_H_ */ diff --git a/upb/upb/lex/atoi_test.cc b/upb/lex/atoi_test.cc similarity index 98% rename from upb/upb/lex/atoi_test.cc rename to upb/lex/atoi_test.cc index c0608d8fea..bf5547afab 100644 --- a/upb/upb/lex/atoi_test.cc +++ b/upb/lex/atoi_test.cc @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/lex/atoi.h" +#include "upb/lex/atoi.h" #include #include "absl/strings/str_cat.h" diff --git a/upb/upb/lex/round_trip.c b/upb/lex/round_trip.c similarity index 95% rename from upb/upb/lex/round_trip.c rename to upb/lex/round_trip.c index 4341af6d26..13104341b1 100644 --- a/upb/upb/lex/round_trip.c +++ b/upb/lex/round_trip.c @@ -5,13 +5,13 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/lex/round_trip.h" +#include "upb/lex/round_trip.h" #include #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" /* Miscellaneous utilities ****************************************************/ diff --git a/upb/upb/lex/round_trip.h b/upb/lex/round_trip.h similarity index 93% rename from upb/upb/lex/round_trip.h rename to upb/lex/round_trip.h index f50a9c7f2e..0306c4494d 100644 --- a/upb/upb/lex/round_trip.h +++ b/upb/lex/round_trip.h @@ -9,7 +9,7 @@ #define UPB_LEX_ROUND_TRIP_H_ // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Encodes a float or double that is round-trippable, but as short as possible. // These routines are not fully optimal (not guaranteed to be shortest), but are @@ -30,6 +30,6 @@ void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_LEX_ROUND_TRIP_H_ */ diff --git a/upb/upb/lex/strtod.c b/upb/lex/strtod.c similarity index 97% rename from upb/upb/lex/strtod.c rename to upb/lex/strtod.c index f2cb22ccb6..d59e369934 100644 --- a/upb/upb/lex/strtod.c +++ b/upb/lex/strtod.c @@ -5,13 +5,13 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/lex/strtod.h" +#include "upb/lex/strtod.h" #include #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Determine the locale-specific radix character by calling sprintf() to print // the number 1.5, then stripping off the digits. As far as I can tell, this diff --git a/upb/upb/lex/strtod.h b/upb/lex/strtod.h similarity index 88% rename from upb/upb/lex/strtod.h rename to upb/lex/strtod.h index 09a49e4f0e..86b18dbcbe 100644 --- a/upb/upb/lex/strtod.h +++ b/upb/lex/strtod.h @@ -9,7 +9,7 @@ #define UPB_LEX_STRTOD_H_ // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -21,6 +21,6 @@ double _upb_NoLocaleStrtod(const char *str, char **endptr); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_LEX_STRTOD_H_ */ diff --git a/upb/upb/lex/unicode.c b/upb/lex/unicode.c similarity index 92% rename from upb/upb/lex/unicode.c rename to upb/lex/unicode.c index 5d7404fdec..53121e9775 100644 --- a/upb/upb/lex/unicode.c +++ b/upb/lex/unicode.c @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/lex/unicode.h" +#include "upb/lex/unicode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" int upb_Unicode_ToUTF8(uint32_t cp, char* out) { if (cp <= 0x7f) { diff --git a/upb/upb/lex/unicode.h b/upb/lex/unicode.h similarity index 96% rename from upb/upb/lex/unicode.h rename to upb/lex/unicode.h index 76ae481e44..9b8a4051e7 100644 --- a/upb/upb/lex/unicode.h +++ b/upb/lex/unicode.h @@ -11,7 +11,7 @@ #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -54,6 +54,6 @@ int upb_Unicode_ToUTF8(uint32_t cp, char* out); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_LEX_UNICODE_H_ */ diff --git a/upb/upb/mem/BUILD b/upb/mem/BUILD similarity index 93% rename from upb/upb/mem/BUILD rename to upb/mem/BUILD index 0584e6c8e5..71e007e544 100644 --- a/upb/upb/mem/BUILD +++ b/upb/mem/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "mem", @@ -44,12 +44,12 @@ cc_test( name = "arena_test", srcs = ["arena_test.cc"], deps = [ + "@com_google_googletest//:gtest_main", "//upb:mem", "//upb:port", "@com_google_absl//absl/random", "@com_google_absl//absl/random:distributions", "@com_google_absl//absl/synchronization", - "@com_google_googletest//:gtest_main", ], ) @@ -65,7 +65,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/mem/alloc.c b/upb/mem/alloc.c similarity index 91% rename from upb/upb/mem/alloc.c rename to upb/mem/alloc.c index 4e5f9f6595..d103f98f30 100644 --- a/upb/upb/mem/alloc.c +++ b/upb/mem/alloc.c @@ -5,12 +5,12 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mem/alloc.h" +#include "upb/mem/alloc.h" #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" static void* upb_global_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize, size_t size) { diff --git a/upb/upb/mem/alloc.h b/upb/mem/alloc.h similarity index 97% rename from upb/upb/mem/alloc.h rename to upb/mem/alloc.h index ed6ec485e9..441731d2d8 100644 --- a/upb/upb/mem/alloc.h +++ b/upb/mem/alloc.h @@ -9,7 +9,7 @@ #define UPB_MEM_ALLOC_H_ // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -73,6 +73,6 @@ UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); } } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MEM_ALLOC_H_ */ diff --git a/upb/upb/mem/arena.c b/upb/mem/arena.c similarity index 99% rename from upb/upb/mem/arena.c rename to upb/mem/arena.c index e72a86c317..7e34f86ee4 100644 --- a/upb/upb/mem/arena.c +++ b/upb/mem/arena.c @@ -5,12 +5,12 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mem/internal/arena.h" +#include "upb/mem/internal/arena.h" -#include "upb/upb/port/atomic.h" +#include "upb/port/atomic.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct _upb_MemBlock { // Atomic only for the benefit of SpaceAllocated(). diff --git a/upb/upb/mem/arena.h b/upb/mem/arena.h similarity index 97% rename from upb/upb/mem/arena.h rename to upb/mem/arena.h index 3e4451a6bb..e7fd852ff9 100644 --- a/upb/upb/mem/arena.h +++ b/upb/mem/arena.h @@ -24,10 +24,10 @@ #include #include -#include "upb/upb/mem/alloc.h" +#include "upb/mem/alloc.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct upb_Arena upb_Arena; @@ -124,6 +124,6 @@ UPB_API_INLINE upb_Arena* upb_Arena_New(void) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MEM_ARENA_H_ */ diff --git a/upb/upb/mem/arena.hpp b/upb/mem/arena.hpp similarity index 97% rename from upb/upb/mem/arena.hpp rename to upb/mem/arena.hpp index 2520b426cd..4a0bc330f4 100644 --- a/upb/upb/mem/arena.hpp +++ b/upb/mem/arena.hpp @@ -10,7 +10,7 @@ #include -#include "upb/upb/mem/arena.h" +#include "upb/mem/arena.h" namespace upb { diff --git a/upb/upb/mem/arena_test.cc b/upb/mem/arena_test.cc similarity index 98% rename from upb/upb/mem/arena_test.cc rename to upb/mem/arena_test.cc index 392c7be5c8..7020da1344 100644 --- a/upb/upb/mem/arena_test.cc +++ b/upb/mem/arena_test.cc @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mem/arena.h" +#include "upb/mem/arena.h" #include #include @@ -19,7 +19,7 @@ #include "absl/synchronization/notification.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace { diff --git a/upb/upb/mem/internal/arena.h b/upb/mem/internal/arena.h similarity index 96% rename from upb/upb/mem/internal/arena.h rename to upb/mem/internal/arena.h index 9ceb026397..21741c53ba 100644 --- a/upb/upb/mem/internal/arena.h +++ b/upb/mem/internal/arena.h @@ -8,10 +8,10 @@ #ifndef UPB_MEM_INTERNAL_ARENA_H_ #define UPB_MEM_INTERNAL_ARENA_H_ -#include "upb/upb/mem/arena.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct _upb_MemBlock _upb_MemBlock; @@ -89,6 +89,6 @@ UPB_INLINE bool upb_Arena_HasInitialBlock(upb_Arena* arena) { return arena->block_alloc & 0x1; } -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MEM_INTERNAL_ARENA_H_ */ diff --git a/upb/upb/message/BUILD b/upb/message/BUILD similarity index 90% rename from upb/upb/message/BUILD rename to upb/message/BUILD index 1ec9d955cd..78b9c033c4 100644 --- a/upb/upb/message/BUILD +++ b/upb/message/BUILD @@ -5,9 +5,9 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -232,6 +232,7 @@ cc_test( deps = [ ":accessors", "//:protobuf", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:collections", "//upb:mini_descriptor", @@ -239,11 +240,10 @@ cc_test( "//upb:mini_table", "//upb:port", "//upb:wire", - "//upb/upb/test:test_messages_proto2_upb_proto", - "//upb/upb/test:test_messages_proto3_upb_proto", - "//upb/upb/test:test_upb_proto", + "//upb/test:test_messages_proto2_upb_proto", + "//upb/test:test_messages_proto3_upb_proto", + "//upb/test:test_upb_proto", "@com_google_absl//absl/container:flat_hash_set", - "@com_google_googletest//:gtest_main", ], ) @@ -256,16 +256,16 @@ cc_test( ":internal", ":message", "//:protobuf", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:collections", "//upb:mem", "//upb:mini_table", "//upb:wire", - "//upb/upb/test:test_messages_proto2_upb_proto", - "//upb/upb/test:test_messages_proto3_upb_proto", - "//upb/upb/test:test_upb_proto", + "//upb/test:test_messages_proto2_upb_proto", + "//upb/test:test_messages_proto3_upb_proto", + "//upb/test:test_upb_proto", "@com_google_absl//absl/container:flat_hash_set", - "@com_google_googletest//:gtest_main", ], ) @@ -277,6 +277,7 @@ cc_test( ":copy", ":promote", "//:protobuf", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:collections", "//upb:mem", @@ -284,11 +285,10 @@ cc_test( "//upb:mini_table", "//upb:port", "//upb:wire", - "//upb/upb/test:test_messages_proto2_upb_proto", - "//upb/upb/test:test_messages_proto3_upb_proto", - "//upb/upb/test:test_upb_proto", + "//upb/test:test_messages_proto2_upb_proto", + "//upb/test:test_messages_proto3_upb_proto", + "//upb/test:test_upb_proto", "@com_google_absl//absl/container:flat_hash_set", - "@com_google_googletest//:gtest_main", ], ) @@ -300,14 +300,14 @@ cc_test( deps = [ ":message_test_upb_proto", ":message_test_upb_proto_reflection", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:json", "//upb:mem", "//upb:reflection", "//upb:wire", - "//upb/upb/test:fuzz_util", - "//upb/upb/test:test_messages_proto3_upb_proto", - "@com_google_googletest//:gtest_main", + "//upb/test:fuzz_util", + "//upb/test:test_messages_proto3_upb_proto", ], ) @@ -329,10 +329,10 @@ cc_test( srcs = ["utf8_test.cc"], deps = [ ":utf8_test_upb_proto", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:mem", "//upb:wire", - "@com_google_googletest//:gtest_main", ], ) @@ -347,7 +347,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/message/accessors.c b/upb/message/accessors.c similarity index 85% rename from upb/upb/message/accessors.c rename to upb/message/accessors.c index 8d8c2878d0..f3969a9e58 100644 --- a/upb/upb/message/accessors.c +++ b/upb/message/accessors.c @@ -5,20 +5,20 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/message/accessors.h" +#include "upb/message/accessors.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/internal/array.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/wire/decode.h" -#include "upb/upb/wire/encode.h" -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/reader.h" +#include "upb/collections/array.h" +#include "upb/collections/internal/array.h" +#include "upb/collections/map.h" +#include "upb/message/message.h" +#include "upb/mini_table/field.h" +#include "upb/wire/decode.h" +#include "upb/wire/encode.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map, const upb_MiniTable* mini_table, diff --git a/upb/upb/message/accessors.h b/upb/message/accessors.h similarity index 97% rename from upb/upb/message/accessors.h rename to upb/message/accessors.h index 9fe6ab1ba5..14896a06d0 100644 --- a/upb/upb/message/accessors.h +++ b/upb/message/accessors.h @@ -8,18 +8,18 @@ #ifndef UPB_MESSAGE_ACCESSORS_H_ #define UPB_MESSAGE_ACCESSORS_H_ -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/internal/array.h" -#include "upb/upb/collections/internal/map.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/message/internal/accessors.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/mini_table/enum.h" -#include "upb/upb/mini_table/field.h" +#include "upb/base/descriptor_constants.h" +#include "upb/collections/array.h" +#include "upb/collections/internal/array.h" +#include "upb/collections/internal/map.h" +#include "upb/collections/map.h" +#include "upb/message/internal/accessors.h" +#include "upb/message/internal/message.h" +#include "upb/mini_table/enum.h" +#include "upb/mini_table/field.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -375,6 +375,6 @@ bool upb_Message_IsExactlyEqual(const upb_Message* m1, const upb_Message* m2, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MESSAGE_ACCESSORS_H_ diff --git a/upb/upb/message/accessors_split64.h b/upb/message/accessors_split64.h similarity index 95% rename from upb/upb/message/accessors_split64.h rename to upb/message/accessors_split64.h index c04142c64a..e284bb14f4 100644 --- a/upb/upb/message/accessors_split64.h +++ b/upb/message/accessors_split64.h @@ -8,10 +8,10 @@ #ifndef UPB_MESSAGE_ACCESSORS_SPLIT64_H_ #define UPB_MESSAGE_ACCESSORS_SPLIT64_H_ -#include "upb/upb/message/accessors.h" +#include "upb/message/accessors.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -61,6 +61,6 @@ UPB_API_INLINE bool upb_Message_SetUInt64Split(upb_Message* msg, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MESSAGE_ACCESSORS_SPLIT64_H_ diff --git a/upb/upb/message/accessors_test.cc b/upb/message/accessors_test.cc similarity index 97% rename from upb/upb/message/accessors_test.cc rename to upb/message/accessors_test.cc index a25df5f8c2..b8b65697fd 100644 --- a/upb/upb/message/accessors_test.cc +++ b/upb/message/accessors_test.cc @@ -11,23 +11,23 @@ * accessed through reflective APIs exposed through mini table accessors. */ -#include "upb/upb/message/accessors.h" +#include "upb/message/accessors.h" #include #include #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/mini_descriptor/internal/encode.hpp" -#include "upb/upb/mini_descriptor/internal/modifiers.h" -#include "upb/upb/test/test.upb.h" -#include "upb/upb/wire/decode.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/mini_descriptor/internal/encode.hpp" +#include "upb/mini_descriptor/internal/modifiers.h" +#include "upb/test/test.upb.h" +#include "upb/wire/decode.h" // Must be last -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace { diff --git a/upb/upb/message/copy.c b/upb/message/copy.c similarity index 96% rename from upb/upb/message/copy.c rename to upb/message/copy.c index f042ba9302..2747a0ce13 100644 --- a/upb/upb/message/copy.c +++ b/upb/message/copy.c @@ -5,22 +5,22 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/message/copy.h" +#include "upb/message/copy.h" #include #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/accessors.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/internal/field.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" +#include "upb/message/accessors.h" +#include "upb/message/internal/message.h" +#include "upb/message/message.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/internal/field.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" static bool upb_MessageField_IsMap(const upb_MiniTableField* field) { return upb_FieldMode_Get(field) == kUpb_FieldMode_Map; diff --git a/upb/upb/message/copy.h b/upb/message/copy.h similarity index 86% rename from upb/upb/message/copy.h rename to upb/message/copy.h index 063fdc797f..9377d297f3 100644 --- a/upb/upb/message/copy.h +++ b/upb/message/copy.h @@ -8,13 +8,13 @@ #ifndef UPB_MESSAGE_COPY_H_ #define UPB_MESSAGE_COPY_H_ -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/message.h" +#include "upb/collections/array.h" +#include "upb/collections/map.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -43,6 +43,6 @@ bool upb_Message_DeepCopy(upb_Message* dst, const upb_Message* src, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MESSAGE_COPY_H_ diff --git a/upb/upb/message/copy_test.cc b/upb/message/copy_test.cc similarity index 97% rename from upb/upb/message/copy_test.cc rename to upb/message/copy_test.cc index 1d17c86510..f9bbff511f 100644 --- a/upb/upb/message/copy_test.cc +++ b/upb/message/copy_test.cc @@ -11,7 +11,7 @@ * accessed through reflective APIs exposed through mini table accessors. */ -#include "upb/upb/message/copy.h" +#include "upb/message/copy.h" #include #include @@ -21,14 +21,14 @@ #include #include "google/protobuf/test_messages_proto2.upb.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/accessors.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/wire/encode.h" +#include "upb/base/string_view.h" +#include "upb/collections/map.h" +#include "upb/mem/arena.h" +#include "upb/message/accessors.h" +#include "upb/message/internal/message.h" +#include "upb/message/message.h" +#include "upb/mini_table/message.h" +#include "upb/wire/encode.h" namespace { diff --git a/upb/upb/message/internal/accessors.h b/upb/message/internal/accessors.h similarity index 98% rename from upb/upb/message/internal/accessors.h rename to upb/message/internal/accessors.h index c6308228b5..d71a999216 100644 --- a/upb/upb/message/internal/accessors.h +++ b/upb/message/internal/accessors.h @@ -8,13 +8,13 @@ #ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_ #define UPB_MESSAGE_INTERNAL_ACCESSORS_H_ -#include "upb/upb/collections/internal/map.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/mini_table/internal/field.h" +#include "upb/collections/internal/map.h" +#include "upb/message/internal/extension.h" +#include "upb/message/internal/message.h" +#include "upb/mini_table/internal/field.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #if defined(__GNUC__) && !defined(__clang__) // GCC raises incorrect warnings in these functions. It thinks that we are @@ -362,6 +362,6 @@ UPB_INLINE upb_Map* _upb_Message_GetOrCreateMutableMap( #pragma GCC diagnostic pop #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MESSAGE_INTERNAL_ACCESSORS_H_ diff --git a/upb/upb/message/internal/extension.h b/upb/message/internal/extension.h similarity index 88% rename from upb/upb/message/internal/extension.h rename to upb/message/internal/extension.h index 6e8b0514b4..ab653abc84 100644 --- a/upb/upb/message/internal/extension.h +++ b/upb/message/internal/extension.h @@ -8,14 +8,14 @@ #ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_ #define UPB_MESSAGE_INTERNAL_EXTENSION_H_ -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_table/extension.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" +#include "upb/message/message.h" +#include "upb/mini_table/extension.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // The internal representation of an extension is self-describing: it contains // enough information that we can serialize it to binary format without needing @@ -58,6 +58,6 @@ const upb_Message_Extension* _upb_Message_Getext( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MESSAGE_INTERNAL_EXTENSION_H_ */ diff --git a/upb/upb/message/internal/message.h b/upb/message/internal/message.h similarity index 90% rename from upb/upb/message/internal/message.h rename to upb/message/internal/message.h index fd3366378e..d270a01f5a 100644 --- a/upb/upb/message/internal/message.h +++ b/upb/message/internal/message.h @@ -18,15 +18,15 @@ #include #include -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/message/internal/types.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/extension_registry.h" -#include "upb/upb/mini_table/message.h" +#include "upb/message/internal/extension.h" +#include "upb/message/internal/types.h" +#include "upb/message/message.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/extension_registry.h" +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -101,6 +101,6 @@ bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MESSAGE_INTERNAL_H_ */ diff --git a/upb/upb/message/internal/types.h b/upb/message/internal/types.h similarity index 100% rename from upb/upb/message/internal/types.h rename to upb/message/internal/types.h diff --git a/upb/upb/message/message.c b/upb/message/message.c similarity index 97% rename from upb/upb/message/message.c rename to upb/message/message.c index a85c5e9d1f..265d30df13 100644 --- a/upb/upb/message/message.c +++ b/upb/message/message.c @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/message/message.h" +#include "upb/message/message.h" #include -#include "upb/upb/base/internal/log2.h" -#include "upb/upb/message/internal/message.h" +#include "upb/base/internal/log2.h" +#include "upb/message/internal/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" const float kUpb_FltInfinity = INFINITY; const double kUpb_Infinity = INFINITY; diff --git a/upb/upb/message/message.h b/upb/message/message.h similarity index 88% rename from upb/upb/message/message.h rename to upb/message/message.h index 5ffd5446a3..705803acbe 100644 --- a/upb/upb/message/message.h +++ b/upb/message/message.h @@ -14,12 +14,12 @@ #include -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/types.h" // IWYU pragma: export -#include "upb/upb/mini_table/message.h" +#include "upb/mem/arena.h" +#include "upb/message/types.h" // IWYU pragma: export +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -47,6 +47,6 @@ size_t upb_Message_ExtensionCount(const upb_Message* msg); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MESSAGE_MESSAGE_H_ */ diff --git a/upb/upb/message/promote.c b/upb/message/promote.c similarity index 94% rename from upb/upb/message/promote.c rename to upb/message/promote.c index 1bb730fa89..3e4c6dbf89 100644 --- a/upb/upb/message/promote.c +++ b/upb/message/promote.c @@ -5,34 +5,34 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/message/promote.h" +#include "upb/message/promote.h" #include #include #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/internal/array.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/accessors.h" -#include "upb/upb/message/internal/accessors.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/message/message.h" -#include "upb/upb/message/tagged_ptr.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/internal/field.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/wire/decode.h" -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/internal/constants.h" -#include "upb/upb/wire/reader.h" +#include "upb/base/descriptor_constants.h" +#include "upb/collections/array.h" +#include "upb/collections/internal/array.h" +#include "upb/collections/map.h" +#include "upb/mem/arena.h" +#include "upb/message/accessors.h" +#include "upb/message/internal/accessors.h" +#include "upb/message/internal/extension.h" +#include "upb/message/internal/message.h" +#include "upb/message/message.h" +#include "upb/message/tagged_ptr.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/internal/field.h" +#include "upb/mini_table/message.h" +#include "upb/wire/decode.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/internal/constants.h" +#include "upb/wire/reader.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Parses unknown data by merging into existing base_message or creating a // new message usingg mini_table. diff --git a/upb/upb/message/promote.h b/upb/message/promote.h similarity index 96% rename from upb/upb/message/promote.h rename to upb/message/promote.h index 83acd36b18..dfa9fdc03b 100644 --- a/upb/upb/message/promote.h +++ b/upb/message/promote.h @@ -8,13 +8,13 @@ #ifndef UPB_MESSAGE_PROMOTE_H_ #define UPB_MESSAGE_PROMOTE_H_ -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/wire/decode.h" +#include "upb/collections/array.h" +#include "upb/collections/map.h" +#include "upb/message/internal/extension.h" +#include "upb/wire/decode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -156,6 +156,6 @@ upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMap( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MESSAGE_PROMOTE_H_ diff --git a/upb/upb/message/promote_test.cc b/upb/message/promote_test.cc similarity index 98% rename from upb/upb/message/promote_test.cc rename to upb/message/promote_test.cc index 3887ef3d7e..6adf9a428d 100644 --- a/upb/upb/message/promote_test.cc +++ b/upb/message/promote_test.cc @@ -11,25 +11,25 @@ * accessed through reflective APIs exposed through mini table accessors. */ -#include "upb/upb/message/promote.h" +#include "upb/message/promote.h" #include #include #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/message/accessors.h" -#include "upb/upb/message/copy.h" -#include "upb/upb/mini_descriptor/internal/encode.hpp" -#include "upb/upb/mini_descriptor/internal/modifiers.h" -#include "upb/upb/test/test.upb.h" -#include "upb/upb/wire/decode.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/mem/arena.hpp" +#include "upb/message/accessors.h" +#include "upb/message/copy.h" +#include "upb/mini_descriptor/internal/encode.hpp" +#include "upb/mini_descriptor/internal/modifiers.h" +#include "upb/test/test.upb.h" +#include "upb/wire/decode.h" // Must be last -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace { diff --git a/upb/upb/message/tagged_ptr.h b/upb/message/tagged_ptr.h similarity index 94% rename from upb/upb/message/tagged_ptr.h rename to upb/message/tagged_ptr.h index 34f88e869e..2596cd74d5 100644 --- a/upb/upb/message/tagged_ptr.h +++ b/upb/message/tagged_ptr.h @@ -10,10 +10,10 @@ #include -#include "upb/upb/message/types.h" // IWYU pragma: export +#include "upb/message/types.h" // IWYU pragma: export // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -64,6 +64,6 @@ UPB_INLINE upb_Message* _upb_TaggedMessagePtr_GetEmptyMessage( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_TYPES_H_ */ diff --git a/upb/upb/message/test.cc b/upb/message/test.cc similarity index 98% rename from upb/upb/message/test.cc rename to upb/message/test.cc index 3ab560fb01..d28f60aacf 100644 --- a/upb/upb/message/test.cc +++ b/upb/message/test.cc @@ -11,15 +11,15 @@ #include #include #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/upb/base/status.hpp" -#include "upb/upb/json/decode.h" -#include "upb/upb/json/encode.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/message/test.upb.h" -#include "upb/upb/message/test.upbdefs.h" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/test/fuzz_util.h" -#include "upb/upb/wire/decode.h" +#include "upb/base/status.hpp" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/mem/arena.hpp" +#include "upb/message/test.upb.h" +#include "upb/message/test.upbdefs.h" +#include "upb/reflection/def.hpp" +#include "upb/test/fuzz_util.h" +#include "upb/wire/decode.h" // begin:google_only // #include "testing/fuzzing/fuzztest.h" diff --git a/upb/upb/message/test.proto b/upb/message/test.proto similarity index 100% rename from upb/upb/message/test.proto rename to upb/message/test.proto diff --git a/upb/upb/message/types.h b/upb/message/types.h similarity index 100% rename from upb/upb/message/types.h rename to upb/message/types.h diff --git a/upb/upb/message/utf8_test.cc b/upb/message/utf8_test.cc similarity index 96% rename from upb/upb/message/utf8_test.cc rename to upb/message/utf8_test.cc index a6e3109b2e..5f63bb2834 100644 --- a/upb/upb/message/utf8_test.cc +++ b/upb/message/utf8_test.cc @@ -31,11 +31,11 @@ #include #include -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/message/utf8_test.upb.h" -#include "upb/upb/wire/decode.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" +#include "upb/mem/arena.hpp" +#include "upb/message/utf8_test.upb.h" +#include "upb/wire/decode.h" namespace { diff --git a/upb/upb/message/utf8_test.proto b/upb/message/utf8_test.proto similarity index 100% rename from upb/upb/message/utf8_test.proto rename to upb/message/utf8_test.proto diff --git a/upb/upb/message/value.h b/upb/message/value.h similarity index 86% rename from upb/upb/message/value.h rename to upb/message/value.h index 1199dde582..954d88acdb 100644 --- a/upb/upb/message/value.h +++ b/upb/message/value.h @@ -6,16 +6,16 @@ // https://developers.google.com/open-source/licenses/bsd // Users should include array.h or map.h instead. -// IWYU pragma: private, include "upb/upb/collections/array.h" +// IWYU pragma: private, include "upb/collections/array.h" #ifndef UPB_MESSAGE_VALUE_H_ #define UPB_MESSAGE_VALUE_H_ #include -#include "upb/upb/base/string_view.h" -#include "upb/upb/message/tagged_ptr.h" -#include "upb/upb/message/types.h" +#include "upb/base/string_view.h" +#include "upb/message/tagged_ptr.h" +#include "upb/message/types.h" typedef union { bool bool_val; diff --git a/upb/upb/mini_descriptor/BUILD b/upb/mini_descriptor/BUILD similarity index 95% rename from upb/upb/mini_descriptor/BUILD rename to upb/mini_descriptor/BUILD index 5bdade774c..d64279197f 100644 --- a/upb/upb/mini_descriptor/BUILD +++ b/upb/mini_descriptor/BUILD @@ -1,5 +1,5 @@ load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", ) @@ -59,13 +59,13 @@ cc_test( ":internal", ":mini_descriptor", "//:protobuf", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:mem", "//upb:message_accessors_internal", "//upb:mini_table", "//upb:wire", "@com_google_absl//absl/container:flat_hash_set", - "@com_google_googletest//:gtest_main", ], ) @@ -80,7 +80,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/mini_descriptor/build_enum.c b/upb/mini_descriptor/build_enum.c similarity index 94% rename from upb/upb/mini_descriptor/build_enum.c rename to upb/mini_descriptor/build_enum.c index 68f0a6da85..738c59126f 100644 --- a/upb/upb/mini_descriptor/build_enum.c +++ b/upb/mini_descriptor/build_enum.c @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_descriptor/build_enum.h" +#include "upb/mini_descriptor/build_enum.h" -#include "upb/upb/mini_descriptor/internal/decoder.h" -#include "upb/upb/mini_descriptor/internal/wire_constants.h" -#include "upb/upb/mini_table/internal/enum.h" +#include "upb/mini_descriptor/internal/decoder.h" +#include "upb/mini_descriptor/internal/wire_constants.h" +#include "upb/mini_table/internal/enum.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { upb_MdDecoder base; diff --git a/upb/upb/mini_descriptor/build_enum.h b/upb/mini_descriptor/build_enum.h similarity index 88% rename from upb/upb/mini_descriptor/build_enum.h rename to upb/mini_descriptor/build_enum.h index 7619897c7b..c4b95152c7 100644 --- a/upb/upb/mini_descriptor/build_enum.h +++ b/upb/mini_descriptor/build_enum.h @@ -7,12 +7,12 @@ #ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ #define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ -#include "upb/upb/base/status.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/enum.h" +#include "upb/base/status.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/enum.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -37,6 +37,6 @@ UPB_API_INLINE upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ diff --git a/upb/upb/mini_descriptor/decode.c b/upb/mini_descriptor/decode.c similarity index 98% rename from upb/upb/mini_descriptor/decode.c rename to upb/mini_descriptor/decode.c index 09bf6e115d..6575e92e30 100644 --- a/upb/upb/mini_descriptor/decode.c +++ b/upb/mini_descriptor/decode.c @@ -5,22 +5,22 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_descriptor/decode.h" +#include "upb/mini_descriptor/decode.h" #include #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_descriptor/internal/base92.h" -#include "upb/upb/mini_descriptor/internal/decoder.h" -#include "upb/upb/mini_descriptor/internal/modifiers.h" -#include "upb/upb/mini_descriptor/internal/wire_constants.h" -#include "upb/upb/mini_table/internal/field.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" +#include "upb/mini_descriptor/internal/base92.h" +#include "upb/mini_descriptor/internal/decoder.h" +#include "upb/mini_descriptor/internal/modifiers.h" +#include "upb/mini_descriptor/internal/wire_constants.h" +#include "upb/mini_table/internal/field.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Note: we sort by this number when calculating layout order. typedef enum { diff --git a/upb/upb/mini_descriptor/decode.h b/upb/mini_descriptor/decode.h similarity index 92% rename from upb/upb/mini_descriptor/decode.h rename to upb/mini_descriptor/decode.h index 4b1aa61724..ec7c12e9f0 100644 --- a/upb/upb/mini_descriptor/decode.h +++ b/upb/mini_descriptor/decode.h @@ -8,22 +8,22 @@ #ifndef UPB_MINI_TABLE_DECODE_H_ #define UPB_MINI_TABLE_DECODE_H_ -#include "upb/upb/base/status.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/mini_table/sub.h" +#include "upb/base/status.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/message.h" +#include "upb/mini_table/sub.h" // Export the newer headers, for legacy users. New users should include the // more specific headers directly. // IWYU pragma: begin_exports -#include "upb/upb/mini_descriptor/build_enum.h" -#include "upb/upb/mini_descriptor/link.h" +#include "upb/mini_descriptor/build_enum.h" +#include "upb/mini_descriptor/link.h" // IWYU pragma: end_exports // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef enum { kUpb_MiniTablePlatform_32Bit, @@ -115,6 +115,6 @@ upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_DECODE_H_ */ diff --git a/upb/upb/mini_descriptor/internal/base92.c b/upb/mini_descriptor/internal/base92.c similarity index 95% rename from upb/upb/mini_descriptor/internal/base92.c rename to upb/mini_descriptor/internal/base92.c index af0e1605e2..18783d92a6 100644 --- a/upb/upb/mini_descriptor/internal/base92.c +++ b/upb/mini_descriptor/internal/base92.c @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_descriptor/internal/base92.h" +#include "upb/mini_descriptor/internal/base92.h" const char _kUpb_ToBase92[] = { ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', diff --git a/upb/upb/mini_descriptor/internal/base92.h b/upb/mini_descriptor/internal/base92.h similarity index 93% rename from upb/upb/mini_descriptor/internal/base92.h rename to upb/mini_descriptor/internal/base92.h index 21809744f2..4201c25c5b 100644 --- a/upb/upb/mini_descriptor/internal/base92.h +++ b/upb/mini_descriptor/internal/base92.h @@ -10,10 +10,10 @@ #include -#include "upb/upb/base/internal/log2.h" +#include "upb/base/internal/log2.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -58,6 +58,6 @@ UPB_INLINE const char* _upb_Base92_DecodeVarint(const char* ptr, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_ diff --git a/upb/upb/mini_descriptor/internal/decoder.h b/upb/mini_descriptor/internal/decoder.h similarity index 91% rename from upb/upb/mini_descriptor/internal/decoder.h rename to upb/mini_descriptor/internal/decoder.h index d1786a405b..9ac3282004 100644 --- a/upb/upb/mini_descriptor/internal/decoder.h +++ b/upb/mini_descriptor/internal/decoder.h @@ -8,11 +8,11 @@ #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ #define UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ -#include "upb/upb/base/status.h" -#include "upb/upb/mini_descriptor/internal/base92.h" +#include "upb/base/status.h" +#include "upb/mini_descriptor/internal/base92.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // upb_MdDecoder: used internally for decoding MiniDescriptors for messages, // extensions, and enums. @@ -48,6 +48,6 @@ UPB_INLINE const char* upb_MdDecoder_DecodeBase92Varint( return ptr; } -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ diff --git a/upb/upb/mini_descriptor/internal/encode.c b/upb/mini_descriptor/internal/encode.c similarity index 97% rename from upb/upb/mini_descriptor/internal/encode.c rename to upb/mini_descriptor/internal/encode.c index ec56d0d219..2193ffeb8f 100644 --- a/upb/upb/mini_descriptor/internal/encode.c +++ b/upb/mini_descriptor/internal/encode.c @@ -5,19 +5,19 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_descriptor/internal/encode.h" +#include "upb/mini_descriptor/internal/encode.h" #include #include #include -#include "upb/upb/base/internal/log2.h" -#include "upb/upb/mini_descriptor/internal/base92.h" -#include "upb/upb/mini_descriptor/internal/modifiers.h" -#include "upb/upb/mini_descriptor/internal/wire_constants.h" +#include "upb/base/internal/log2.h" +#include "upb/mini_descriptor/internal/base92.h" +#include "upb/mini_descriptor/internal/modifiers.h" +#include "upb/mini_descriptor/internal/wire_constants.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { uint64_t present_values_mask; diff --git a/upb/upb/mini_descriptor/internal/encode.h b/upb/mini_descriptor/internal/encode.h similarity index 96% rename from upb/upb/mini_descriptor/internal/encode.h rename to upb/mini_descriptor/internal/encode.h index 3a1f55f7e8..3180f0bdc5 100644 --- a/upb/upb/mini_descriptor/internal/encode.h +++ b/upb/mini_descriptor/internal/encode.h @@ -10,10 +10,10 @@ #include -#include "upb/upb/base/descriptor_constants.h" +#include "upb/base/descriptor_constants.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // If the input buffer has at least this many bytes available, the encoder call // is guaranteed to succeed (as long as field number order is maintained). @@ -87,6 +87,6 @@ char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_ */ diff --git a/upb/upb/mini_descriptor/internal/encode.hpp b/upb/mini_descriptor/internal/encode.hpp similarity index 97% rename from upb/upb/mini_descriptor/internal/encode.hpp rename to upb/mini_descriptor/internal/encode.hpp index 98787cbe0d..cfa3bed6cc 100644 --- a/upb/upb/mini_descriptor/internal/encode.hpp +++ b/upb/mini_descriptor/internal/encode.hpp @@ -10,8 +10,8 @@ #include -#include "upb/upb/base/internal/log2.h" -#include "upb/upb/mini_descriptor/internal/encode.h" +#include "upb/base/internal/log2.h" +#include "upb/mini_descriptor/internal/encode.h" namespace upb { diff --git a/upb/upb/mini_descriptor/internal/encode_test.cc b/upb/mini_descriptor/internal/encode_test.cc similarity index 96% rename from upb/upb/mini_descriptor/internal/encode_test.cc rename to upb/mini_descriptor/internal/encode_test.cc index 13a9e16f63..dcb33b5aae 100644 --- a/upb/upb/mini_descriptor/internal/encode_test.cc +++ b/upb/mini_descriptor/internal/encode_test.cc @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_descriptor/internal/encode.hpp" +#include "upb/mini_descriptor/internal/encode.hpp" #include #include @@ -14,14 +14,14 @@ #include #include "absl/container/flat_hash_set.h" #include "google/protobuf/descriptor.h" -#include "upb/upb/base/status.hpp" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/message/internal/accessors.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/mini_descriptor/internal/base92.h" -#include "upb/upb/mini_descriptor/internal/modifiers.h" -#include "upb/upb/mini_table/enum.h" -#include "upb/upb/wire/decode.h" +#include "upb/base/status.hpp" +#include "upb/mem/arena.hpp" +#include "upb/message/internal/accessors.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/mini_descriptor/internal/base92.h" +#include "upb/mini_descriptor/internal/modifiers.h" +#include "upb/mini_table/enum.h" +#include "upb/wire/decode.h" // begin:google_only // #include "testing/fuzzing/fuzztest.h" diff --git a/upb/upb/mini_descriptor/internal/modifiers.h b/upb/mini_descriptor/internal/modifiers.h similarity index 93% rename from upb/upb/mini_descriptor/internal/modifiers.h rename to upb/mini_descriptor/internal/modifiers.h index b0fdc878bd..103b279cb6 100644 --- a/upb/upb/mini_descriptor/internal/modifiers.h +++ b/upb/mini_descriptor/internal/modifiers.h @@ -9,7 +9,7 @@ #define UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_ // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef enum { kUpb_FieldModifier_IsRepeated = 1 << 0, @@ -27,6 +27,6 @@ typedef enum { kUpb_MessageModifier_IsExtendable = 1 << 2, } kUpb_MessageModifier; -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_ diff --git a/upb/upb/mini_descriptor/internal/wire_constants.h b/upb/mini_descriptor/internal/wire_constants.h similarity index 94% rename from upb/upb/mini_descriptor/internal/wire_constants.h rename to upb/mini_descriptor/internal/wire_constants.h index 724f0817d7..569da57755 100644 --- a/upb/upb/mini_descriptor/internal/wire_constants.h +++ b/upb/mini_descriptor/internal/wire_constants.h @@ -8,10 +8,10 @@ #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_ #define UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_ -#include "upb/upb/base/descriptor_constants.h" +#include "upb/base/descriptor_constants.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef enum { kUpb_EncodedType_Double = 0, @@ -67,6 +67,6 @@ enum { kUpb_EncodedVersion_MessageSetV1 = '&', }; -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_ diff --git a/upb/upb/mini_descriptor/link.c b/upb/mini_descriptor/link.c similarity index 98% rename from upb/upb/mini_descriptor/link.c rename to upb/mini_descriptor/link.c index 7c860af7ef..39da601ce7 100644 --- a/upb/upb/mini_descriptor/link.c +++ b/upb/mini_descriptor/link.c @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_descriptor/link.h" +#include "upb/mini_descriptor/link.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" bool upb_MiniTable_SetSubMessage(upb_MiniTable* table, upb_MiniTableField* field, diff --git a/upb/upb/mini_descriptor/link.h b/upb/mini_descriptor/link.h similarity index 92% rename from upb/upb/mini_descriptor/link.h rename to upb/mini_descriptor/link.h index 55296a1687..db3aac1627 100644 --- a/upb/upb/mini_descriptor/link.h +++ b/upb/mini_descriptor/link.h @@ -16,15 +16,15 @@ #ifndef UPB_MINI_DESCRIPTOR_LINK_H_ #define UPB_MINI_DESCRIPTOR_LINK_H_ -#include "upb/upb/base/status.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/mini_table/sub.h" +#include "upb/base/status.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/message.h" +#include "upb/mini_table/sub.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -79,6 +79,6 @@ UPB_API bool upb_MiniTable_Link(upb_MiniTable* mt, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_LINK_H_ diff --git a/upb/upb/mini_table/BUILD b/upb/mini_table/BUILD similarity index 89% rename from upb/upb/mini_table/BUILD rename to upb/mini_table/BUILD index 44d47672e9..1623c05a80 100644 --- a/upb/upb/mini_table/BUILD +++ b/upb/mini_table/BUILD @@ -6,7 +6,7 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", ) @@ -81,11 +81,11 @@ cc_test( name = "compat_test", srcs = ["compat_test.cc"], deps = [ - "//upb:mini_table_compat", - "//upb/upb/test:test_messages_proto2_upb_proto", - "//upb/upb/test:test_messages_proto3_upb_proto", - "//upb/upb/test:test_upb_proto", "@com_google_googletest//:gtest_main", + "//upb:mini_table_compat", + "//upb/test:test_messages_proto2_upb_proto", + "//upb/test:test_messages_proto3_upb_proto", + "//upb/test:test_upb_proto", ], ) @@ -100,7 +100,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/mini_table/compat.c b/upb/mini_table/compat.c similarity index 92% rename from upb/upb/mini_table/compat.c rename to upb/mini_table/compat.c index e8fa81d7de..ad169ce2a0 100644 --- a/upb/upb/mini_table/compat.c +++ b/upb/mini_table/compat.c @@ -5,17 +5,17 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_table/compat.h" +#include "upb/mini_table/compat.h" -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/hash/common.h" -#include "upb/upb/hash/int_table.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/message.h" +#include "upb/base/descriptor_constants.h" +#include "upb/hash/common.h" +#include "upb/hash/int_table.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Checks if source and target mini table fields are identical. // diff --git a/upb/upb/mini_table/compat.h b/upb/mini_table/compat.h similarity index 92% rename from upb/upb/mini_table/compat.h rename to upb/mini_table/compat.h index 091d878296..fd1670db33 100644 --- a/upb/upb/mini_table/compat.h +++ b/upb/mini_table/compat.h @@ -8,10 +8,10 @@ #ifndef UPB_MINI_TABLE_COMPAT_H_ #define UPB_MINI_TABLE_COMPAT_H_ -#include "upb/upb/mini_table/message.h" +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // upb does not support mixing minitables from different sources but these // functions are still used by some existing users so for now we make them @@ -40,6 +40,6 @@ upb_MiniTableEquals_Status upb_MiniTable_Equals(const upb_MiniTable* src, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_COMPAT_H_ */ diff --git a/upb/upb/mini_table/compat_test.cc b/upb/mini_table/compat_test.cc similarity index 96% rename from upb/upb/mini_table/compat_test.cc rename to upb/mini_table/compat_test.cc index 59ae5cd1d8..e999e17371 100644 --- a/upb/upb/mini_table/compat_test.cc +++ b/upb/mini_table/compat_test.cc @@ -11,7 +11,7 @@ * accessed through reflective APIs exposed through mini table accessors. */ -#include "upb/upb/mini_table/compat.h" +#include "upb/mini_table/compat.h" #include #include "google/protobuf/test_messages_proto2.upb.h" diff --git a/upb/upb/mini_table/enum.h b/upb/mini_table/enum.h similarity index 90% rename from upb/upb/mini_table/enum.h rename to upb/mini_table/enum.h index 6087a75dc6..c2810fbc63 100644 --- a/upb/upb/mini_table/enum.h +++ b/upb/mini_table/enum.h @@ -8,10 +8,10 @@ #ifndef UPB_MINI_TABLE_ENUM_H_ #define UPB_MINI_TABLE_ENUM_H_ -#include "upb/upb/mini_table/internal/enum.h" +#include "upb/mini_table/internal/enum.h" // Must be last -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct upb_MiniTableEnum upb_MiniTableEnum; @@ -33,6 +33,6 @@ UPB_INLINE bool upb_MiniTableEnum_CheckValue(const struct upb_MiniTableEnum* e, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_ENUM_H_ */ diff --git a/upb/upb/mini_table/extension.h b/upb/mini_table/extension.h similarity index 89% rename from upb/upb/mini_table/extension.h rename to upb/mini_table/extension.h index a8835340ff..7fde3158c7 100644 --- a/upb/upb/mini_table/extension.h +++ b/upb/mini_table/extension.h @@ -8,7 +8,7 @@ #ifndef UPB_MINI_TABLE_EXTENSION_H_ #define UPB_MINI_TABLE_EXTENSION_H_ -#include "upb/upb/mini_table/internal/extension.h" +#include "upb/mini_table/internal/extension.h" typedef struct upb_MiniTableExtension upb_MiniTableExtension; diff --git a/upb/upb/mini_table/extension_registry.c b/upb/mini_table/extension_registry.c similarity index 93% rename from upb/upb/mini_table/extension_registry.c rename to upb/mini_table/extension_registry.c index b1329f2048..3c3f58f583 100644 --- a/upb/upb/mini_table/extension_registry.c +++ b/upb/mini_table/extension_registry.c @@ -5,13 +5,13 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_table/extension_registry.h" +#include "upb/mini_table/extension_registry.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/mini_table/extension.h" +#include "upb/hash/str_table.h" +#include "upb/mini_table/extension.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t)) diff --git a/upb/upb/mini_table/extension_registry.h b/upb/mini_table/extension_registry.h similarity index 95% rename from upb/upb/mini_table/extension_registry.h rename to upb/mini_table/extension_registry.h index bb90572991..0465140fdf 100644 --- a/upb/upb/mini_table/extension_registry.h +++ b/upb/mini_table/extension_registry.h @@ -8,12 +8,12 @@ #ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ #define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/message.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -80,6 +80,6 @@ UPB_API const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */ diff --git a/upb/upb/mini_table/field.h b/upb/mini_table/field.h similarity index 92% rename from upb/upb/mini_table/field.h rename to upb/mini_table/field.h index 082a9ccbfc..7f382c4e59 100644 --- a/upb/upb/mini_table/field.h +++ b/upb/mini_table/field.h @@ -8,12 +8,12 @@ #ifndef UPB_MINI_TABLE_FIELD_H_ #define UPB_MINI_TABLE_FIELD_H_ -#include "upb/upb/mini_table/internal/field.h" -#include "upb/upb/mini_table/internal/message.h" -#include "upb/upb/mini_table/internal/sub.h" +#include "upb/mini_table/internal/field.h" +#include "upb/mini_table/internal/message.h" +#include "upb/mini_table/internal/sub.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -93,6 +93,6 @@ UPB_API_INLINE bool upb_MiniTableField_HasPresence( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_FIELD_H_ */ diff --git a/upb/upb/mini_table/file.h b/upb/mini_table/file.h similarity index 90% rename from upb/upb/mini_table/file.h rename to upb/mini_table/file.h index 67a4f4d157..590164f72f 100644 --- a/upb/upb/mini_table/file.h +++ b/upb/mini_table/file.h @@ -8,7 +8,7 @@ #ifndef UPB_MINI_TABLE_FILE_H_ #define UPB_MINI_TABLE_FILE_H_ -#include "upb/upb/mini_table/internal/file.h" +#include "upb/mini_table/internal/file.h" typedef struct upb_MiniTableFile upb_MiniTableFile; diff --git a/upb/upb/mini_table/internal/enum.h b/upb/mini_table/internal/enum.h similarity index 96% rename from upb/upb/mini_table/internal/enum.h rename to upb/mini_table/internal/enum.h index 366132b600..bbc353adac 100644 --- a/upb/upb/mini_table/internal/enum.h +++ b/upb/mini_table/internal/enum.h @@ -11,7 +11,7 @@ #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_MiniTableEnum { uint32_t mask_limit; // Limit enum value that can be tested with mask. @@ -53,6 +53,6 @@ UPB_INLINE bool _upb_MiniTable_CheckEnumValueSlow( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */ diff --git a/upb/upb/mini_table/internal/extension.h b/upb/mini_table/internal/extension.h similarity index 81% rename from upb/upb/mini_table/internal/extension.h rename to upb/mini_table/internal/extension.h index 8400a698f4..f052fe6d20 100644 --- a/upb/upb/mini_table/internal/extension.h +++ b/upb/mini_table/internal/extension.h @@ -8,11 +8,11 @@ #ifndef UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ #define UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ -#include "upb/upb/mini_table/internal/field.h" -#include "upb/upb/mini_table/internal/sub.h" +#include "upb/mini_table/internal/field.h" +#include "upb/mini_table/internal/sub.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_MiniTableExtension { // Do not move this field. We need to be able to alias pointers. @@ -22,6 +22,6 @@ struct upb_MiniTableExtension { union upb_MiniTableSub sub; // NULL unless submessage or proto2 enum }; -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ */ diff --git a/upb/upb/mini_table/internal/field.h b/upb/mini_table/internal/field.h similarity index 96% rename from upb/upb/mini_table/internal/field.h rename to upb/mini_table/internal/field.h index 03c31cc8cc..3ed8afec76 100644 --- a/upb/upb/mini_table/internal/field.h +++ b/upb/mini_table/internal/field.h @@ -10,10 +10,10 @@ #include -#include "upb/upb/base/descriptor_constants.h" +#include "upb/base/descriptor_constants.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_MiniTableField { uint32_t number; @@ -109,6 +109,6 @@ UPB_INLINE bool upb_IsSubMessage(const struct upb_MiniTableField* field) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_FIELD_H_ */ diff --git a/upb/upb/mini_table/internal/file.h b/upb/mini_table/internal/file.h similarity index 74% rename from upb/upb/mini_table/internal/file.h rename to upb/mini_table/internal/file.h index d8d332f330..c8f069f855 100644 --- a/upb/upb/mini_table/internal/file.h +++ b/upb/mini_table/internal/file.h @@ -8,12 +8,12 @@ #ifndef UPB_MINI_TABLE_INTERNAL_FILE_H_ #define UPB_MINI_TABLE_INTERNAL_FILE_H_ -#include "upb/upb/mini_table/internal/enum.h" -#include "upb/upb/mini_table/internal/extension.h" -#include "upb/upb/mini_table/internal/message.h" +#include "upb/mini_table/internal/enum.h" +#include "upb/mini_table/internal/extension.h" +#include "upb/mini_table/internal/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_MiniTableFile { const struct upb_MiniTable** msgs; @@ -24,6 +24,6 @@ struct upb_MiniTableFile { int ext_count; }; -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_FILE_H_ */ diff --git a/upb/upb/mini_table/internal/message.c b/upb/mini_table/internal/message.c similarity index 91% rename from upb/upb/mini_table/internal/message.c rename to upb/mini_table/internal/message.c index 9b7b133e94..b25edacca7 100644 --- a/upb/upb/mini_table/internal/message.c +++ b/upb/mini_table/internal/message.c @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_table/internal/message.h" +#include "upb/mini_table/internal/message.h" const struct upb_MiniTable _kUpb_MiniTable_Empty = { .subs = NULL, diff --git a/upb/upb/mini_table/internal/message.h b/upb/mini_table/internal/message.h similarity index 95% rename from upb/upb/mini_table/internal/message.h rename to upb/mini_table/internal/message.h index 7e48fbfcd7..3457ea2cd6 100644 --- a/upb/upb/mini_table/internal/message.h +++ b/upb/mini_table/internal/message.h @@ -8,11 +8,11 @@ #ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ #define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ -#include "upb/upb/message/types.h" -#include "upb/upb/mini_table/internal/field.h" +#include "upb/message/types.h" +#include "upb/mini_table/internal/field.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_Decoder; typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr, @@ -83,6 +83,6 @@ UPB_INLINE uint64_t upb_MiniTable_requiredmask(const struct upb_MiniTable* l) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */ diff --git a/upb/upb/mini_table/internal/sub.h b/upb/mini_table/internal/sub.h similarity index 84% rename from upb/upb/mini_table/internal/sub.h rename to upb/mini_table/internal/sub.h index 7da38ff153..7887dbada3 100644 --- a/upb/upb/mini_table/internal/sub.h +++ b/upb/mini_table/internal/sub.h @@ -7,8 +7,8 @@ #ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_ #define UPB_MINI_TABLE_INTERNAL_SUB_H_ -#include "upb/upb/mini_table/internal/enum.h" -#include "upb/upb/mini_table/internal/message.h" +#include "upb/mini_table/internal/enum.h" +#include "upb/mini_table/internal/message.h" union upb_MiniTableSub { const struct upb_MiniTable* submsg; diff --git a/upb/upb/mini_table/message.c b/upb/mini_table/message.c similarity index 92% rename from upb/upb/mini_table/message.c rename to upb/mini_table/message.c index 9d105d93cb..56f23014a3 100644 --- a/upb/upb/mini_table/message.c +++ b/upb/mini_table/message.c @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/mini_table/message.h" +#include "upb/mini_table/message.h" #include -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/internal/message.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/internal/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" const upb_MiniTableField* upb_MiniTable_FindFieldByNumber( const upb_MiniTable* t, uint32_t number) { diff --git a/upb/upb/mini_table/message.h b/upb/mini_table/message.h similarity index 93% rename from upb/upb/mini_table/message.h rename to upb/mini_table/message.h index 1f88db0f25..b53e87eae9 100644 --- a/upb/upb/mini_table/message.h +++ b/upb/mini_table/message.h @@ -8,12 +8,12 @@ #ifndef UPB_MINI_TABLE_MESSAGE_H_ #define UPB_MINI_TABLE_MESSAGE_H_ -#include "upb/upb/mini_table/enum.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/internal/message.h" +#include "upb/mini_table/enum.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/internal/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -80,6 +80,6 @@ bool upb_MiniTable_NextOneofField(const upb_MiniTable* m, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_MINI_TABLE_MESSAGE_H_ */ diff --git a/upb/upb/mini_table/sub.h b/upb/mini_table/sub.h similarity index 90% rename from upb/upb/mini_table/sub.h rename to upb/mini_table/sub.h index 7bcf5ad756..1c5d67e1eb 100644 --- a/upb/upb/mini_table/sub.h +++ b/upb/mini_table/sub.h @@ -8,7 +8,7 @@ #ifndef UPB_MINI_TABLE_SUB_H_ #define UPB_MINI_TABLE_SUB_H_ -#include "upb/upb/mini_table/internal/sub.h" +#include "upb/mini_table/internal/sub.h" typedef union upb_MiniTableSub upb_MiniTableSub; diff --git a/upb/upb/port/BUILD b/upb/port/BUILD similarity index 89% rename from upb/upb/port/BUILD rename to upb/port/BUILD index 2157ff0751..dc1c343c7a 100644 --- a/upb/upb/port/BUILD +++ b/upb/port/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "port", @@ -38,7 +38,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/port/atomic.h b/upb/port/atomic.h similarity index 97% rename from upb/upb/port/atomic.h rename to upb/port/atomic.h index 39ebf5a9e1..f13caa86cc 100644 --- a/upb/upb/port/atomic.h +++ b/upb/port/atomic.h @@ -8,7 +8,7 @@ #ifndef UPB_PORT_ATOMIC_H_ #define UPB_PORT_ATOMIC_H_ -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef UPB_USE_C11_ATOMICS @@ -78,6 +78,6 @@ UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr, #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_PORT_ATOMIC_H_ diff --git a/upb/upb/port/def.inc b/upb/port/def.inc similarity index 98% rename from upb/upb/port/def.inc rename to upb/port/def.inc index 7c72db8b2d..f320821384 100644 --- a/upb/upb/port/def.inc +++ b/upb/port/def.inc @@ -12,17 +12,17 @@ * * The correct usage is: * - * #include "upb/upb/foobar.h" - * #include "upb/upb/baz.h" + * #include "upb/foobar.h" + * #include "upb/baz.h" * * // MUST be last included header. - * #include "upb/upb/port/def.inc" + * #include "upb/port/def.inc" * * // Code for this file. * // <...> * * // Can be omitted for .c files, required for .h. - * #include "upb/upb/port/undef.inc" + * #include "upb/port/undef.inc" * * This file is private and must not be included by users! */ diff --git a/upb/upb/port/undef.inc b/upb/port/undef.inc similarity index 100% rename from upb/upb/port/undef.inc rename to upb/port/undef.inc diff --git a/upb/upb/port/vsnprintf_compat.h b/upb/port/vsnprintf_compat.h similarity index 93% rename from upb/upb/port/vsnprintf_compat.h rename to upb/port/vsnprintf_compat.h index ff65bed187..1f6c6449cc 100644 --- a/upb/upb/port/vsnprintf_compat.h +++ b/upb/port/vsnprintf_compat.h @@ -9,7 +9,7 @@ #define UPB_PORT_VSNPRINTF_COMPAT_H_ // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt, va_list ap) { @@ -25,6 +25,6 @@ UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt, #endif } -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_PORT_VSNPRINTF_COMPAT_H_ diff --git a/upb/upb/reflection/common.h b/upb/reflection/common.h similarity index 96% rename from upb/upb/reflection/common.h rename to upb/reflection/common.h index 0255b77ce2..ebe3282853 100644 --- a/upb/upb/reflection/common.h +++ b/upb/reflection/common.h @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" // Declarations common to all public def types. diff --git a/upb/upb/reflection/def.h b/upb/reflection/def.h similarity index 50% rename from upb/upb/reflection/def.h rename to upb/reflection/def.h index ba40828579..ba8e8390c8 100644 --- a/upb/upb/reflection/def.h +++ b/upb/reflection/def.h @@ -9,16 +9,16 @@ #define UPB_REFLECTION_DEF_H_ // IWYU pragma: begin_exports -#include "upb/upb/reflection/def_pool.h" -#include "upb/upb/reflection/enum_def.h" -#include "upb/upb/reflection/enum_value_def.h" -#include "upb/upb/reflection/extension_range.h" -#include "upb/upb/reflection/field_def.h" -#include "upb/upb/reflection/file_def.h" -#include "upb/upb/reflection/message_def.h" -#include "upb/upb/reflection/method_def.h" -#include "upb/upb/reflection/oneof_def.h" -#include "upb/upb/reflection/service_def.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/enum_def.h" +#include "upb/reflection/enum_value_def.h" +#include "upb/reflection/extension_range.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/file_def.h" +#include "upb/reflection/message_def.h" +#include "upb/reflection/method_def.h" +#include "upb/reflection/oneof_def.h" +#include "upb/reflection/service_def.h" // IWYU pragma: end_exports #endif /* UPB_REFLECTION_DEF_H_ */ diff --git a/upb/upb/reflection/def.hpp b/upb/reflection/def.hpp similarity index 98% rename from upb/upb/reflection/def.hpp rename to upb/reflection/def.hpp index 8a80075ee5..855ef3dc9a 100644 --- a/upb/upb/reflection/def.hpp +++ b/upb/reflection/def.hpp @@ -13,15 +13,15 @@ #include #include -#include "upb/upb/base/status.hpp" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/internal/def_pool.h" -#include "upb/upb/reflection/internal/enum_def.h" -#include "upb/upb/reflection/message.h" +#include "upb/base/status.hpp" +#include "upb/mem/arena.hpp" +#include "upb/reflection/def.h" +#include "upb/reflection/internal/def_pool.h" +#include "upb/reflection/internal/enum_def.h" +#include "upb/reflection/message.h" // Must be last -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upb { @@ -600,6 +600,6 @@ inline EnumDefPtr FieldDefPtr::enum_subdef() const { } // namespace upb -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_REFLECTION_DEF_HPP_ diff --git a/upb/upb/reflection/def_pool.c b/upb/reflection/def_pool.c similarity index 96% rename from upb/upb/reflection/def_pool.c rename to upb/reflection/def_pool.c index d05514025d..90d3beadf5 100644 --- a/upb/upb/reflection/def_pool.c +++ b/upb/reflection/def_pool.c @@ -5,21 +5,21 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/def_pool.h" +#include "upb/reflection/internal/def_pool.h" -#include "upb/upb/hash/int_table.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/enum_def.h" -#include "upb/upb/reflection/internal/enum_value_def.h" -#include "upb/upb/reflection/internal/field_def.h" -#include "upb/upb/reflection/internal/file_def.h" -#include "upb/upb/reflection/internal/message_def.h" -#include "upb/upb/reflection/internal/service_def.h" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/enum_def.h" +#include "upb/reflection/internal/enum_value_def.h" +#include "upb/reflection/internal/field_def.h" +#include "upb/reflection/internal/file_def.h" +#include "upb/reflection/internal/message_def.h" +#include "upb/reflection/internal/service_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_DefPool { upb_Arena* arena; diff --git a/upb/upb/reflection/def_pool.h b/upb/reflection/def_pool.h similarity index 91% rename from upb/upb/reflection/def_pool.h rename to upb/reflection/def_pool.h index 66a1ffd44d..f21a0dbd2d 100644 --- a/upb/upb/reflection/def_pool.h +++ b/upb/reflection/def_pool.h @@ -5,18 +5,18 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_DEF_POOL_H_ #define UPB_REFLECTION_DEF_POOL_H_ -#include "upb/upb/base/status.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/reflection/common.h" -#include "upb/upb/reflection/def_type.h" +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" +#include "upb/reflection/def_type.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -82,6 +82,6 @@ const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_POOL_H_ */ diff --git a/upb/upb/reflection/def_type.c b/upb/reflection/def_type.c similarity index 92% rename from upb/upb/reflection/def_type.c rename to upb/reflection/def_type.c index 090e9b1d12..cd4ae15cdf 100644 --- a/upb/upb/reflection/def_type.c +++ b/upb/reflection/def_type.c @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/def_type.h" +#include "upb/reflection/def_type.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" upb_deftype_t _upb_DefType_Type(upb_value v) { const uintptr_t num = (uintptr_t)upb_value_getconstptr(v); diff --git a/upb/upb/reflection/def_type.h b/upb/reflection/def_type.h similarity index 94% rename from upb/upb/reflection/def_type.h rename to upb/reflection/def_type.h index 3ca4a3ba69..5d560262f2 100644 --- a/upb/upb/reflection/def_type.h +++ b/upb/reflection/def_type.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_DEF_TYPE_H_ #define UPB_REFLECTION_DEF_TYPE_H_ -#include "upb/upb/hash/common.h" +#include "upb/hash/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Inside a symtab we store tagged pointers to specific def types. typedef enum { @@ -56,6 +56,6 @@ const void* _upb_DefType_Unpack(upb_value v, upb_deftype_t type); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_TYPE_H_ */ diff --git a/upb/upb/reflection/desc_state.c b/upb/reflection/desc_state.c similarity index 91% rename from upb/upb/reflection/desc_state.c rename to upb/reflection/desc_state.c index 4e30ea3bb5..075314c95d 100644 --- a/upb/upb/reflection/desc_state.c +++ b/upb/reflection/desc_state.c @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/desc_state.h" +#include "upb/reflection/internal/desc_state.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a) { const size_t oldbufsize = d->bufsize; diff --git a/upb/upb/reflection/enum_def.c b/upb/reflection/enum_def.c similarity index 93% rename from upb/upb/reflection/enum_def.c rename to upb/reflection/enum_def.c index 33298bbb6d..97fc63e9ac 100644 --- a/upb/upb/reflection/enum_def.c +++ b/upb/reflection/enum_def.c @@ -5,22 +5,22 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/enum_def.h" +#include "upb/reflection/internal/enum_def.h" -#include "upb/upb/hash/int_table.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/desc_state.h" -#include "upb/upb/reflection/internal/enum_reserved_range.h" -#include "upb/upb/reflection/internal/enum_value_def.h" -#include "upb/upb/reflection/internal/file_def.h" -#include "upb/upb/reflection/internal/message_def.h" -#include "upb/upb/reflection/internal/strdup2.h" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/desc_state.h" +#include "upb/reflection/internal/enum_reserved_range.h" +#include "upb/reflection/internal/enum_value_def.h" +#include "upb/reflection/internal/file_def.h" +#include "upb/reflection/internal/message_def.h" +#include "upb/reflection/internal/strdup2.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_EnumDef { const UPB_DESC(EnumOptions) * opts; diff --git a/upb/upb/reflection/enum_def.h b/upb/reflection/enum_def.h similarity index 91% rename from upb/upb/reflection/enum_def.h rename to upb/reflection/enum_def.h index c28063bfed..6f406f54bb 100644 --- a/upb/upb/reflection/enum_def.h +++ b/upb/reflection/enum_def.h @@ -5,16 +5,16 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_ENUM_DEF_H_ #define UPB_REFLECTION_ENUM_DEF_H_ -#include "upb/upb/base/string_view.h" -#include "upb/upb/reflection/common.h" +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -55,6 +55,6 @@ UPB_API int upb_EnumDef_ValueCount(const upb_EnumDef* e); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_DEF_H_ */ diff --git a/upb/upb/reflection/enum_reserved_range.c b/upb/reflection/enum_reserved_range.c similarity index 88% rename from upb/upb/reflection/enum_reserved_range.c rename to upb/reflection/enum_reserved_range.c index 1137244f61..f138846298 100644 --- a/upb/upb/reflection/enum_reserved_range.c +++ b/upb/reflection/enum_reserved_range.c @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/enum_reserved_range.h" +#include "upb/reflection/internal/enum_reserved_range.h" -#include "upb/upb/reflection/enum_def.h" -#include "upb/upb/reflection/field_def.h" -#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/reflection/enum_def.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/internal/def_builder.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_EnumReservedRange { int32_t start; diff --git a/upb/upb/reflection/enum_reserved_range.h b/upb/reflection/enum_reserved_range.h similarity index 80% rename from upb/upb/reflection/enum_reserved_range.h rename to upb/reflection/enum_reserved_range.h index cfd50e0870..124d4c7514 100644 --- a/upb/upb/reflection/enum_reserved_range.h +++ b/upb/reflection/enum_reserved_range.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ #define UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -26,6 +26,6 @@ int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ */ diff --git a/upb/upb/reflection/enum_value_def.c b/upb/reflection/enum_value_def.c similarity index 93% rename from upb/upb/reflection/enum_value_def.c rename to upb/reflection/enum_value_def.c index 810df2ef82..d06c933107 100644 --- a/upb/upb/reflection/enum_value_def.c +++ b/upb/reflection/enum_value_def.c @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/enum_value_def.h" +#include "upb/reflection/internal/enum_value_def.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/enum_def.h" -#include "upb/upb/reflection/internal/file_def.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/enum_def.h" +#include "upb/reflection/internal/file_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_EnumValueDef { const UPB_DESC(EnumValueOptions) * opts; diff --git a/upb/upb/reflection/enum_value_def.h b/upb/reflection/enum_value_def.h similarity index 85% rename from upb/upb/reflection/enum_value_def.h rename to upb/reflection/enum_value_def.h index a1ead8165d..e95232847a 100644 --- a/upb/upb/reflection/enum_value_def.h +++ b/upb/reflection/enum_value_def.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_H_ #define UPB_REFLECTION_ENUM_VALUE_DEF_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -32,6 +32,6 @@ const UPB_DESC(EnumValueOptions) * } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */ diff --git a/upb/upb/reflection/extension_range.c b/upb/reflection/extension_range.c similarity index 90% rename from upb/upb/reflection/extension_range.c rename to upb/reflection/extension_range.c index 2e5e29f59f..b088ba92ed 100644 --- a/upb/upb/reflection/extension_range.c +++ b/upb/reflection/extension_range.c @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/extension_range.h" +#include "upb/reflection/internal/extension_range.h" -#include "upb/upb/reflection/field_def.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/message_def.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/message_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_ExtensionRange { const UPB_DESC(ExtensionRangeOptions) * opts; diff --git a/upb/upb/reflection/extension_range.h b/upb/reflection/extension_range.h similarity index 83% rename from upb/upb/reflection/extension_range.h rename to upb/reflection/extension_range.h index 26ca113cd6..7c3e19f005 100644 --- a/upb/upb/reflection/extension_range.h +++ b/upb/reflection/extension_range.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_EXTENSION_RANGE_H_ #define UPB_REFLECTION_EXTENSION_RANGE_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -30,6 +30,6 @@ const UPB_DESC(ExtensionRangeOptions) * } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */ diff --git a/upb/upb/reflection/field_def.c b/upb/reflection/field_def.c similarity index 97% rename from upb/upb/reflection/field_def.c rename to upb/reflection/field_def.c index b6f4516ad5..94bd0a5f3e 100644 --- a/upb/upb/reflection/field_def.c +++ b/upb/reflection/field_def.c @@ -5,27 +5,27 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/field_def.h" +#include "upb/reflection/internal/field_def.h" #include #include #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/mini_descriptor/internal/modifiers.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/desc_state.h" -#include "upb/upb/reflection/internal/enum_def.h" -#include "upb/upb/reflection/internal/file_def.h" -#include "upb/upb/reflection/internal/message_def.h" -#include "upb/upb/reflection/internal/oneof_def.h" -#include "upb/upb/reflection/internal/strdup2.h" +#include "upb/base/descriptor_constants.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/mini_descriptor/internal/modifiers.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/desc_state.h" +#include "upb/reflection/internal/enum_def.h" +#include "upb/reflection/internal/file_def.h" +#include "upb/reflection/internal/message_def.h" +#include "upb/reflection/internal/oneof_def.h" +#include "upb/reflection/internal/strdup2.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define UPB_FIELD_TYPE_UNSPECIFIED 0 diff --git a/upb/upb/reflection/field_def.h b/upb/reflection/field_def.h similarity index 93% rename from upb/upb/reflection/field_def.h rename to upb/reflection/field_def.h index c6105835b3..b3305bc1f2 100644 --- a/upb/upb/reflection/field_def.h +++ b/upb/reflection/field_def.h @@ -5,16 +5,16 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_FIELD_DEF_H_ #define UPB_REFLECTION_FIELD_DEF_H_ -#include "upb/upb/base/string_view.h" -#include "upb/upb/reflection/common.h" +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Maximum field number allowed for FieldDefs. // This is an inherent limit of the protobuf wire format. @@ -69,6 +69,6 @@ UPB_API upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_FIELD_DEF_H_ */ diff --git a/upb/upb/reflection/file_def.c b/upb/reflection/file_def.c similarity index 96% rename from upb/upb/reflection/file_def.c rename to upb/reflection/file_def.c index 03fc4200a8..bd4b254cac 100644 --- a/upb/upb/reflection/file_def.c +++ b/upb/reflection/file_def.c @@ -5,18 +5,18 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/file_def.h" +#include "upb/reflection/internal/file_def.h" -#include "upb/upb/reflection/def_pool.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/enum_def.h" -#include "upb/upb/reflection/internal/field_def.h" -#include "upb/upb/reflection/internal/message_def.h" -#include "upb/upb/reflection/internal/service_def.h" -#include "upb/upb/reflection/internal/strdup2.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/enum_def.h" +#include "upb/reflection/internal/field_def.h" +#include "upb/reflection/internal/message_def.h" +#include "upb/reflection/internal/service_def.h" +#include "upb/reflection/internal/strdup2.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_FileDef { const UPB_DESC(FileOptions) * opts; diff --git a/upb/upb/reflection/file_def.h b/upb/reflection/file_def.h similarity index 91% rename from upb/upb/reflection/file_def.h rename to upb/reflection/file_def.h index a4b9c711a3..f338c25f92 100644 --- a/upb/upb/reflection/file_def.h +++ b/upb/reflection/file_def.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_FILE_DEF_H_ #define UPB_REFLECTION_FILE_DEF_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -52,6 +52,6 @@ int upb_FileDef_WeakDependencyCount(const upb_FileDef* f); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_FILE_DEF_H_ */ diff --git a/upb/upb/reflection/internal/def_builder.c b/upb/reflection/internal/def_builder.c similarity index 97% rename from upb/upb/reflection/internal/def_builder.c rename to upb/reflection/internal/def_builder.c index 83aae89353..2ab16f27de 100644 --- a/upb/upb/reflection/internal/def_builder.c +++ b/upb/reflection/internal/def_builder.c @@ -5,17 +5,17 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/def_builder.h" #include -#include "upb/upb/reflection/def_pool.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/field_def.h" -#include "upb/upb/reflection/internal/strdup2.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/internal/strdup2.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" /* The upb core does not generally have a concept of default instances. However * for descriptor options we make an exception since the max size is known and diff --git a/upb/upb/reflection/internal/def_builder.h b/upb/reflection/internal/def_builder.h similarity index 96% rename from upb/upb/reflection/internal/def_builder.h rename to upb/reflection/internal/def_builder.h index f4c9190254..584553214d 100644 --- a/upb/upb/reflection/internal/def_builder.h +++ b/upb/reflection/internal/def_builder.h @@ -8,12 +8,12 @@ #ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ #define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ -#include "upb/upb/reflection/common.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_pool.h" +#include "upb/reflection/common.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_pool.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // We want to copy the options verbatim into the destination options proto. // We use serialize+parse as our deep copy. @@ -132,6 +132,6 @@ UPB_INLINE void _upb_DefBuilder_CheckIdentFull(upb_DefBuilder* ctx, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/def_builder_test.cc b/upb/reflection/internal/def_builder_test.cc similarity index 95% rename from upb/upb/reflection/internal/def_builder_test.cc rename to upb/reflection/internal/def_builder_test.cc index cd955b73d7..b624ffc25f 100644 --- a/upb/upb/reflection/internal/def_builder_test.cc +++ b/upb/reflection/internal/def_builder_test.cc @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/def_builder.h" #include #include "absl/strings/string_view.h" -#include "upb/upb/mem/arena.hpp" +#include "upb/mem/arena.hpp" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct IdentTestData { absl::string_view text; diff --git a/upb/upb/reflection/internal/def_pool.h b/upb/reflection/internal/def_pool.h similarity index 92% rename from upb/upb/reflection/internal/def_pool.h rename to upb/reflection/internal/def_pool.h index 7d838edbaf..f94d7ef193 100644 --- a/upb/upb/reflection/internal/def_pool.h +++ b/upb/reflection/internal/def_pool.h @@ -8,11 +8,11 @@ #ifndef UPB_REFLECTION_DEF_POOL_INTERNAL_H_ #define UPB_REFLECTION_DEF_POOL_INTERNAL_H_ -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/reflection/def_pool.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/reflection/def_pool.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -52,6 +52,6 @@ bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_POOL_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/desc_state.h b/upb/reflection/internal/desc_state.h similarity index 86% rename from upb/upb/reflection/internal/desc_state.h rename to upb/reflection/internal/desc_state.h index 2ea57d70f1..20436d6db2 100644 --- a/upb/upb/reflection/internal/desc_state.h +++ b/upb/reflection/internal/desc_state.h @@ -8,11 +8,11 @@ #ifndef UPB_REFLECTION_DESC_STATE_INTERNAL_H_ #define UPB_REFLECTION_DESC_STATE_INTERNAL_H_ -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_descriptor/internal/encode.h" +#include "upb/mem/arena.h" +#include "upb/mini_descriptor/internal/encode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Manages the storage for mini descriptor strings as they are being encoded. // TODO: Move some of this state directly into the encoder, maybe. @@ -39,6 +39,6 @@ bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/enum_def.h b/upb/reflection/internal/enum_def.h similarity index 89% rename from upb/upb/reflection/internal/enum_def.h rename to upb/reflection/internal/enum_def.h index 94812cfcdb..8f6b220112 100644 --- a/upb/upb/reflection/internal/enum_def.h +++ b/upb/reflection/internal/enum_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ #define UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ -#include "upb/upb/reflection/enum_def.h" +#include "upb/reflection/enum_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -31,6 +31,6 @@ upb_EnumDef* _upb_EnumDefs_New( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/enum_reserved_range.h b/upb/reflection/internal/enum_reserved_range.h similarity index 88% rename from upb/upb/reflection/internal/enum_reserved_range.h rename to upb/reflection/internal/enum_reserved_range.h index a4a3222bd8..fe30604a1a 100644 --- a/upb/upb/reflection/internal/enum_reserved_range.h +++ b/upb/reflection/internal/enum_reserved_range.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ #define UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ -#include "upb/upb/reflection/enum_reserved_range.h" +#include "upb/reflection/enum_reserved_range.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -30,6 +30,6 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/enum_value_def.h b/upb/reflection/internal/enum_value_def.h similarity index 90% rename from upb/upb/reflection/internal/enum_value_def.h rename to upb/reflection/internal/enum_value_def.h index 718c316872..2484567feb 100644 --- a/upb/upb/reflection/internal/enum_value_def.h +++ b/upb/reflection/internal/enum_value_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ #define UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ -#include "upb/upb/reflection/enum_value_def.h" +#include "upb/reflection/enum_value_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -32,6 +32,6 @@ const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/extension_range.h b/upb/reflection/internal/extension_range.h similarity index 88% rename from upb/upb/reflection/internal/extension_range.h rename to upb/reflection/internal/extension_range.h index 9cc9c4514d..09901b41ff 100644 --- a/upb/upb/reflection/internal/extension_range.h +++ b/upb/reflection/internal/extension_range.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ #define UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ -#include "upb/upb/reflection/extension_range.h" +#include "upb/reflection/extension_range.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -29,6 +29,6 @@ upb_ExtensionRange* _upb_ExtensionRanges_New( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/field_def.h b/upb/reflection/internal/field_def.h similarity index 94% rename from upb/upb/reflection/internal/field_def.h rename to upb/reflection/internal/field_def.h index 95ecbd127e..838f3b6070 100644 --- a/upb/upb/reflection/internal/field_def.h +++ b/upb/reflection/internal/field_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ #define UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ -#include "upb/upb/reflection/field_def.h" +#include "upb/reflection/field_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -51,6 +51,6 @@ const upb_FieldDef** _upb_FieldDefs_Sorted(const upb_FieldDef* f, int n, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/file_def.h b/upb/reflection/internal/file_def.h similarity index 90% rename from upb/upb/reflection/internal/file_def.h rename to upb/reflection/internal/file_def.h index e9c167ab4f..9afaa04562 100644 --- a/upb/upb/reflection/internal/file_def.h +++ b/upb/reflection/internal/file_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_FILE_DEF_INTERNAL_H_ #define UPB_REFLECTION_FILE_DEF_INTERNAL_H_ -#include "upb/upb/reflection/file_def.h" +#include "upb/reflection/file_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -32,6 +32,6 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_FILE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/message_def.h b/upb/reflection/internal/message_def.h similarity index 93% rename from upb/upb/reflection/internal/message_def.h rename to upb/reflection/internal/message_def.h index e15e87bb75..6cc9686a74 100644 --- a/upb/upb/reflection/internal/message_def.h +++ b/upb/reflection/internal/message_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ #define UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ -#include "upb/upb/reflection/message_def.h" +#include "upb/reflection/message_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -38,6 +38,6 @@ upb_MessageDef* _upb_MessageDefs_New( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/message_reserved_range.h b/upb/reflection/internal/message_reserved_range.h similarity index 88% rename from upb/upb/reflection/internal/message_reserved_range.h rename to upb/reflection/internal/message_reserved_range.h index 374507ad56..88227ac3ae 100644 --- a/upb/upb/reflection/internal/message_reserved_range.h +++ b/upb/reflection/internal/message_reserved_range.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ -#include "upb/upb/reflection/message_reserved_range.h" +#include "upb/reflection/message_reserved_range.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -30,6 +30,6 @@ upb_MessageReservedRange* _upb_MessageReservedRanges_New( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/method_def.h b/upb/reflection/internal/method_def.h similarity index 88% rename from upb/upb/reflection/internal/method_def.h rename to upb/reflection/internal/method_def.h index 34b274a866..a7e8ef8a37 100644 --- a/upb/upb/reflection/internal/method_def.h +++ b/upb/reflection/internal/method_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ #define UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ -#include "upb/upb/reflection/method_def.h" +#include "upb/reflection/method_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -28,6 +28,6 @@ upb_MethodDef* _upb_MethodDefs_New( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/oneof_def.h b/upb/reflection/internal/oneof_def.h similarity index 90% rename from upb/upb/reflection/internal/oneof_def.h rename to upb/reflection/internal/oneof_def.h index d64d85432e..9cd6713efd 100644 --- a/upb/upb/reflection/internal/oneof_def.h +++ b/upb/reflection/internal/oneof_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ #define UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ -#include "upb/upb/reflection/oneof_def.h" +#include "upb/reflection/oneof_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -32,6 +32,6 @@ size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/service_def.h b/upb/reflection/internal/service_def.h similarity index 87% rename from upb/upb/reflection/internal/service_def.h rename to upb/reflection/internal/service_def.h index b5dba70232..2845b87907 100644 --- a/upb/upb/reflection/internal/service_def.h +++ b/upb/reflection/internal/service_def.h @@ -8,10 +8,10 @@ #ifndef UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ #define UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ -#include "upb/upb/reflection/service_def.h" +#include "upb/reflection/service_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -28,6 +28,6 @@ upb_ServiceDef* _upb_ServiceDefs_New( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/strdup2.c b/upb/reflection/internal/strdup2.c similarity index 86% rename from upb/upb/reflection/internal/strdup2.c rename to upb/reflection/internal/strdup2.c index e0b9ddabaa..2c8f76ff3d 100644 --- a/upb/upb/reflection/internal/strdup2.c +++ b/upb/reflection/internal/strdup2.c @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/strdup2.h" +#include "upb/reflection/internal/strdup2.h" #include -#include "upb/upb/mem/arena.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" char* upb_strdup2(const char* s, size_t len, upb_Arena* a) { size_t n; diff --git a/upb/upb/reflection/internal/strdup2.h b/upb/reflection/internal/strdup2.h similarity index 87% rename from upb/upb/reflection/internal/strdup2.h rename to upb/reflection/internal/strdup2.h index 300ec19d68..0d4cadbe91 100644 --- a/upb/upb/reflection/internal/strdup2.h +++ b/upb/reflection/internal/strdup2.h @@ -10,10 +10,10 @@ #include -#include "upb/upb/mem/arena.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -27,6 +27,6 @@ char* upb_strdup2(const char* s, size_t len, upb_Arena* a); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_INTERNAL_STRDUP2_H_ */ diff --git a/upb/upb/reflection/message.c b/upb/reflection/message.c similarity index 93% rename from upb/upb/reflection/message.c rename to upb/reflection/message.c index 351daa8cd1..7ea30e6710 100644 --- a/upb/upb/reflection/message.c +++ b/upb/reflection/message.c @@ -5,24 +5,24 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/message.h" +#include "upb/reflection/message.h" #include -#include "upb/upb/collections/map.h" -#include "upb/upb/hash/common.h" -#include "upb/upb/message/accessors.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/def_pool.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/field_def.h" -#include "upb/upb/reflection/message_def.h" -#include "upb/upb/reflection/oneof_def.h" +#include "upb/collections/map.h" +#include "upb/hash/common.h" +#include "upb/message/accessors.h" +#include "upb/message/message.h" +#include "upb/mini_table/field.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/field_def.h" +#include "upb/reflection/message_def.h" +#include "upb/reflection/oneof_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" bool upb_Message_HasFieldByDef(const upb_Message* msg, const upb_FieldDef* f) { UPB_ASSERT(upb_FieldDef_HasPresence(f)); diff --git a/upb/upb/reflection/message.h b/upb/reflection/message.h similarity index 92% rename from upb/upb/reflection/message.h rename to upb/reflection/message.h index 0f9466c2b0..01a0840fe1 100644 --- a/upb/upb/reflection/message.h +++ b/upb/reflection/message.h @@ -10,14 +10,14 @@ #include -#include "upb/upb/collections/map.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/types.h" -#include "upb/upb/message/value.h" // IWYU pragma: export -#include "upb/upb/reflection/common.h" +#include "upb/collections/map.h" +#include "upb/mem/arena.h" +#include "upb/message/types.h" +#include "upb/message/value.h" // IWYU pragma: export +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -84,6 +84,6 @@ UPB_API bool upb_Message_DiscardUnknown(upb_Message* msg, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_H_ */ diff --git a/upb/upb/reflection/message.hpp b/upb/reflection/message.hpp similarity index 92% rename from upb/upb/reflection/message.hpp rename to upb/reflection/message.hpp index fc3effe9f0..6d5bc9834a 100644 --- a/upb/upb/reflection/message.hpp +++ b/upb/reflection/message.hpp @@ -8,7 +8,7 @@ #ifndef UPB_REFLECTION_MESSAGE_HPP_ #define UPB_REFLECTION_MESSAGE_HPP_ -#include "upb/upb/reflection/message.h" +#include "upb/reflection/message.h" namespace upb { diff --git a/upb/upb/reflection/message_def.c b/upb/reflection/message_def.c similarity index 96% rename from upb/upb/reflection/message_def.c rename to upb/reflection/message_def.c index d0f3f940da..59b743b99e 100644 --- a/upb/upb/reflection/message_def.c +++ b/upb/reflection/message_def.c @@ -5,27 +5,27 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/message_def.h" +#include "upb/reflection/internal/message_def.h" -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/hash/int_table.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/mini_descriptor/internal/modifiers.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/desc_state.h" -#include "upb/upb/reflection/internal/enum_def.h" -#include "upb/upb/reflection/internal/extension_range.h" -#include "upb/upb/reflection/internal/field_def.h" -#include "upb/upb/reflection/internal/file_def.h" -#include "upb/upb/reflection/internal/message_reserved_range.h" -#include "upb/upb/reflection/internal/oneof_def.h" -#include "upb/upb/reflection/internal/strdup2.h" +#include "upb/base/descriptor_constants.h" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/mini_descriptor/internal/modifiers.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/desc_state.h" +#include "upb/reflection/internal/enum_def.h" +#include "upb/reflection/internal/extension_range.h" +#include "upb/reflection/internal/field_def.h" +#include "upb/reflection/internal/file_def.h" +#include "upb/reflection/internal/message_reserved_range.h" +#include "upb/reflection/internal/oneof_def.h" +#include "upb/reflection/internal/strdup2.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_MessageDef { const UPB_DESC(MessageOptions) * opts; diff --git a/upb/upb/reflection/message_def.h b/upb/reflection/message_def.h similarity index 96% rename from upb/upb/reflection/message_def.h rename to upb/reflection/message_def.h index b8fef3bf03..a5c85efe23 100644 --- a/upb/upb/reflection/message_def.h +++ b/upb/reflection/message_def.h @@ -5,16 +5,16 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_MESSAGE_DEF_H_ #define UPB_REFLECTION_MESSAGE_DEF_H_ -#include "upb/upb/base/string_view.h" -#include "upb/upb/reflection/common.h" +#include "upb/base/string_view.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // Well-known field tag numbers for map-entry messages. #define kUpb_MapEntry_KeyFieldNumber 1 @@ -151,6 +151,6 @@ UPB_API upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */ diff --git a/upb/upb/reflection/message_reserved_range.c b/upb/reflection/message_reserved_range.c similarity index 86% rename from upb/upb/reflection/message_reserved_range.c rename to upb/reflection/message_reserved_range.c index bce76056cf..bb274e15a8 100644 --- a/upb/upb/reflection/message_reserved_range.c +++ b/upb/reflection/message_reserved_range.c @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/enum_def.h" -#include "upb/upb/reflection/field_def.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/extension_range.h" -#include "upb/upb/reflection/message_def.h" +#include "upb/reflection/enum_def.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/extension_range.h" +#include "upb/reflection/message_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_MessageReservedRange { int32_t start; diff --git a/upb/upb/reflection/message_reserved_range.h b/upb/reflection/message_reserved_range.h similarity index 80% rename from upb/upb/reflection/message_reserved_range.h rename to upb/reflection/message_reserved_range.h index dcefaf5832..9854f521df 100644 --- a/upb/upb/reflection/message_reserved_range.h +++ b/upb/reflection/message_reserved_range.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -26,6 +26,6 @@ int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ */ diff --git a/upb/upb/reflection/method_def.c b/upb/reflection/method_def.c similarity index 93% rename from upb/upb/reflection/method_def.c rename to upb/reflection/method_def.c index 8d45c06f99..049ef4a81d 100644 --- a/upb/upb/reflection/method_def.c +++ b/upb/reflection/method_def.c @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/method_def.h" +#include "upb/reflection/internal/method_def.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/service_def.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/service_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_MethodDef { const UPB_DESC(MethodOptions) * opts; diff --git a/upb/upb/reflection/method_def.h b/upb/reflection/method_def.h similarity index 87% rename from upb/upb/reflection/method_def.h rename to upb/reflection/method_def.h index bf3e6b5833..64b88a6683 100644 --- a/upb/upb/reflection/method_def.h +++ b/upb/reflection/method_def.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_METHOD_DEF_H_ #define UPB_REFLECTION_METHOD_DEF_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -34,6 +34,6 @@ const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_METHOD_DEF_H_ */ diff --git a/upb/upb/reflection/oneof_def.c b/upb/reflection/oneof_def.c similarity index 94% rename from upb/upb/reflection/oneof_def.c rename to upb/reflection/oneof_def.c index e9892489a7..869ca16b96 100644 --- a/upb/upb/reflection/oneof_def.c +++ b/upb/reflection/oneof_def.c @@ -5,21 +5,21 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/oneof_def.h" +#include "upb/reflection/internal/oneof_def.h" #include #include #include -#include "upb/upb/hash/int_table.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/field_def.h" -#include "upb/upb/reflection/internal/message_def.h" +#include "upb/hash/int_table.h" +#include "upb/hash/str_table.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/field_def.h" +#include "upb/reflection/internal/message_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_OneofDef { const UPB_DESC(OneofOptions) * opts; diff --git a/upb/upb/reflection/oneof_def.h b/upb/reflection/oneof_def.h similarity index 90% rename from upb/upb/reflection/oneof_def.h rename to upb/reflection/oneof_def.h index 0143c6df98..38c7a7002f 100644 --- a/upb/upb/reflection/oneof_def.h +++ b/upb/reflection/oneof_def.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_ONEOF_DEF_H_ #define UPB_REFLECTION_ONEOF_DEF_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -42,6 +42,6 @@ const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_ONEOF_DEF_H_ */ diff --git a/upb/upb/reflection/service_def.c b/upb/reflection/service_def.c similarity index 91% rename from upb/upb/reflection/service_def.c rename to upb/reflection/service_def.c index c948870143..7a0cbc7a09 100644 --- a/upb/upb/reflection/service_def.c +++ b/upb/reflection/service_def.c @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/reflection/internal/service_def.h" +#include "upb/reflection/internal/service_def.h" -#include "upb/upb/reflection/def_type.h" -#include "upb/upb/reflection/internal/def_builder.h" -#include "upb/upb/reflection/internal/file_def.h" -#include "upb/upb/reflection/internal/method_def.h" +#include "upb/reflection/def_type.h" +#include "upb/reflection/internal/def_builder.h" +#include "upb/reflection/internal/file_def.h" +#include "upb/reflection/internal/method_def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_ServiceDef { const UPB_DESC(ServiceOptions) * opts; diff --git a/upb/upb/reflection/service_def.h b/upb/reflection/service_def.h similarity index 87% rename from upb/upb/reflection/service_def.h rename to upb/reflection/service_def.h index 63b63d4a28..98cd993b4d 100644 --- a/upb/upb/reflection/service_def.h +++ b/upb/reflection/service_def.h @@ -5,15 +5,15 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -// IWYU pragma: private, include "upb/upb/reflection/def.h" +// IWYU pragma: private, include "upb/reflection/def.h" #ifndef UPB_REFLECTION_SERVICE_DEF_H_ #define UPB_REFLECTION_SERVICE_DEF_H_ -#include "upb/upb/reflection/common.h" +#include "upb/reflection/common.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -35,6 +35,6 @@ const UPB_DESC(ServiceOptions) * } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_REFLECTION_SERVICE_DEF_H_ */ diff --git a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c b/upb/reflection/stage0/google/protobuf/descriptor.upb.c similarity index 99% rename from upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c rename to upb/reflection/stage0/google/protobuf/descriptor.upb.c index 2f2054b91b..0db5b6054c 100644 --- a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c +++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.c @@ -1,5 +1,5 @@ #include -#include "upb/upb/generated_code_support.h" +#include "upb/generated_code_support.h" #include "google/protobuf/descriptor.upb.h" static upb_Arena* upb_BootstrapArena() { diff --git a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h b/upb/reflection/stage0/google/protobuf/descriptor.upb.h similarity index 99% rename from upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h rename to upb/reflection/stage0/google/protobuf/descriptor.upb.h index c5870d0319..192032c5cd 100644 --- a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h +++ b/upb/reflection/stage0/google/protobuf/descriptor.upb.h @@ -9,10 +9,10 @@ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ -#include "upb/upb/generated_code_support.h" +#include "upb/generated_code_support.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -6439,6 +6439,6 @@ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_semantic(google } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */ diff --git a/upb/upb/test/BUILD b/upb/test/BUILD similarity index 98% rename from upb/upb/test/BUILD rename to upb/test/BUILD index 59afb4e0a7..824bf7c604 100644 --- a/upb/upb/test/BUILD +++ b/upb/test/BUILD @@ -6,11 +6,11 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -136,8 +136,8 @@ cc_test( deps = [ ":proto3_test_upb_proto", ":proto3_test_upb_proto_reflection", - "//upb:reflection", "@com_google_googletest//:gtest_main", + "//upb:reflection", ], ) @@ -150,10 +150,10 @@ cc_test( ":test_cpp_upb_proto_reflection", ":timestamp_upb_proto", ":timestamp_upb_proto_reflection", + "@com_google_googletest//:gtest_main", "//upb:json", "//upb:port", "//upb:reflection", - "@com_google_googletest//:gtest_main", ], ) @@ -167,11 +167,11 @@ cc_test( ":test_messages_proto2_upb_proto", ":test_messages_proto3_upb_proto", ":test_upb_proto", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:collections", "//upb:mem", "//upb:port", - "@com_google_googletest//:gtest_main", ], ) @@ -185,10 +185,10 @@ cc_test( ":test_messages_proto2_upb_proto", ":test_messages_proto3_upb_proto", ":test_upb_proto", + "@com_google_googletest//:gtest_main", "//upb:mini_table", "//upb:mini_table_internal", "//upb:port", - "@com_google_googletest//:gtest_main", ], ) diff --git a/upb/upb/test/empty.proto b/upb/test/empty.proto similarity index 100% rename from upb/upb/test/empty.proto rename to upb/test/empty.proto diff --git a/upb/upb/test/fuzz_util.cc b/upb/test/fuzz_util.cc similarity index 94% rename from upb/upb/test/fuzz_util.cc rename to upb/test/fuzz_util.cc index 7f92db85ae..714fcac006 100644 --- a/upb/upb/test/fuzz_util.cc +++ b/upb/test/fuzz_util.cc @@ -5,16 +5,16 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/test/fuzz_util.h" +#include "upb/test/fuzz_util.h" -#include "upb/upb/base/status.hpp" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/extension_registry.h" +#include "upb/base/status.hpp" +#include "upb/message/message.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/extension_registry.h" // Must be last -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upb { namespace fuzz { diff --git a/upb/upb/test/fuzz_util.h b/upb/test/fuzz_util.h similarity index 95% rename from upb/upb/test/fuzz_util.h rename to upb/test/fuzz_util.h index 414e0188bd..72bf31ec82 100644 --- a/upb/upb/test/fuzz_util.h +++ b/upb/test/fuzz_util.h @@ -11,8 +11,8 @@ #include #include -#include "upb/upb/mini_table/extension_registry.h" -// #include "upb/upb/mini_table/types.h" +#include "upb/mini_table/extension_registry.h" +// #include "upb/mini_table/types.h" namespace upb { namespace fuzz { diff --git a/upb/upb/test/parse_text_proto.h b/upb/test/parse_text_proto.h similarity index 100% rename from upb/upb/test/parse_text_proto.h rename to upb/test/parse_text_proto.h diff --git a/upb/upb/test/proto3_test.cc b/upb/test/proto3_test.cc similarity index 79% rename from upb/upb/test/proto3_test.cc rename to upb/test/proto3_test.cc index c76864e121..d1af699694 100644 --- a/upb/upb/test/proto3_test.cc +++ b/upb/test/proto3_test.cc @@ -6,9 +6,9 @@ // https://developers.google.com/open-source/licenses/bsd #include -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/test/proto3_test.upb.h" -#include "upb/upb/test/proto3_test.upbdefs.h" +#include "upb/reflection/def.hpp" +#include "upb/test/proto3_test.upb.h" +#include "upb/test/proto3_test.upbdefs.h" TEST(Proto3Test, SyntheticOneofExtension) { upb::DefPool defpool; diff --git a/upb/upb/test/proto3_test.proto b/upb/test/proto3_test.proto similarity index 100% rename from upb/upb/test/proto3_test.proto rename to upb/test/proto3_test.proto diff --git a/upb/upb/test/test.proto b/upb/test/test.proto similarity index 100% rename from upb/upb/test/test.proto rename to upb/test/test.proto diff --git a/upb/upb/test/test_cpp.cc b/upb/test/test_cpp.cc similarity index 92% rename from upb/upb/test/test_cpp.cc rename to upb/test/test_cpp.cc index bfb436a5bc..bd917c1d9b 100644 --- a/upb/upb/test/test_cpp.cc +++ b/upb/test/test_cpp.cc @@ -17,15 +17,15 @@ #include "google/protobuf/timestamp.upb.h" #include "google/protobuf/timestamp.upbdefs.h" #include -#include "upb/upb/json/decode.h" -#include "upb/upb/json/encode.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/test/test_cpp.upb.h" -#include "upb/upb/test/test_cpp.upbdefs.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def.hpp" +#include "upb/test/test_cpp.upb.h" +#include "upb/test/test_cpp.upbdefs.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" TEST(Cpp, Iteration) { upb::DefPool defpool; diff --git a/upb/upb/test/test_cpp.proto b/upb/test/test_cpp.proto similarity index 100% rename from upb/upb/test/test_cpp.proto rename to upb/test/test_cpp.proto diff --git a/upb/upb/test/test_generated_code.cc b/upb/test/test_generated_code.cc similarity index 99% rename from upb/upb/test/test_generated_code.cc rename to upb/test/test_generated_code.cc index b5bee71ffb..e8f33d5cd1 100644 --- a/upb/upb/test/test_generated_code.cc +++ b/upb/test/test_generated_code.cc @@ -16,14 +16,14 @@ #include #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/upb/base/status.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/test/test.upb.h" +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/mem/arena.hpp" +#include "upb/test/test.upb.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #if !defined(MIN) #define MIN(x, y) ((x) < (y) ? (x) : (y)) diff --git a/upb/upb/test/test_import_empty_srcs.cc b/upb/test/test_import_empty_srcs.cc similarity index 89% rename from upb/upb/test/test_import_empty_srcs.cc rename to upb/test/test_import_empty_srcs.cc index 1624bcda52..cefa522b55 100644 --- a/upb/upb/test/test_import_empty_srcs.cc +++ b/upb/test/test_import_empty_srcs.cc @@ -6,7 +6,7 @@ // https://developers.google.com/open-source/licenses/bsd #include -#include "upb/upb/test/test_import_empty_srcs.upb.h" +#include "upb/test/test_import_empty_srcs.upb.h" TEST(Test, Reexport) { // This test really just ensures that compilation succeeds. diff --git a/upb/upb/test/test_import_empty_srcs.proto b/upb/test/test_import_empty_srcs.proto similarity index 85% rename from upb/upb/test/test_import_empty_srcs.proto rename to upb/test/test_import_empty_srcs.proto index de5c6a7740..eca7d9389d 100644 --- a/upb/upb/test/test_import_empty_srcs.proto +++ b/upb/test/test_import_empty_srcs.proto @@ -9,8 +9,8 @@ syntax = "proto2"; package upb_test; -import "upb/upb/test/test.proto"; -import "upb/upb/test/test_cpp.proto"; +import "upb/test/test.proto"; +import "upb/test/test_cpp.proto"; message ContainsImported { optional MessageName message_name = 1; diff --git a/upb/upb/test/test_mini_table_oneof.cc b/upb/test/test_mini_table_oneof.cc similarity index 91% rename from upb/upb/test/test_mini_table_oneof.cc rename to upb/test/test_mini_table_oneof.cc index 88eec15b77..434e5fbecb 100644 --- a/upb/upb/test/test_mini_table_oneof.cc +++ b/upb/test/test_mini_table_oneof.cc @@ -8,12 +8,12 @@ #include #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/test/test.upb.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/message.h" +#include "upb/test/test.upb.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" TEST(MiniTableOneofTest, OneOfIteratorProto2) { constexpr int oneof_first_field_number = 111; diff --git a/upb/upb/text/BUILD b/upb/text/BUILD similarity index 90% rename from upb/upb/text/BUILD rename to upb/text/BUILD index 81ce07850c..cca2b7ef4a 100644 --- a/upb/upb/text/BUILD +++ b/upb/text/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "text", @@ -41,7 +41,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/text/encode.c b/upb/text/encode.c similarity index 96% rename from upb/upb/text/encode.c rename to upb/text/encode.c index f04dea145a..d3e0b610ae 100644 --- a/upb/upb/text/encode.c +++ b/upb/text/encode.c @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/text/encode.h" +#include "upb/text/encode.h" #include #include @@ -13,17 +13,17 @@ #include #include -#include "upb/upb/collections/internal/map_sorter.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/lex/round_trip.h" -#include "upb/upb/port/vsnprintf_compat.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/reader.h" -#include "upb/upb/wire/types.h" +#include "upb/collections/internal/map_sorter.h" +#include "upb/collections/map.h" +#include "upb/lex/round_trip.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/message.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" +#include "upb/wire/types.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { char *buf, *ptr, *end; diff --git a/upb/upb/text/encode.h b/upb/text/encode.h similarity index 93% rename from upb/upb/text/encode.h rename to upb/text/encode.h index cd219da7ac..9374dc3d30 100644 --- a/upb/upb/text/encode.h +++ b/upb/text/encode.h @@ -8,10 +8,10 @@ #ifndef UPB_TEXT_ENCODE_H_ #define UPB_TEXT_ENCODE_H_ -#include "upb/upb/reflection/def.h" +#include "upb/reflection/def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -44,6 +44,6 @@ size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_TEXT_ENCODE_H_ */ diff --git a/upb/upb/upb.hpp b/upb/upb.hpp similarity index 86% rename from upb/upb/upb.hpp rename to upb/upb.hpp index bbdcfa243a..9276c16b55 100644 --- a/upb/upb/upb.hpp +++ b/upb/upb.hpp @@ -11,8 +11,8 @@ #define UPB_HPP_ // IWYU pragma: begin_exports -#include "upb/upb/base/status.hpp" -#include "upb/upb/mem/arena.hpp" +#include "upb/base/status.hpp" +#include "upb/mem/arena.hpp" // IWYU pragma: end_exports #endif // UPB_HPP_ diff --git a/upb/upb/generated_code_support.h b/upb/upb/generated_code_support.h deleted file mode 100644 index ab47ad72da..0000000000 --- a/upb/upb/generated_code_support.h +++ /dev/null @@ -1,33 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2023 Google LLC. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd - -#ifndef UPB_GENERATED_CODE_SUPPORT_H_ -#define UPB_GENERATED_CODE_SUPPORT_H_ - -// IWYU pragma: begin_exports -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/internal/array.h" -#include "upb/upb/collections/map_gencode_util.h" -#include "upb/upb/message/accessors.h" -#include "upb/upb/message/internal/accessors.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/mini_table/enum.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/extension_registry.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/file.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/mini_table/sub.h" -#include "upb/upb/wire/decode.h" -#include "upb/upb/wire/decode_fast.h" -#include "upb/upb/wire/encode.h" -// IWYU pragma: end_exports - -#endif // UPB_GENERATED_CODE_SUPPORT_H_ diff --git a/upb/upb/upb_so.c b/upb/upb_so.c similarity index 62% rename from upb/upb/upb_so.c rename to upb/upb_so.c index 36ec6b4373..23d2530a2c 100644 --- a/upb/upb/upb_so.c +++ b/upb/upb_so.c @@ -7,8 +7,8 @@ // These headers form a spanning tree for the upb defs needed by FFI layers. -#include "upb/upb/collections/array_split64.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/message/accessors_split64.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_descriptor/decode.h" +#include "upb/collections/array_split64.h" +#include "upb/collections/map.h" +#include "upb/message/accessors_split64.h" +#include "upb/message/message.h" +#include "upb/mini_descriptor/decode.h" diff --git a/upb/upb/util/BUILD b/upb/util/BUILD similarity index 96% rename from upb/upb/util/BUILD rename to upb/util/BUILD index 46b852153b..40bf564719 100644 --- a/upb/upb/util/BUILD +++ b/upb/util/BUILD @@ -1,5 +1,5 @@ load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -67,12 +67,12 @@ cc_test( ":def_to_proto_test_upb_proto", ":def_to_proto_test_upb_proto_reflection", "//:protobuf", + "@com_google_googletest//:gtest_main", "//upb:descriptor_upb_proto_reflection", "//upb:mem", "//upb:reflection", - "//upb/upb/test:parse_text_proto", + "//upb/test:parse_text_proto", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", ], ) @@ -83,8 +83,8 @@ cc_test( # tags = ["clang_only"], # deps = [ # ":def_to_proto_test_lib", -# "//testing/fuzzing:fuzztest", # "@com_google_googletest//:gtest_main", +# "//testing/fuzzing:fuzztest", # ], # ) # end:google_only @@ -127,12 +127,12 @@ cc_test( ":required_fields", ":required_fields_test_upb_proto", ":required_fields_test_upb_proto_reflection", + "@com_google_googletest//:gtest_main", "//upb:base", "//upb:json", "//upb:mem", "//upb:reflection", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", ], ) @@ -157,10 +157,10 @@ cc_test( srcs = ["compare_test.cc"], deps = [ ":compare", + "@com_google_googletest//:gtest_main", "//upb:wire_internal", "//upb:wire_types", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", ], ) @@ -175,6 +175,6 @@ filegroup( "required_fields.c", "required_fields.h", ], - visibility = ["//upb/python/dist:__pkg__"], + visibility = ["//python/dist:__pkg__"], ) # end:github_only diff --git a/upb/upb/util/README.md b/upb/util/README.md similarity index 100% rename from upb/upb/util/README.md rename to upb/util/README.md diff --git a/upb/upb/util/compare.c b/upb/util/compare.c similarity index 97% rename from upb/upb/util/compare.c rename to upb/util/compare.c index 9cd560843e..2a774d04e3 100644 --- a/upb/upb/util/compare.c +++ b/upb/util/compare.c @@ -5,16 +5,16 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/util/compare.h" +#include "upb/util/compare.h" #include -#include "upb/upb/base/string_view.h" -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/reader.h" -#include "upb/upb/wire/types.h" +#include "upb/base/string_view.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/reader.h" +#include "upb/wire/types.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" struct upb_UnknownFields; typedef struct upb_UnknownFields upb_UnknownFields; diff --git a/upb/upb/util/compare.h b/upb/util/compare.h similarity index 100% rename from upb/upb/util/compare.h rename to upb/util/compare.h diff --git a/upb/upb/util/compare_test.cc b/upb/util/compare_test.cc similarity index 98% rename from upb/upb/util/compare_test.cc rename to upb/util/compare_test.cc index bf226fbbaa..f9b34da7aa 100644 --- a/upb/upb/util/compare_test.cc +++ b/upb/util/compare_test.cc @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/util/compare.h" +#include "upb/util/compare.h" #include @@ -15,8 +15,8 @@ #include #include -#include "upb/upb/wire/internal/swap.h" -#include "upb/upb/wire/types.h" +#include "upb/wire/internal/swap.h" +#include "upb/wire/types.h" struct UnknownField; diff --git a/upb/upb/util/def_to_proto.c b/upb/util/def_to_proto.c similarity index 98% rename from upb/upb/util/def_to_proto.c rename to upb/util/def_to_proto.c index cf3b853ff9..29331d59bb 100644 --- a/upb/upb/util/def_to_proto.c +++ b/upb/util/def_to_proto.c @@ -5,21 +5,21 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/util/def_to_proto.h" +#include "upb/util/def_to_proto.h" #include #include -#include "upb/upb/port/vsnprintf_compat.h" -#include "upb/upb/reflection/enum_reserved_range.h" -#include "upb/upb/reflection/extension_range.h" -#include "upb/upb/reflection/internal/field_def.h" -#include "upb/upb/reflection/internal/file_def.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/reflection/message_reserved_range.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/enum_reserved_range.h" +#include "upb/reflection/extension_range.h" +#include "upb/reflection/internal/field_def.h" +#include "upb/reflection/internal/file_def.h" +#include "upb/reflection/message.h" +#include "upb/reflection/message_reserved_range.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" typedef struct { upb_Arena* arena; diff --git a/upb/upb/util/def_to_proto.h b/upb/util/def_to_proto.h similarity index 97% rename from upb/upb/util/def_to_proto.h rename to upb/util/def_to_proto.h index 53f2d164ff..a8dd70bf0d 100644 --- a/upb/upb/util/def_to_proto.h +++ b/upb/util/def_to_proto.h @@ -8,7 +8,7 @@ #ifndef UPB_UTIL_DEF_TO_PROTO_H_ #define UPB_UTIL_DEF_TO_PROTO_H_ -#include "upb/upb/reflection/def.h" +#include "upb/reflection/def.h" #ifdef __cplusplus extern "C" { diff --git a/upb/upb/util/def_to_proto_fuzz_test.cc b/upb/util/def_to_proto_fuzz_test.cc similarity index 96% rename from upb/upb/util/def_to_proto_fuzz_test.cc rename to upb/util/def_to_proto_fuzz_test.cc index 01ae0ab45f..e2ba440d8c 100644 --- a/upb/upb/util/def_to_proto_fuzz_test.cc +++ b/upb/util/def_to_proto_fuzz_test.cc @@ -10,7 +10,7 @@ #include "google/protobuf/descriptor.pb.h" #include #include "testing/fuzzing/fuzztest.h" -#include "upb/upb/util/def_to_proto_test.h" +#include "upb/util/def_to_proto_test.h" namespace upb_test { diff --git a/upb/upb/util/def_to_proto_public_import_test.proto b/upb/util/def_to_proto_public_import_test.proto similarity index 100% rename from upb/upb/util/def_to_proto_public_import_test.proto rename to upb/util/def_to_proto_public_import_test.proto diff --git a/upb/upb/util/def_to_proto_regular_import_test.proto b/upb/util/def_to_proto_regular_import_test.proto similarity index 100% rename from upb/upb/util/def_to_proto_regular_import_test.proto rename to upb/util/def_to_proto_regular_import_test.proto diff --git a/upb/upb/util/def_to_proto_test.cc b/upb/util/def_to_proto_test.cc similarity index 95% rename from upb/upb/util/def_to_proto_test.cc rename to upb/util/def_to_proto_test.cc index 2c19bfb622..cad9abf535 100644 --- a/upb/upb/util/def_to_proto_test.cc +++ b/upb/util/def_to_proto_test.cc @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/util/def_to_proto.h" +#include "upb/util/def_to_proto.h" #include #include @@ -16,11 +16,11 @@ #include #include "google/protobuf/dynamic_message.h" #include "google/protobuf/util/message_differencer.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/test/parse_text_proto.h" -#include "upb/upb/util/def_to_proto_test.h" -#include "upb/upb/util/def_to_proto_test.upbdefs.h" +#include "upb/mem/arena.hpp" +#include "upb/reflection/def.hpp" +#include "upb/test/parse_text_proto.h" +#include "upb/util/def_to_proto_test.h" +#include "upb/util/def_to_proto_test.upbdefs.h" namespace upb_test { @@ -106,7 +106,7 @@ TEST(DefToProto, Test) { upb::Arena arena; upb::DefPool defpool; upb_StringView test_file_desc = - upb_upb_util_def_to_proto_test_proto_upbdefinit.descriptor; + upb_util_def_to_proto_test_proto_upbdefinit.descriptor; const auto* file_desc = google_protobuf_FileDescriptorProto_parse( test_file_desc.data, test_file_desc.size, arena.ptr()); @@ -120,15 +120,15 @@ TEST(DefToProto, TestRuntimeReflection) { upb::Arena arena; upb::DefPool defpool; upb_StringView test_file_desc = - upb_upb_util_def_to_proto_test_proto_upbdefinit.descriptor; + upb_util_def_to_proto_test_proto_upbdefinit.descriptor; const auto* file_desc = google_protobuf_FileDescriptorProto_parse( test_file_desc.data, test_file_desc.size, arena.ptr()); _upb_DefPool_LoadDefInitEx( defpool.ptr(), - &upb_upb_util_def_to_proto_test_proto_upbdefinit, true); + &upb_util_def_to_proto_test_proto_upbdefinit, true); upb::FileDefPtr file = defpool.FindFileByName( - upb_upb_util_def_to_proto_test_proto_upbdefinit.filename); + upb_util_def_to_proto_test_proto_upbdefinit.filename); CheckFile(file, file_desc); } diff --git a/upb/upb/util/def_to_proto_test.h b/upb/util/def_to_proto_test.h similarity index 97% rename from upb/upb/util/def_to_proto_test.h rename to upb/util/def_to_proto_test.h index 8da74832ca..fdd102ad05 100644 --- a/upb/upb/util/def_to_proto_test.h +++ b/upb/util/def_to_proto_test.h @@ -17,10 +17,10 @@ #include "google/protobuf/descriptor.h" #include "google/protobuf/dynamic_message.h" #include "google/protobuf/util/field_comparator.h" -#include "upb/upb/base/status.hpp" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/util/def_to_proto.h" +#include "upb/base/status.hpp" +#include "upb/mem/arena.hpp" +#include "upb/reflection/def.hpp" +#include "upb/util/def_to_proto.h" namespace upb_test { diff --git a/upb/upb/util/def_to_proto_test.proto b/upb/util/def_to_proto_test.proto similarity index 94% rename from upb/upb/util/def_to_proto_test.proto rename to upb/util/def_to_proto_test.proto index 2d05320f24..e71c33ad53 100644 --- a/upb/upb/util/def_to_proto_test.proto +++ b/upb/util/def_to_proto_test.proto @@ -9,9 +9,9 @@ syntax = "proto2"; package pkg; -import public "upb/upb/util/def_to_proto_public_import_test.proto"; +import public "upb/util/def_to_proto_public_import_test.proto"; -import "upb/upb/util/def_to_proto_regular_import_test.proto"; +import "upb/util/def_to_proto_regular_import_test.proto"; option optimize_for = CODE_SIZE; option go_package = "foo_go_package"; diff --git a/upb/upb/util/def_to_proto_weak_import_test.proto b/upb/util/def_to_proto_weak_import_test.proto similarity index 100% rename from upb/upb/util/def_to_proto_weak_import_test.proto rename to upb/util/def_to_proto_weak_import_test.proto diff --git a/upb/upb/util/def_to_proto_wweak_import_test.proto b/upb/util/def_to_proto_wweak_import_test.proto similarity index 100% rename from upb/upb/util/def_to_proto_wweak_import_test.proto rename to upb/util/def_to_proto_wweak_import_test.proto diff --git a/upb/upb/util/required_fields.c b/upb/util/required_fields.c similarity index 96% rename from upb/upb/util/required_fields.c rename to upb/util/required_fields.c index 685aca18d7..3e4c403bd3 100644 --- a/upb/upb/util/required_fields.c +++ b/upb/util/required_fields.c @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/util/required_fields.h" +#include "upb/util/required_fields.h" #include #include @@ -16,16 +16,16 @@ #include #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/message/types.h" -#include "upb/upb/port/vsnprintf_compat.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/message.h" +#include "upb/base/descriptor_constants.h" +#include "upb/collections/array.h" +#include "upb/collections/map.h" +#include "upb/message/types.h" +#include "upb/port/vsnprintf_compat.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" //////////////////////////////////////////////////////////////////////////////// // upb_FieldPath_ToText() diff --git a/upb/upb/util/required_fields.h b/upb/util/required_fields.h similarity index 95% rename from upb/upb/util/required_fields.h rename to upb/util/required_fields.h index fb78505371..1e6bb9a005 100644 --- a/upb/upb/util/required_fields.h +++ b/upb/util/required_fields.h @@ -10,11 +10,11 @@ #include -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/message.h" +#include "upb/reflection/def.h" +#include "upb/reflection/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -71,6 +71,6 @@ bool upb_util_HasUnsetRequired(const upb_Message* msg, const upb_MessageDef* m, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_UTIL_REQUIRED_FIELDS_H_ */ diff --git a/upb/upb/util/required_fields_test.cc b/upb/util/required_fields_test.cc similarity index 94% rename from upb/upb/util/required_fields_test.cc rename to upb/util/required_fields_test.cc index 87e6ecef1a..4066e31ede 100644 --- a/upb/upb/util/required_fields_test.cc +++ b/upb/util/required_fields_test.cc @@ -5,19 +5,19 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/util/required_fields.h" +#include "upb/util/required_fields.h" #include #include #include #include "absl/strings/string_view.h" -#include "upb/upb/base/status.hpp" -#include "upb/upb/json/decode.h" -#include "upb/upb/mem/arena.hpp" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/util/required_fields_test.upb.h" -#include "upb/upb/util/required_fields_test.upbdefs.h" +#include "upb/base/status.hpp" +#include "upb/json/decode.h" +#include "upb/mem/arena.hpp" +#include "upb/reflection/def.hpp" +#include "upb/util/required_fields_test.upb.h" +#include "upb/util/required_fields_test.upbdefs.h" std::vector PathsToText(upb_FieldPathEntry* entry) { std::vector ret; diff --git a/upb/upb/util/required_fields_test.proto b/upb/util/required_fields_test.proto similarity index 100% rename from upb/upb/util/required_fields_test.proto rename to upb/util/required_fields_test.proto diff --git a/upb/upb/wire/BUILD b/upb/wire/BUILD similarity index 96% rename from upb/upb/wire/BUILD rename to upb/wire/BUILD index 96b9d61cbb..4d9e31cf59 100644 --- a/upb/upb/wire/BUILD +++ b/upb/wire/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "wire", @@ -103,8 +103,8 @@ cc_test( srcs = ["eps_copy_input_stream_test.cc"], deps = [ ":eps_copy_input_stream", - "//upb:mem", "@com_google_googletest//:gtest_main", + "//upb:mem", ], ) @@ -119,7 +119,7 @@ filegroup( ), visibility = [ "//upb/cmake:__pkg__", - "//upb/python/dist:__pkg__", + "//python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/wire/decode.c b/upb/wire/decode.c similarity index 97% rename from upb/upb/wire/decode.c rename to upb/wire/decode.c index 3aa9b58130..b3b8f9236b 100644 --- a/upb/upb/wire/decode.c +++ b/upb/wire/decode.c @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/wire/decode.h" +#include "upb/wire/decode.h" #include #include @@ -13,40 +13,40 @@ #include #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/internal/array.h" -#include "upb/upb/collections/internal/map.h" -#include "upb/upb/collections/internal/map_entry.h" -#include "upb/upb/collections/map.h" -#include "upb/upb/hash/common.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/mem/internal/arena.h" -#include "upb/upb/message/internal/accessors.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/message/message.h" -#include "upb/upb/message/tagged_ptr.h" -#include "upb/upb/mini_table/enum.h" -#include "upb/upb/mini_table/extension.h" -#include "upb/upb/mini_table/extension_registry.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/internal/enum.h" -#include "upb/upb/mini_table/internal/field.h" -#include "upb/upb/mini_table/internal/message.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/mini_table/sub.h" -#include "upb/upb/port/atomic.h" -#include "upb/upb/wire/encode.h" -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/internal/constants.h" -#include "upb/upb/wire/internal/decode.h" -#include "upb/upb/wire/internal/swap.h" -#include "upb/upb/wire/reader.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/collections/internal/array.h" +#include "upb/collections/internal/map.h" +#include "upb/collections/internal/map_entry.h" +#include "upb/collections/map.h" +#include "upb/hash/common.h" +#include "upb/mem/arena.h" +#include "upb/mem/internal/arena.h" +#include "upb/message/internal/accessors.h" +#include "upb/message/internal/extension.h" +#include "upb/message/internal/message.h" +#include "upb/message/message.h" +#include "upb/message/tagged_ptr.h" +#include "upb/mini_table/enum.h" +#include "upb/mini_table/extension.h" +#include "upb/mini_table/extension_registry.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/internal/enum.h" +#include "upb/mini_table/internal/field.h" +#include "upb/mini_table/internal/message.h" +#include "upb/mini_table/message.h" +#include "upb/mini_table/sub.h" +#include "upb/port/atomic.h" +#include "upb/wire/encode.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/internal/constants.h" +#include "upb/wire/internal/decode.h" +#include "upb/wire/internal/swap.h" +#include "upb/wire/reader.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" // A few fake field types for our tables. enum { diff --git a/upb/upb/wire/decode.h b/upb/wire/decode.h similarity index 95% rename from upb/upb/wire/decode.h rename to upb/wire/decode.h index bbf7505fb2..7f2eafddca 100644 --- a/upb/upb/wire/decode.h +++ b/upb/wire/decode.h @@ -13,13 +13,13 @@ #include #include -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/message.h" -#include "upb/upb/mini_table/extension_registry.h" -#include "upb/upb/mini_table/message.h" +#include "upb/mem/arena.h" +#include "upb/message/message.h" +#include "upb/mini_table/extension_registry.h" +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -127,6 +127,6 @@ UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_WIRE_DECODE_H_ */ diff --git a/upb/upb/wire/decode_fast.c b/upb/wire/decode_fast.c similarity index 99% rename from upb/upb/wire/decode_fast.c rename to upb/wire/decode_fast.c index 1935d00cc1..857d84a026 100644 --- a/upb/upb/wire/decode_fast.c +++ b/upb/wire/decode_fast.c @@ -15,14 +15,14 @@ // field type (eg. oneof boolean field with a 1 byte tag) and then dispatch // to the specialized function as quickly as possible. -#include "upb/upb/wire/decode_fast.h" +#include "upb/wire/decode_fast.h" -#include "upb/upb/collections/internal/array.h" -#include "upb/upb/message/internal/types.h" -#include "upb/upb/wire/internal/decode.h" +#include "upb/collections/internal/array.h" +#include "upb/message/internal/types.h" +#include "upb/wire/internal/decode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #if UPB_FASTTABLE diff --git a/upb/upb/wire/decode_fast.h b/upb/wire/decode_fast.h similarity index 97% rename from upb/upb/wire/decode_fast.h rename to upb/wire/decode_fast.h index 70f03b8b30..395342a2d6 100644 --- a/upb/upb/wire/decode_fast.h +++ b/upb/wire/decode_fast.h @@ -42,10 +42,10 @@ #ifndef UPB_WIRE_DECODE_FAST_H_ #define UPB_WIRE_DECODE_FAST_H_ -#include "upb/upb/message/message.h" +#include "upb/message/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -142,6 +142,6 @@ TAGBYTES(r) } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_WIRE_DECODE_FAST_H_ */ diff --git a/upb/upb/wire/encode.c b/upb/wire/encode.c similarity index 95% rename from upb/upb/wire/encode.c rename to upb/wire/encode.c index a8ce4ec484..367199c7b1 100644 --- a/upb/upb/wire/encode.c +++ b/upb/wire/encode.c @@ -7,38 +7,38 @@ // We encode backwards, to avoid pre-computing lengths (one-pass encode). -#include "upb/upb/wire/encode.h" +#include "upb/wire/encode.h" #include #include #include #include -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/collections/array.h" -#include "upb/upb/collections/internal/array.h" -#include "upb/upb/collections/internal/map.h" -#include "upb/upb/collections/internal/map_entry.h" -#include "upb/upb/collections/internal/map_sorter.h" -#include "upb/upb/hash/common.h" -#include "upb/upb/hash/str_table.h" -#include "upb/upb/mem/arena.h" -#include "upb/upb/message/internal/accessors.h" -#include "upb/upb/message/internal/extension.h" -#include "upb/upb/message/message.h" -#include "upb/upb/message/tagged_ptr.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/internal/field.h" -#include "upb/upb/mini_table/internal/message.h" -#include "upb/upb/mini_table/message.h" -#include "upb/upb/mini_table/sub.h" -#include "upb/upb/wire/internal/constants.h" -#include "upb/upb/wire/internal/swap.h" -#include "upb/upb/wire/types.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/collections/array.h" +#include "upb/collections/internal/array.h" +#include "upb/collections/internal/map.h" +#include "upb/collections/internal/map_entry.h" +#include "upb/collections/internal/map_sorter.h" +#include "upb/hash/common.h" +#include "upb/hash/str_table.h" +#include "upb/mem/arena.h" +#include "upb/message/internal/accessors.h" +#include "upb/message/internal/extension.h" +#include "upb/message/message.h" +#include "upb/message/tagged_ptr.h" +#include "upb/mini_table/field.h" +#include "upb/mini_table/internal/field.h" +#include "upb/mini_table/internal/message.h" +#include "upb/mini_table/message.h" +#include "upb/mini_table/sub.h" +#include "upb/wire/internal/constants.h" +#include "upb/wire/internal/swap.h" +#include "upb/wire/types.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define UPB_PB_VARINT_MAX_LEN 10 diff --git a/upb/upb/wire/encode.h b/upb/wire/encode.h similarity index 93% rename from upb/upb/wire/encode.h rename to upb/wire/encode.h index 640e668384..6fb5553143 100644 --- a/upb/upb/wire/encode.h +++ b/upb/wire/encode.h @@ -13,11 +13,11 @@ #include #include -#include "upb/upb/mem/arena.h" -#include "upb/upb/mini_table/message.h" +#include "upb/mem/arena.h" +#include "upb/mini_table/message.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -71,6 +71,6 @@ UPB_API upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_WIRE_ENCODE_H_ */ diff --git a/upb/upb/wire/eps_copy_input_stream.c b/upb/wire/eps_copy_input_stream.c similarity index 93% rename from upb/upb/wire/eps_copy_input_stream.c rename to upb/wire/eps_copy_input_stream.c index 0554ead40c..150cde8cec 100644 --- a/upb/upb/wire/eps_copy_input_stream.c +++ b/upb/wire/eps_copy_input_stream.c @@ -5,7 +5,7 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/wire/eps_copy_input_stream.h" static const char* _upb_EpsCopyInputStream_NoOpCallback( upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) { diff --git a/upb/upb/wire/eps_copy_input_stream.h b/upb/wire/eps_copy_input_stream.h similarity index 99% rename from upb/upb/wire/eps_copy_input_stream.h rename to upb/wire/eps_copy_input_stream.h index 5f17a0e2e3..3d04f1ed45 100644 --- a/upb/upb/wire/eps_copy_input_stream.h +++ b/upb/wire/eps_copy_input_stream.h @@ -10,10 +10,10 @@ #include -#include "upb/upb/mem/arena.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -400,6 +400,6 @@ static UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_WIRE_EPS_COPY_INPUT_STREAM_H_ diff --git a/upb/upb/wire/eps_copy_input_stream_test.cc b/upb/wire/eps_copy_input_stream_test.cc similarity index 99% rename from upb/upb/wire/eps_copy_input_stream_test.cc rename to upb/wire/eps_copy_input_stream_test.cc index 3230ff2319..61445c37d9 100644 --- a/upb/upb/wire/eps_copy_input_stream_test.cc +++ b/upb/wire/eps_copy_input_stream_test.cc @@ -5,14 +5,14 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/wire/eps_copy_input_stream.h" #include #include #include -#include "upb/upb/mem/arena.hpp" +#include "upb/mem/arena.hpp" // begin:google_only // #include "testing/fuzzing/fuzztest.h" // end:google_only diff --git a/upb/upb/wire/internal/constants.h b/upb/wire/internal/constants.h similarity index 100% rename from upb/upb/wire/internal/constants.h rename to upb/wire/internal/constants.h diff --git a/upb/upb/wire/internal/decode.h b/upb/wire/internal/decode.h similarity index 95% rename from upb/upb/wire/internal/decode.h rename to upb/wire/internal/decode.h index b01b339aeb..a058ecb643 100644 --- a/upb/upb/wire/internal/decode.h +++ b/upb/wire/internal/decode.h @@ -13,14 +13,14 @@ #ifndef UPB_WIRE_INTERNAL_DECODE_H_ #define UPB_WIRE_INTERNAL_DECODE_H_ -#include "upb/upb/mem/internal/arena.h" -#include "upb/upb/message/internal/message.h" -#include "upb/upb/wire/decode.h" -#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/mem/internal/arena.h" +#include "upb/message/internal/message.h" +#include "upb/wire/decode.h" +#include "upb/wire/eps_copy_input_stream.h" #include "utf8_range.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define DECODE_NOGROUP (uint32_t) - 1 @@ -138,6 +138,6 @@ UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) { return tag; } -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_WIRE_INTERNAL_DECODE_H_ */ diff --git a/upb/upb/wire/internal/swap.h b/upb/wire/internal/swap.h similarity index 94% rename from upb/upb/wire/internal/swap.h rename to upb/wire/internal/swap.h index 21e92121d1..a203e45c43 100644 --- a/upb/upb/wire/internal/swap.h +++ b/upb/wire/internal/swap.h @@ -11,7 +11,7 @@ #include // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -40,6 +40,6 @@ UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) { } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPB_WIRE_INTERNAL_SWAP_H_ */ diff --git a/upb/upb/wire/reader.c b/upb/wire/reader.c similarity index 90% rename from upb/upb/wire/reader.c rename to upb/wire/reader.c index df46580710..de6cde4fe7 100644 --- a/upb/upb/wire/reader.c +++ b/upb/wire/reader.c @@ -5,13 +5,13 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd -#include "upb/upb/wire/reader.h" +#include "upb/wire/reader.h" -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/types.h" +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/types.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" UPB_NOINLINE _upb_WireReader_ReadLongVarintRet _upb_WireReader_ReadLongVarint(const char* ptr, uint64_t val) { diff --git a/upb/upb/wire/reader.h b/upb/wire/reader.h similarity index 97% rename from upb/upb/wire/reader.h rename to upb/wire/reader.h index fe14086a85..2181aa6a5e 100644 --- a/upb/upb/wire/reader.h +++ b/upb/wire/reader.h @@ -8,12 +8,12 @@ #ifndef UPB_WIRE_READER_H_ #define UPB_WIRE_READER_H_ -#include "upb/upb/wire/eps_copy_input_stream.h" -#include "upb/upb/wire/internal/swap.h" -#include "upb/upb/wire/types.h" // IWYU pragma: export +#include "upb/wire/eps_copy_input_stream.h" +#include "upb/wire/internal/swap.h" +#include "upb/wire/types.h" // IWYU pragma: export // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -202,6 +202,6 @@ UPB_INLINE const char* upb_WireReader_SkipValue( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_WIRE_READER_H_ diff --git a/upb/upb/wire/types.h b/upb/wire/types.h similarity index 100% rename from upb/upb/wire/types.h rename to upb/wire/types.h diff --git a/upb/upbc/BUILD b/upbc/BUILD similarity index 93% rename from upb/upbc/BUILD rename to upbc/BUILD index db554a8a03..399a14e3a7 100644 --- a/upb/upbc/BUILD +++ b/upbc/BUILD @@ -6,21 +6,21 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//upb/bazel:build_defs.bzl", + "//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", ) load( - "//upb/bazel:upb_minitable_proto_library.bzl", + "//bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library", ) load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) load( - "//upb/upbc:bootstrap_compiler.bzl", + "//upbc:bootstrap_compiler.bzl", "bootstrap_cc_binary", "bootstrap_cc_library", "bootstrap_upb_proto_library", @@ -69,7 +69,7 @@ bootstrap_upb_proto_library( google3_src_rules = [ "//net/proto2/proto:descriptor_proto_source", "//net/proto2/compiler/proto:profile.proto", - "//third_party/protobuf/compiler:plugin_proto_source", + "//src/google/protobuf/compiler:plugin_proto_source", ], oss_src_files = ["google/protobuf/compiler/plugin.proto"], oss_src_rules = [ @@ -100,7 +100,7 @@ bootstrap_cc_library( "//upb:reflection", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//upb/protos_generator:__pkg__"], + visibility = ["//protos_generator:__pkg__"], deps = [ "//upb:mini_table", "//upb:mini_table_internal", @@ -123,7 +123,7 @@ bootstrap_cc_library( "//upb:descriptor_upb_proto", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//upb/protos_generator:__pkg__"], + visibility = ["//protos_generator:__pkg__"], deps = [ "//upb:base", "//upb:mini_descriptor", @@ -144,7 +144,7 @@ cc_library( "keywords.h", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//upb/protos_generator:__pkg__"], + visibility = ["//protos_generator:__pkg__"], ) bootstrap_cc_library( @@ -158,7 +158,7 @@ bootstrap_cc_library( "//upb:reflection", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//upb/protos_generator:__pkg__"], + visibility = ["//protos_generator:__pkg__"], deps = [ "//upb:port", "@com_google_absl//absl/container:flat_hash_set", @@ -180,7 +180,7 @@ bootstrap_cc_library( "//upb:reflection", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//upb/protos_generator:__pkg__"], + visibility = ["//protos_generator:__pkg__"], deps = [ "//:protobuf", "//src/google/protobuf/compiler:code_generator", @@ -309,7 +309,7 @@ cc_binary( ":plugin", "//upb:descriptor_upb_proto", "//upb:reflection", - "//upb/upb/util:def_to_proto", + "//upb/util:def_to_proto", ], ) diff --git a/upb/upbc/bootstrap_compiler.bzl b/upbc/bootstrap_compiler.bzl similarity index 96% rename from upb/upbc/bootstrap_compiler.bzl rename to upbc/bootstrap_compiler.bzl index 830136425b..fcc1102c7b 100644 --- a/upb/upbc/bootstrap_compiler.bzl +++ b/upbc/bootstrap_compiler.bzl @@ -1,7 +1,7 @@ """Macros that implement bootstrapping for the upb code generator.""" load( - "//upb/bazel:upb_proto_library.bzl", + "//bazel:upb_proto_library.bzl", "upb_proto_library", ) load( @@ -11,7 +11,7 @@ load( _stages = ["_stage0", "_stage1", ""] _protoc = "//:protoc" -_upbc_base = "//upb/upbc:protoc-gen-" +_upbc_base = "//upbc:protoc-gen-" # begin:google_only # _is_google3 = True @@ -28,7 +28,7 @@ def _upbc(generator, stage): def bootstrap_cc_library(name, visibility, deps, bootstrap_deps, **kwargs): for stage in _stages: - stage_visibility = visibility if stage == "" else ["//upb/upbc:__pkg__"] + stage_visibility = visibility if stage == "" else ["//upbc:__pkg__"] native.cc_library( name = name + stage, deps = deps + [dep + stage for dep in bootstrap_deps], @@ -93,7 +93,7 @@ def _generate_stage1_proto(name, base_dir, src_files, src_rules, generator, kwar "=$(location " + _upbc(generator, 0) + ") " + _extra_proto_path + "--" + generator + "_out=$(RULEDIR)/" + base_dir + "stage1 " + " ".join(src_files), - visibility = ["//upb/upbc:__pkg__"], + visibility = ["//upbc:__pkg__"], tools = [ _protoc, _upbc(generator, 0), @@ -140,7 +140,7 @@ def bootstrap_upb_proto_library( srcs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.c"), hdrs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.h"), includes = [base_dir + "stage0"], - visibility = ["//upb/upbc:__pkg__"], + visibility = ["//upbc:__pkg__"], # This macro signals to the runtime that it must use OSS APIs for descriptor.proto/plugin.proto. defines = ["UPB_BOOTSTRAP_STAGE0"], deps = [ @@ -162,7 +162,7 @@ def bootstrap_upb_proto_library( srcs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb_minitable.c"), hdrs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb_minitable.h"), includes = [base_dir + "stage1"], - visibility = ["//upb/upbc:__pkg__"], + visibility = ["//upbc:__pkg__"], deps = [ "//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", ] + [dep + "_stage1" for dep in deps], @@ -172,7 +172,7 @@ def bootstrap_upb_proto_library( name = name + "_stage1", hdrs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb.h"), includes = [base_dir + "stage1"], - visibility = ["//upb/upbc:__pkg__"], + visibility = ["//upbc:__pkg__"], deps = [ "//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", ":" + name + "_minitable_stage1", diff --git a/upb/upbc/code_generator_request.c b/upbc/code_generator_request.c similarity index 98% rename from upb/upbc/code_generator_request.c rename to upbc/code_generator_request.c index f302c0aef8..4ab5fcc0a0 100644 --- a/upb/upbc/code_generator_request.c +++ b/upbc/code_generator_request.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upbc/code_generator_request.h" +#include "upbc/code_generator_request.h" #include #include "google/protobuf/compiler/plugin.upb.h" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/reflection/def.h" +#include "upb/mini_descriptor/decode.h" +#include "upb/reflection/def.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" /******************************************************************************/ diff --git a/upb/upbc/code_generator_request.h b/upbc/code_generator_request.h similarity index 91% rename from upb/upbc/code_generator_request.h rename to upbc/code_generator_request.h index ba1038f365..3218c08bed 100644 --- a/upb/upbc/code_generator_request.h +++ b/upbc/code_generator_request.h @@ -31,12 +31,12 @@ #ifndef UPBC_CODE_GENERATOR_REQUEST_H_ #define UPBC_CODE_GENERATOR_REQUEST_H_ -#include "upb/upb/mem/arena.h" -#include "upb/upb/reflection/def.h" -#include "upb/upbc/code_generator_request.upb.h" +#include "upb/mem/arena.h" +#include "upb/reflection/def.h" +#include "upbc/code_generator_request.upb.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -50,6 +50,6 @@ upbc_CodeGeneratorRequest* upbc_MakeCodeGeneratorRequest( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* UPBC_CODE_GENERATOR_REQUEST_H_ */ diff --git a/upb/upbc/code_generator_request.proto b/upbc/code_generator_request.proto similarity index 100% rename from upb/upbc/code_generator_request.proto rename to upbc/code_generator_request.proto diff --git a/upb/upbc/common.cc b/upbc/common.cc similarity index 97% rename from upb/upbc/common.cc rename to upbc/common.cc index 1e46cf716e..b5bad200b4 100644 --- a/upb/upbc/common.cc +++ b/upbc/common.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upbc/common.h" +#include "upbc/common.h" #include #include @@ -41,12 +41,12 @@ #include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "upb/upb/mini_table/field.h" -#include "upb/upb/mini_table/internal/field.h" -#include "upb/upb/reflection/def.hpp" +#include "upb/mini_table/field.h" +#include "upb/mini_table/internal/field.h" +#include "upb/reflection/def.hpp" // Must be last -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upbc { diff --git a/upb/upbc/common.h b/upbc/common.h similarity index 99% rename from upb/upbc/common.h rename to upbc/common.h index 4cd0aaca53..e6077146fe 100644 --- a/upb/upbc/common.h +++ b/upbc/common.h @@ -35,7 +35,7 @@ #include "absl/strings/str_replace.h" #include "absl/strings/substitute.h" -#include "upb/upb/reflection/def.hpp" +#include "upb/reflection/def.hpp" namespace upbc { diff --git a/upb/upbc/file_layout.cc b/upbc/file_layout.cc similarity index 97% rename from upb/upbc/file_layout.cc rename to upbc/file_layout.cc index 4c21996cd1..fab61202d0 100644 --- a/upb/upbc/file_layout.cc +++ b/upbc/file_layout.cc @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upbc/file_layout.h" +#include "upbc/file_layout.h" #include #include -#include "upb/upb/mini_table/internal/extension.h" -#include "upb/upbc/common.h" +#include "upb/mini_table/internal/extension.h" +#include "upbc/common.h" namespace upbc { diff --git a/upb/upbc/file_layout.h b/upbc/file_layout.h similarity index 95% rename from upb/upbc/file_layout.h rename to upbc/file_layout.h index 92e078a38c..9df43aaaea 100644 --- a/upb/upbc/file_layout.h +++ b/upbc/file_layout.h @@ -46,13 +46,13 @@ // end:github_only #include "absl/container/flat_hash_map.h" -#include "upb/upb/base/status.hpp" -#include "upb/upb/mini_descriptor/decode.h" -#include "upb/upb/reflection/def.h" -#include "upb/upb/reflection/def.hpp" +#include "upb/base/status.hpp" +#include "upb/mini_descriptor/decode.h" +#include "upb/reflection/def.h" +#include "upb/reflection/def.hpp" // Must be last -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upbc { @@ -124,6 +124,6 @@ class DefPoolPair { } // namespace upbc -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPBC_FILE_LAYOUT_H diff --git a/upb/upbc/get_used_fields.c b/upbc/get_used_fields.c similarity index 95% rename from upb/upbc/get_used_fields.c rename to upbc/get_used_fields.c index f07ccc1e74..796e50133c 100644 --- a/upb/upbc/get_used_fields.c +++ b/upbc/get_used_fields.c @@ -28,18 +28,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upbc/get_used_fields.h" +#include "upbc/get_used_fields.h" #include "google/protobuf/descriptor.upb.h" #include "google/protobuf/compiler/plugin.upb.h" -#include "upb/upb/reflection/def_pool.h" -#include "upb/upb/reflection/field_def.h" -#include "upb/upb/reflection/message.h" -#include "upb/upb/reflection/message_def.h" -#include "upb/upb/wire/decode.h" +#include "upb/reflection/def_pool.h" +#include "upb/reflection/field_def.h" +#include "upb/reflection/message.h" +#include "upb/reflection/message_def.h" +#include "upb/wire/decode.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #define upbdev_Err(...) \ { \ diff --git a/upb/upbc/get_used_fields.h b/upbc/get_used_fields.h similarity index 92% rename from upb/upbc/get_used_fields.h rename to upbc/get_used_fields.h index 6bbbfd3736..ccf3208e85 100644 --- a/upb/upbc/get_used_fields.h +++ b/upbc/get_used_fields.h @@ -31,12 +31,12 @@ #ifndef UPBC_GET_USED_FIELDS #define UPBC_GET_USED_FIELDS -#include "upb/upb/base/status.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.h" +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -52,6 +52,6 @@ UPB_API upb_StringView upbdev_GetUsedFields( } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPBC_GET_USED_FIELDS diff --git a/upb/upbc/keywords.cc b/upbc/keywords.cc similarity index 99% rename from upb/upbc/keywords.cc rename to upbc/keywords.cc index 95abec31f7..3f51705739 100644 --- a/upb/upbc/keywords.cc +++ b/upbc/keywords.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upbc/keywords.h" +#include "upbc/keywords.h" #include #include diff --git a/upb/upbc/keywords.h b/upbc/keywords.h similarity index 100% rename from upb/upbc/keywords.h rename to upbc/keywords.h diff --git a/upb/upbc/names.cc b/upbc/names.cc similarity index 98% rename from upb/upbc/names.cc rename to upbc/names.cc index 0f9d4b619b..63521b8f12 100644 --- a/upb/upbc/names.cc +++ b/upbc/names.cc @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upbc/names.h" +#include "upbc/names.h" #include #include "absl/strings/match.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "upb/upb/reflection/def.hpp" +#include "upb/reflection/def.hpp" namespace upbc { diff --git a/upb/upbc/names.h b/upbc/names.h similarity index 98% rename from upb/upbc/names.h rename to upbc/names.h index f8f7b9433c..87b0a15541 100644 --- a/upb/upbc/names.h +++ b/upbc/names.h @@ -37,7 +37,7 @@ #include "absl/container/flat_hash_map.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "upb/upb/reflection/def.hpp" +#include "upb/reflection/def.hpp" namespace upbc { diff --git a/upb/upbc/plugin.h b/upbc/plugin.h similarity index 98% rename from upb/upbc/plugin.h rename to upbc/plugin.h index bb4b1b08ca..465bda0183 100644 --- a/upb/upbc/plugin.h +++ b/upbc/plugin.h @@ -59,10 +59,10 @@ #include "absl/log/absl_log.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" -#include "upb/upb/reflection/def.hpp" +#include "upb/reflection/def.hpp" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upbc { @@ -207,6 +207,6 @@ class Plugin { } // namespace upbc -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPB_UPBC_PLUGIN_H_ diff --git a/upb/upbc/protoc-gen-upb.cc b/upbc/protoc-gen-upb.cc similarity index 98% rename from upb/upbc/protoc-gen-upb.cc rename to upbc/protoc-gen-upb.cc index e698f0de19..0fa716ad72 100644 --- a/upb/upbc/protoc-gen-upb.cc +++ b/upbc/protoc-gen-upb.cc @@ -49,17 +49,17 @@ #include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/wire/types.h" -#include "upb/upbc/common.h" -#include "upb/upbc/file_layout.h" -#include "upb/upbc/names.h" -#include "upb/upbc/plugin.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/reflection/def.hpp" +#include "upb/wire/types.h" +#include "upbc/common.h" +#include "upbc/file_layout.h" +#include "upbc/names.h" +#include "upbc/plugin.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upbc { namespace { @@ -866,7 +866,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, output( "#ifndef $0_UPB_H_\n" "#define $0_UPB_H_\n\n" - "#include \"upb/upb/generated_code_support.h\"\n\n", + "#include \"upb/generated_code_support.h\"\n\n", ToPreproc(file.name())); for (int i = 0; i < file.public_dependency_count(); i++) { @@ -891,7 +891,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, output( "// Must be last.\n" - "#include \"upb/upb/port/def.inc\"\n" + "#include \"upb/port/def.inc\"\n" "\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" @@ -977,7 +977,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, "} /* extern \"C\" */\n" "#endif\n" "\n" - "#include \"upb/upb/port/undef.inc\"\n" + "#include \"upb/port/undef.inc\"\n" "\n" "#endif /* $0_UPB_H_ */\n", ToPreproc(file.name())); @@ -1064,7 +1064,7 @@ void WriteMiniDescriptorSource(const DefPoolPair& pools, upb::FileDefPtr file, const Options& options, Output& output) { output( "#include \n" - "#include \"upb/upb/generated_code_support.h\"\n" + "#include \"upb/generated_code_support.h\"\n" "#include \"$0\"\n\n", CApiHeaderFilename(file)); diff --git a/upb/upbc/protoc-gen-upb_minitable.cc b/upbc/protoc-gen-upb_minitable.cc similarity index 97% rename from upb/upbc/protoc-gen-upb_minitable.cc rename to upbc/protoc-gen-upb_minitable.cc index c1b4794e51..745dc8441a 100644 --- a/upb/upbc/protoc-gen-upb_minitable.cc +++ b/upbc/protoc-gen-upb_minitable.cc @@ -45,17 +45,17 @@ #include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "upb/upb/base/descriptor_constants.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/wire/types.h" -#include "upb/upbc/common.h" -#include "upb/upbc/file_layout.h" -#include "upb/upbc/names.h" -#include "upb/upbc/plugin.h" +#include "upb/base/descriptor_constants.h" +#include "upb/base/string_view.h" +#include "upb/reflection/def.hpp" +#include "upb/wire/types.h" +#include "upbc/common.h" +#include "upbc/file_layout.h" +#include "upbc/names.h" +#include "upbc/plugin.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upbc { namespace { @@ -111,7 +111,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, output( "#ifndef $0_UPB_MINITABLE_H_\n" "#define $0_UPB_MINITABLE_H_\n\n" - "#include \"upb/upb/generated_code_support.h\"\n", + "#include \"upb/generated_code_support.h\"\n", ToPreproc(file.name())); for (int i = 0; i < file.public_dependency_count(); i++) { @@ -128,7 +128,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, output( "\n" "// Must be last.\n" - "#include \"upb/upb/port/def.inc\"\n" + "#include \"upb/port/def.inc\"\n" "\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" @@ -163,7 +163,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, "} /* extern \"C\" */\n" "#endif\n" "\n" - "#include \"upb/upb/port/undef.inc\"\n" + "#include \"upb/port/undef.inc\"\n" "\n" "#endif /* $0_UPB_MINITABLE_H_ */\n", ToPreproc(file.name())); @@ -630,7 +630,7 @@ void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file, output( "#include \n" - "#include \"upb/upb/generated_code_support.h\"\n" + "#include \"upb/generated_code_support.h\"\n" "#include \"$0\"\n", MiniTableHeaderFilename(file)); @@ -641,7 +641,7 @@ void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file, output( "\n" "// Must be last.\n" - "#include \"upb/upb/port/def.inc\"\n" + "#include \"upb/port/def.inc\"\n" "\n"); int msg_count = WriteMessages(pools, file, output); @@ -657,7 +657,7 @@ void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file, output(" $0,\n", ext_count); output("};\n\n"); - output("#include \"upb/upb/port/undef.inc\"\n"); + output("#include \"upb/port/undef.inc\"\n"); output("\n"); } diff --git a/upb/upbc/protoc-gen-upbdefs.cc b/upbc/protoc-gen-upbdefs.cc similarity index 91% rename from upb/upbc/protoc-gen-upbdefs.cc rename to upbc/protoc-gen-upbdefs.cc index c5cc534f08..d2870b03d2 100644 --- a/upb/upbc/protoc-gen-upbdefs.cc +++ b/upbc/protoc-gen-upbdefs.cc @@ -31,11 +31,11 @@ #include #include "google/protobuf/descriptor.upb.h" -#include "upb/upb/reflection/def.hpp" -#include "upb/upb/util/def_to_proto.h" -#include "upb/upbc/common.h" -#include "upb/upbc/file_layout.h" -#include "upb/upbc/plugin.h" +#include "upb/reflection/def.hpp" +#include "upb/util/def_to_proto.h" +#include "upbc/common.h" +#include "upbc/file_layout.h" +#include "upbc/plugin.h" namespace upbc { namespace { @@ -67,17 +67,17 @@ void WriteDefHeader(upb::FileDefPtr file, Output& output) { output( "#ifndef $0_UPBDEFS_H_\n" "#define $0_UPBDEFS_H_\n\n" - "#include \"upb/upb/reflection/def.h\"\n" - "#include \"upb/upb/reflection/internal/def_pool.h\"\n" - "#include \"upb/upb/port/def.inc\"\n" + "#include \"upb/reflection/def.h\"\n" + "#include \"upb/reflection/internal/def_pool.h\"\n" + "#include \"upb/port/def.inc\"\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" "#endif\n\n", ToPreproc(file.name())); - output("#include \"upb/upb/reflection/def.h\"\n"); + output("#include \"upb/reflection/def.h\"\n"); output("\n"); - output("#include \"upb/upb/port/def.inc\"\n"); + output("#include \"upb/port/def.inc\"\n"); output("\n"); output("extern _upb_DefPool_Init $0;\n", DefInitSymbol(file)); @@ -92,7 +92,7 @@ void WriteDefHeader(upb::FileDefPtr file, Output& output) { "} /* extern \"C\" */\n" "#endif\n" "\n" - "#include \"upb/upb/port/undef.inc\"\n" + "#include \"upb/port/undef.inc\"\n" "\n" "#endif /* $0_UPBDEFS_H_ */\n", ToPreproc(file.name())); @@ -101,7 +101,7 @@ void WriteDefHeader(upb::FileDefPtr file, Output& output) { void WriteDefSource(upb::FileDefPtr file, Output& output) { EmitFileWarning(file.name(), output); - output("#include \"upb/upb/reflection/def.h\"\n"); + output("#include \"upb/reflection/def.h\"\n"); output("#include \"$0\"\n", DefHeaderFilename(file)); output("#include \"$0\"\n", MiniTableHeaderFilename(file)); output("\n"); diff --git a/upb/upbc/protoc-gen-upbdev.cc b/upbc/protoc-gen-upbdev.cc similarity index 98% rename from upb/upbc/protoc-gen-upbdev.cc rename to upbc/protoc-gen-upbdev.cc index 6b209f0c5b..3093169630 100644 --- a/upb/upbc/protoc-gen-upbdev.cc +++ b/upbc/protoc-gen-upbdev.cc @@ -32,8 +32,8 @@ #include #include "google/protobuf/compiler/plugin.upb.h" -#include "upb/upbc/subprocess.h" -#include "upb/upbc/upbdev.h" +#include "upbc/subprocess.h" +#include "upbc/upbdev.h" static constexpr char kDefaultPlugin[] = "protoc_dart_plugin"; diff --git a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c b/upbc/stage0/google/protobuf/compiler/plugin.upb.c similarity index 98% rename from upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c rename to upbc/stage0/google/protobuf/compiler/plugin.upb.c index 26e71c8515..3a677152a6 100644 --- a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c +++ b/upbc/stage0/google/protobuf/compiler/plugin.upb.c @@ -1,5 +1,5 @@ #include -#include "upb/upb/generated_code_support.h" +#include "upb/generated_code_support.h" #include "google/protobuf/compiler/plugin.upb.h" #include "google/protobuf/descriptor.upb.h" diff --git a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h b/upbc/stage0/google/protobuf/compiler/plugin.upb.h similarity index 99% rename from upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h rename to upbc/stage0/google/protobuf/compiler/plugin.upb.h index ffcf6f26b1..4227e51fa7 100644 --- a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h +++ b/upbc/stage0/google/protobuf/compiler/plugin.upb.h @@ -9,10 +9,10 @@ #ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ -#include "upb/upb/generated_code_support.h" +#include "upb/generated_code_support.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -687,6 +687,6 @@ UPB_INLINE struct google_protobuf_GeneratedCodeInfo* google_protobuf_compiler_Co } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ */ diff --git a/upb/upbc/subprocess.cc b/upbc/subprocess.cc similarity index 99% rename from upb/upbc/subprocess.cc rename to upbc/subprocess.cc index 7a509059fe..e0c2604230 100644 --- a/upb/upbc/subprocess.cc +++ b/upbc/subprocess.cc @@ -31,7 +31,7 @@ // Shamelessly copied from the protobuf compiler's subprocess.cc // except this version passes strings instead of Messages. -#include "upb/upbc/subprocess.h" +#include "upbc/subprocess.h" #include #include @@ -48,7 +48,7 @@ #include "absl/strings/substitute.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" namespace upbc { diff --git a/upb/upbc/subprocess.h b/upbc/subprocess.h similarity index 100% rename from upb/upbc/subprocess.h rename to upbc/subprocess.h diff --git a/upb/upbc/upbc_so.c b/upbc/upbc_so.c similarity index 96% rename from upb/upbc/upbc_so.c rename to upbc/upbc_so.c index b70f399c0f..1cfc04b2ab 100644 --- a/upb/upbc/upbc_so.c +++ b/upbc/upbc_so.c @@ -30,5 +30,5 @@ // These headers form a spanning tree for the upbc defs needed by FFI layers. -#include "upb/upbc/get_used_fields.h" -#include "upb/upbc/upbdev.h" +#include "upbc/get_used_fields.h" +#include "upbc/upbdev.h" diff --git a/upb/upbc/upbdev.c b/upbc/upbdev.c similarity index 94% rename from upb/upbc/upbdev.c rename to upbc/upbdev.c index b77c94e256..ffccd07104 100644 --- a/upb/upbc/upbdev.c +++ b/upbc/upbdev.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/upbc/upbdev.h" +#include "upbc/upbdev.h" #ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN @@ -41,13 +41,13 @@ #include "google/protobuf/compiler/plugin.upb.h" #include "google/protobuf/compiler/plugin.upbdefs.h" -#include "upb/upb/base/status.h" -#include "upb/upb/json/decode.h" -#include "upb/upb/json/encode.h" -#include "upb/upb/mem/arena.h" -#include "upb/upbc/code_generator_request.h" -#include "upb/upbc/code_generator_request.upb.h" -#include "upb/upbc/code_generator_request.upbdefs.h" +#include "upb/base/status.h" +#include "upb/json/decode.h" +#include "upb/json/encode.h" +#include "upb/mem/arena.h" +#include "upbc/code_generator_request.h" +#include "upbc/code_generator_request.upb.h" +#include "upbc/code_generator_request.upbdefs.h" static google_protobuf_compiler_CodeGeneratorResponse* upbc_JsonDecode( const char* data, size_t size, upb_Arena* arena, upb_Status* status) { diff --git a/upb/upbc/upbdev.h b/upbc/upbdev.h similarity index 94% rename from upb/upbc/upbdev.h rename to upbc/upbdev.h index b6dca92916..047a1be3e8 100644 --- a/upb/upbc/upbdev.h +++ b/upbc/upbdev.h @@ -31,12 +31,12 @@ #ifndef UPBC_UPBDEV_H_ #define UPBC_UPBDEV_H_ -#include "upb/upb/base/status.h" -#include "upb/upb/base/string_view.h" -#include "upb/upb/mem/arena.h" +#include "upb/base/status.h" +#include "upb/base/string_view.h" +#include "upb/mem/arena.h" // Must be last. -#include "upb/upb/port/def.inc" +#include "upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -66,6 +66,6 @@ UPB_API void upbdev_Status_Clear(upb_Status* status); } /* extern "C" */ #endif -#include "upb/upb/port/undef.inc" +#include "upb/port/undef.inc" #endif // UPBC_UPBDEV_H_