Move private definitions out of //bazel
This is needed to make protobuf/bazel package minimal for other proto rules. Keep 4 public bzl files in upb/bazel. They end up under protobuf/bazel, and they are legitimately used by other repositories. Move upb_proto_library_internal/* under bazel/private. Those are utilities used in the rules. Moving them one level deeper makes protobuf/bazel package clean for other rules. Move build_defs.bzl and amalgamation under /upb/bazel. Those are utilities used in the build. Move lua.BUILD and python* uner /python/dist. Those are used in the WORKSPACE dependency setup. PiperOrigin-RevId: 621442236pull/16324/head
parent
dc5053acc4
commit
d7f032ad15
|
@ -135,7 +135,7 @@ ruby_bundle(
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "lua",
|
name = "lua",
|
||||||
build_file = "//bazel:lua.BUILD",
|
build_file = "//python/dist:lua.BUILD",
|
||||||
sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b",
|
sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b",
|
||||||
strip_prefix = "lua-5.2.4",
|
strip_prefix = "lua-5.2.4",
|
||||||
urls = [
|
urls = [
|
||||||
|
@ -160,7 +160,7 @@ http_archive(
|
||||||
patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
|
patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
|
||||||
)
|
)
|
||||||
|
|
||||||
load("//bazel:system_python.bzl", "system_python")
|
load("//python/dist:system_python.bzl", "system_python")
|
||||||
|
|
||||||
system_python(
|
system_python(
|
||||||
name = "system_python",
|
name = "system_python",
|
||||||
|
|
46
bazel/BUILD
46
bazel/BUILD
|
@ -6,8 +6,6 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
||||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
|
||||||
load("@rules_python//python:defs.bzl", "py_binary")
|
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
@ -15,48 +13,6 @@ load("@rules_python//python:defs.bzl", "py_binary")
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
|
||||||
# begin:google_only
|
|
||||||
# selects.config_setting_group(
|
|
||||||
# name = "android_opt",
|
|
||||||
# match_all = [
|
|
||||||
# "//tools/cc_target_os:android",
|
|
||||||
# "//tools/compilation_mode:opt",
|
|
||||||
# ],
|
|
||||||
# )
|
|
||||||
# end:google_only
|
|
||||||
|
|
||||||
py_binary(
|
|
||||||
name = "amalgamate",
|
|
||||||
srcs = ["amalgamate.py"],
|
|
||||||
visibility = ["//upb:__pkg__"],
|
|
||||||
)
|
|
||||||
|
|
||||||
# py_proto_library() is private rule, only intended for internal use by upb.
|
|
||||||
# Hopefully py_proto_library() will eventually be available in rules_proto or
|
|
||||||
# another upstream package.
|
|
||||||
bzl_library(
|
|
||||||
name = "py_proto_library_bzl",
|
|
||||||
srcs = ["py_proto_library.bzl"],
|
|
||||||
deps = [
|
|
||||||
"@rules_python//python:py_info_bzl",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
bzl_library(
|
|
||||||
name = "upb_proto_library_internal_bzl",
|
|
||||||
srcs = [
|
|
||||||
"upb_proto_library_internal/aspect.bzl",
|
|
||||||
"upb_proto_library_internal/cc_library_func.bzl",
|
|
||||||
"upb_proto_library_internal/copts.bzl",
|
|
||||||
"upb_proto_library_internal/rule.bzl",
|
|
||||||
],
|
|
||||||
deps = [
|
|
||||||
"@bazel_skylib//lib:paths",
|
|
||||||
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
|
|
||||||
"@rules_proto//proto:defs",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
bzl_library(
|
bzl_library(
|
||||||
name = "upb_proto_library_bzl",
|
name = "upb_proto_library_bzl",
|
||||||
srcs = [
|
srcs = [
|
||||||
|
@ -67,7 +23,7 @@ bzl_library(
|
||||||
],
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
":upb_proto_library_internal_bzl",
|
"//bazel/private:upb_proto_library_internal_bzl",
|
||||||
"@rules_proto//proto:defs",
|
"@rules_proto//proto:defs",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Copyright (c) 2009-2021, 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
|
||||||
|
|
||||||
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
||||||
|
|
||||||
|
# begin:google_only
|
||||||
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
# end:google_only
|
||||||
|
|
||||||
|
licenses(["notice"])
|
||||||
|
|
||||||
|
bzl_library(
|
||||||
|
name = "upb_proto_library_internal_bzl",
|
||||||
|
srcs = [
|
||||||
|
"upb_proto_library_internal/aspect.bzl",
|
||||||
|
"upb_proto_library_internal/cc_library_func.bzl",
|
||||||
|
"upb_proto_library_internal/copts.bzl",
|
||||||
|
"upb_proto_library_internal/rule.bzl",
|
||||||
|
],
|
||||||
|
visibility = ["//bazel:__pkg__"],
|
||||||
|
deps = [
|
||||||
|
"@bazel_skylib//lib:paths",
|
||||||
|
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
|
||||||
|
"@rules_proto//proto:defs",
|
||||||
|
],
|
||||||
|
)
|
|
@ -1,8 +1,8 @@
|
||||||
"""Implementation of the aspect that powers the upb_*_proto_library() rules."""
|
"""Implementation of the aspect that powers the upb_*_proto_library() rules."""
|
||||||
|
|
||||||
load("@rules_proto//proto:defs.bzl", "proto_common")
|
load("@rules_proto//proto:defs.bzl", "proto_common")
|
||||||
load("//bazel:upb_proto_library_internal/cc_library_func.bzl", "cc_library_func")
|
load(":upb_proto_library_internal/cc_library_func.bzl", "cc_library_func")
|
||||||
load("//bazel:upb_proto_library_internal/copts.bzl", "UpbProtoLibraryCoptsInfo")
|
load(":upb_proto_library_internal/copts.bzl", "UpbProtoLibraryCoptsInfo")
|
||||||
|
|
||||||
# begin:github_only
|
# begin:github_only
|
||||||
_is_google3 = False
|
_is_google3 = False
|
|
@ -1,9 +1,9 @@
|
||||||
"""upb_c_proto_library() exposes upb's generated C API for protobuf (foo.upb.h)"""
|
"""upb_c_proto_library() exposes upb's generated C API for protobuf (foo.upb.h)"""
|
||||||
|
|
||||||
load("//bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect")
|
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/private: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/private:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
|
||||||
load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
|
load("//bazel/private:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
|
||||||
|
|
||||||
UpbWrappedCcInfo = provider(
|
UpbWrappedCcInfo = provider(
|
||||||
"Provider for cc_info for protos",
|
"Provider for cc_info for protos",
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
"""upb_minitable_proto_library() exposes upb's generated minitables (foo.upb_minitable.h)"""
|
"""upb_minitable_proto_library() exposes upb's generated minitables (foo.upb_minitable.h)"""
|
||||||
|
|
||||||
load("//bazel:upb_proto_library_internal/aspect.bzl", "upb_proto_aspect_impl")
|
load("//bazel/private: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/private:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
|
||||||
load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
|
load("//bazel/private:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
|
||||||
|
|
||||||
UpbMinitableCcInfo = provider(
|
UpbMinitableCcInfo = provider(
|
||||||
"Provider for cc_info for protos",
|
"Provider for cc_info for protos",
|
||||||
|
|
|
@ -16,14 +16,14 @@ load(
|
||||||
_upb_c_proto_library = "upb_c_proto_library",
|
_upb_c_proto_library = "upb_c_proto_library",
|
||||||
_upb_c_proto_library_aspect = "upb_c_proto_library_aspect",
|
_upb_c_proto_library_aspect = "upb_c_proto_library_aspect",
|
||||||
)
|
)
|
||||||
load(
|
|
||||||
"//bazel:upb_proto_library_internal/aspect.bzl",
|
|
||||||
_GeneratedSrcsInfo = "GeneratedSrcsInfo",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_proto_reflection_library.bzl",
|
"//bazel:upb_proto_reflection_library.bzl",
|
||||||
_upb_proto_reflection_library = "upb_proto_reflection_library",
|
_upb_proto_reflection_library = "upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//bazel/private:upb_proto_library_internal/aspect.bzl",
|
||||||
|
_GeneratedSrcsInfo = "GeneratedSrcsInfo",
|
||||||
|
)
|
||||||
|
|
||||||
# Temporary alias, see b/291827469.
|
# Temporary alias, see b/291827469.
|
||||||
upb_proto_library = _upb_c_proto_library
|
upb_proto_library = _upb_c_proto_library
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
"""upb_c_proto_reflection_library() exposes upb reflection for protobuf (foo.upbdefs.h)"""
|
"""upb_c_proto_reflection_library() exposes upb reflection for protobuf (foo.upbdefs.h)"""
|
||||||
|
|
||||||
load("//bazel:upb_minitable_proto_library.bzl", "UpbMinitableCcInfo", "upb_minitable_proto_library_aspect")
|
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/private: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/private:upb_proto_library_internal/cc_library_func.bzl", "upb_use_cpp_toolchain")
|
||||||
load("//bazel:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
|
load("//bazel/private:upb_proto_library_internal/rule.bzl", "upb_proto_rule_impl")
|
||||||
|
|
||||||
_UpbDefsWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"])
|
_UpbDefsWrappedCcInfo = provider("Provider for cc_info for protos", fields = ["cc_info"])
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,15 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
|
||||||
"//bazel:build_defs.bzl",
|
|
||||||
"UPB_DEFAULT_COPTS",
|
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//lua:lua_proto_library.bzl",
|
"//lua:lua_proto_library.bzl",
|
||||||
"lua_proto_library",
|
"lua_proto_library",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//upb/bazel:build_defs.bzl",
|
||||||
|
"UPB_DEFAULT_COPTS",
|
||||||
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
|
)
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Load dependencies needed to compile the protobuf library as a 3rd-party consumer."""
|
"""Load dependencies needed to compile the protobuf library as a 3rd-party consumer."""
|
||||||
|
|
||||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||||
load("//bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive")
|
load("//python/dist:python_downloads.bzl", "python_nuget_package", "python_source_archive")
|
||||||
|
|
||||||
PROTOBUF_MAVEN_ARTIFACTS = [
|
PROTOBUF_MAVEN_ARTIFACTS = [
|
||||||
"com.google.caliper:caliper:1.0-beta-3",
|
"com.google.caliper:caliper:1.0-beta-3",
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
|
||||||
"//bazel:build_defs.bzl",
|
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//protos/bazel:upb_cc_proto_library.bzl",
|
"//protos/bazel:upb_cc_proto_library.bzl",
|
||||||
"upb_cc_proto_library_copts",
|
"upb_cc_proto_library_copts",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//upb/bazel:build_defs.bzl",
|
||||||
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,6 @@ load(
|
||||||
"@rules_cc//cc:defs.bzl",
|
"@rules_cc//cc:defs.bzl",
|
||||||
"cc_proto_library",
|
"cc_proto_library",
|
||||||
)
|
)
|
||||||
load(
|
|
||||||
"//bazel:build_defs.bzl",
|
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_proto_library.bzl",
|
"//bazel:upb_proto_library.bzl",
|
||||||
"upb_c_proto_library",
|
"upb_c_proto_library",
|
||||||
|
@ -21,6 +17,10 @@ load(
|
||||||
"//protos/bazel:upb_cc_proto_library.bzl",
|
"//protos/bazel:upb_cc_proto_library.bzl",
|
||||||
"upb_cc_proto_library",
|
"upb_cc_proto_library",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//upb/bazel:build_defs.bzl",
|
||||||
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
|
|
@ -10,9 +10,9 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
|
||||||
|
|
||||||
# begin:github_only
|
# begin:github_only
|
||||||
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
|
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
|
||||||
load("//python:build_targets.bzl", "build_targets")
|
load("//python:build_targets.bzl", "build_targets")
|
||||||
load("//python:py_extension.bzl", "py_extension")
|
load("//python:py_extension.bzl", "py_extension")
|
||||||
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
build_targets(name = "python")
|
build_targets(name = "python")
|
||||||
# end:github_only
|
# end:github_only
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
||||||
load("@bazel_skylib//lib:selects.bzl", "selects")
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||||
load("@pip_deps//:requirements.bzl", "requirement")
|
load("@pip_deps//:requirements.bzl", "requirement")
|
||||||
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
|
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
|
||||||
|
@ -12,8 +13,8 @@ load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
|
||||||
load("@rules_python//python:packaging.bzl", "py_wheel")
|
load("@rules_python//python:packaging.bzl", "py_wheel")
|
||||||
load("@system_python//:version.bzl", "SYSTEM_PYTHON_VERSION")
|
load("@system_python//:version.bzl", "SYSTEM_PYTHON_VERSION")
|
||||||
load("//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION")
|
load("//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION")
|
||||||
load("//bazel:py_proto_library.bzl", "py_proto_library")
|
|
||||||
load(":dist.bzl", "py_dist", "py_dist_module")
|
load(":dist.bzl", "py_dist", "py_dist_module")
|
||||||
|
load(":py_proto_library.bzl", "py_proto_library")
|
||||||
|
|
||||||
licenses(["notice"])
|
licenses(["notice"])
|
||||||
|
|
||||||
|
@ -451,3 +452,14 @@ py_dist(
|
||||||
pure_python_wheel = ":pure_python_wheel",
|
pure_python_wheel = ":pure_python_wheel",
|
||||||
tags = ["manual"],
|
tags = ["manual"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# py_proto_library() is private rule, only intended for internal use by upb.
|
||||||
|
# Hopefully py_proto_library() will eventually be available in rules_proto or
|
||||||
|
# another upstream package.
|
||||||
|
bzl_library(
|
||||||
|
name = "py_proto_library_bzl",
|
||||||
|
srcs = ["py_proto_library.bzl"],
|
||||||
|
deps = [
|
||||||
|
"@rules_python//python:py_info_bzl",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
|
||||||
load("@rules_python//python:defs.bzl", "py_binary")
|
load("@rules_python//python:defs.bzl", "py_binary")
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//bazel/private:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts")
|
||||||
load("//bazel:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# load("//tools/build_defs/kotlin/native:rules.bzl", "kt_native_interop_hint")
|
# load("//tools/build_defs/kotlin/native:rules.bzl", "kt_native_interop_hint")
|
||||||
|
@ -17,7 +17,7 @@ load("//bazel:upb_proto_library_internal/copts.bzl", "upb_proto_library_copts")
|
||||||
|
|
||||||
# begin:github_only
|
# begin:github_only
|
||||||
load(
|
load(
|
||||||
"//bazel:amalgamation.bzl",
|
"//upb/bazel:amalgamation.bzl",
|
||||||
"upb_amalgamation",
|
"upb_amalgamation",
|
||||||
)
|
)
|
||||||
# end:github_only
|
# end:github_only
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "base",
|
name = "base",
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
# Copyright (c) 2009-2021, 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
|
||||||
|
|
||||||
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
||||||
|
load("@rules_python//python:defs.bzl", "py_binary")
|
||||||
|
|
||||||
|
# begin:google_only
|
||||||
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
# end:google_only
|
||||||
|
|
||||||
|
licenses(["notice"])
|
||||||
|
|
||||||
|
# begin:google_only
|
||||||
|
# selects.config_setting_group(
|
||||||
|
# name = "android_opt",
|
||||||
|
# match_all = [
|
||||||
|
# "//tools/cc_target_os:android",
|
||||||
|
# "//tools/compilation_mode:opt",
|
||||||
|
# ],
|
||||||
|
# )
|
||||||
|
# end:google_only
|
||||||
|
|
||||||
|
py_binary(
|
||||||
|
name = "amalgamate",
|
||||||
|
srcs = ["amalgamate.py"],
|
||||||
|
visibility = ["//upb:__pkg__"],
|
||||||
|
)
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
"""Internal rules for building upb."""
|
"""Internal rules for building upb."""
|
||||||
|
|
||||||
load(":upb_proto_library.bzl", "GeneratedSrcsInfo")
|
load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo")
|
||||||
|
|
||||||
# upb_amalgamation() rule, with file_list aspect.
|
# upb_amalgamation() rule, with file_list aspect.
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ upb_amalgamation = rule(
|
||||||
"_amalgamator": attr.label(
|
"_amalgamator": attr.label(
|
||||||
executable = True,
|
executable = True,
|
||||||
cfg = "exec",
|
cfg = "exec",
|
||||||
default = "//bazel:amalgamate",
|
default = "//upb/bazel:amalgamate",
|
||||||
),
|
),
|
||||||
"prefix": attr.string(
|
"prefix": attr.string(
|
||||||
default = "",
|
default = "",
|
|
@ -32,7 +32,7 @@ UPB_DEFAULT_CPPOPTS = select({
|
||||||
"//upb:windows": [],
|
"//upb:windows": [],
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# # Override default -Oz for release builds on Android.
|
# # Override default -Oz for release builds on Android.
|
||||||
# "//bazel:android_opt": _DEFAULT_CPPOPTS + ["-O2"],
|
# "//upb/bazel:android_opt": _DEFAULT_CPPOPTS + ["-O2"],
|
||||||
# end:google_only
|
# end:google_only
|
||||||
"//conditions:default": _DEFAULT_CPPOPTS,
|
"//conditions:default": _DEFAULT_CPPOPTS,
|
||||||
})
|
})
|
||||||
|
@ -42,7 +42,7 @@ UPB_DEFAULT_COPTS = select({
|
||||||
"//upb:fasttable_enabled_setting": ["-std=gnu99", "-DUPB_ENABLE_FASTTABLE"],
|
"//upb:fasttable_enabled_setting": ["-std=gnu99", "-DUPB_ENABLE_FASTTABLE"],
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# # Override default -Oz for release builds on Android.
|
# # Override default -Oz for release builds on Android.
|
||||||
# "//bazel:android_opt": _DEFAULT_COPTS + ["-O2"],
|
# "//upb/bazel:android_opt": _DEFAULT_COPTS + ["-O2"],
|
||||||
# end:google_only
|
# end:google_only
|
||||||
"//conditions:default": _DEFAULT_COPTS,
|
"//conditions:default": _DEFAULT_COPTS,
|
||||||
})
|
})
|
|
@ -6,7 +6,7 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"make_shell_script",
|
"make_shell_script",
|
||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
|
|
|
@ -5,16 +5,16 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
|
||||||
"//bazel:build_defs.bzl",
|
|
||||||
"UPB_DEFAULT_COPTS",
|
|
||||||
"make_shell_script",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_proto_library.bzl",
|
"//bazel:upb_proto_library.bzl",
|
||||||
"upb_c_proto_library",
|
"upb_c_proto_library",
|
||||||
"upb_proto_reflection_library",
|
"upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//upb/bazel:build_defs.bzl",
|
||||||
|
"UPB_DEFAULT_COPTS",
|
||||||
|
"make_shell_script",
|
||||||
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# TODO: describe this package.
|
# TODO: describe this package.
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_proto_library.bzl",
|
"//bazel:upb_proto_library.bzl",
|
||||||
"upb_c_proto_library",
|
"upb_c_proto_library",
|
||||||
"upb_proto_reflection_library",
|
"upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "mem",
|
name = "mem",
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_minitable_proto_library.bzl",
|
"//bazel:upb_minitable_proto_library.bzl",
|
||||||
"upb_minitable_proto_library",
|
"upb_minitable_proto_library",
|
||||||
|
@ -15,6 +14,7 @@ load(
|
||||||
"upb_c_proto_library",
|
"upb_c_proto_library",
|
||||||
"upb_proto_reflection_library",
|
"upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "message",
|
name = "message",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"UPB_DEFAULT_COPTS",
|
"UPB_DEFAULT_COPTS",
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
load(
|
||||||
"//bazel:build_defs.bzl",
|
"//upb/bazel:build_defs.bzl",
|
||||||
"UPB_DEFAULT_COPTS",
|
"UPB_DEFAULT_COPTS",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "port",
|
name = "port",
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
|
||||||
load("//bazel:upb_minitable_proto_library.bzl", "upb_minitable_proto_library")
|
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.bzl", "upb_proto_reflection_library")
|
||||||
load(
|
load(
|
||||||
|
@ -13,6 +12,7 @@ load(
|
||||||
"compile_edition_defaults",
|
"compile_edition_defaults",
|
||||||
"embed_edition_defaults",
|
"embed_edition_defaults",
|
||||||
)
|
)
|
||||||
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
load(
|
load(
|
||||||
"//upb/cmake:build_defs.bzl",
|
"//upb/cmake:build_defs.bzl",
|
||||||
"staleness_test",
|
"staleness_test",
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
|
||||||
"//bazel:build_defs.bzl",
|
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_minitable_proto_library.bzl",
|
"//bazel:upb_minitable_proto_library.bzl",
|
||||||
"upb_minitable_proto_library",
|
"upb_minitable_proto_library",
|
||||||
|
@ -18,6 +14,10 @@ load(
|
||||||
"upb_c_proto_library",
|
"upb_c_proto_library",
|
||||||
"upb_proto_reflection_library",
|
"upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//upb/bazel:build_defs.bzl",
|
||||||
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
|
)
|
||||||
|
|
||||||
# begin:google_only
|
# begin:google_only
|
||||||
# package(default_applicable_licenses = ["//upb:license"])
|
# package(default_applicable_licenses = ["//upb:license"])
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "text",
|
name = "text",
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "wire",
|
name = "wire",
|
||||||
|
|
|
@ -5,11 +5,6 @@
|
||||||
# license that can be found in the LICENSE file or at
|
# license that can be found in the LICENSE file or at
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
|
|
||||||
load(
|
|
||||||
"//bazel:build_defs.bzl",
|
|
||||||
"UPB_DEFAULT_COPTS",
|
|
||||||
"UPB_DEFAULT_CPPOPTS",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//bazel:upb_minitable_proto_library.bzl",
|
"//bazel:upb_minitable_proto_library.bzl",
|
||||||
"upb_minitable_proto_library",
|
"upb_minitable_proto_library",
|
||||||
|
@ -19,6 +14,11 @@ load(
|
||||||
"upb_c_proto_library",
|
"upb_c_proto_library",
|
||||||
"upb_proto_reflection_library",
|
"upb_proto_reflection_library",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//upb/bazel:build_defs.bzl",
|
||||||
|
"UPB_DEFAULT_COPTS",
|
||||||
|
"UPB_DEFAULT_CPPOPTS",
|
||||||
|
)
|
||||||
load(
|
load(
|
||||||
"//upb_generator:bootstrap_compiler.bzl",
|
"//upb_generator:bootstrap_compiler.bzl",
|
||||||
"bootstrap_cc_binary",
|
"bootstrap_cc_binary",
|
||||||
|
|
Loading…
Reference in New Issue