Harmonize license rules between google3 and OSS

This simplifies upb by removing differences between google3 and OSS.

This also points upb at the protobuf license, instead of keeping a separate copy around for upb.

PiperOrigin-RevId: 669447145
pull/18048/head
Joshua Haberman 7 months ago committed by Copybara-Service
parent 593bcfaf57
commit e4449ba248
  1. 7
      BUILD.bazel
  2. 5
      MODULE.bazel
  3. 2
      bazel/common/BUILD
  4. 2
      bazel/private/BUILD
  5. 2
      bazel/tests/BUILD
  6. 5
      bazel/tests/testdata/BUILD
  7. 2
      bazel/toolchains/BUILD
  8. 4
      benchmarks/BUILD
  9. 4
      editions/codegen_tests/BUILD
  10. 2
      hpb/BUILD
  11. 2
      hpb/backend/upb/BUILD
  12. 4
      hpb/bazel/BUILD
  13. 2
      hpb/internal/BUILD
  14. 2
      hpb_generator/BUILD
  15. 4
      hpb_generator/tests/BUILD
  16. 10
      protobuf_deps.bzl
  17. 2
      protos/BUILD
  18. 4
      python/BUILD.bazel
  19. 4
      python/pb_unit_tests/BUILD
  20. 2
      rust/test/upb/BUILD
  21. 4
      rust/upb/BUILD
  22. 12
      third_party/utf8_range/BUILD.bazel
  23. 2
      third_party/utf8_range/fuzz/BUILD.bazel
  24. 10
      upb/BUILD
  25. 4
      upb/bazel/BUILD
  26. 2
      upb/cmake/make_cmakelists.py
  27. 4
      upb/conformance/BUILD
  28. 4
      upb/hash/BUILD
  29. 4
      upb/io/BUILD
  30. 4
      upb/json/BUILD
  31. 4
      upb/lex/BUILD
  32. 4
      upb/test/BUILD
  33. 4
      upb/util/BUILD
  34. 4
      upb_generator/BUILD
  35. 4
      upb_generator/c/BUILD
  36. 4
      upb_generator/minitable/BUILD
  37. 4
      upb_generator/reflection/BUILD

@ -1,6 +1,7 @@
# Bazel (https://bazel.build/) BUILD file for Protobuf.
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_license//rules:license.bzl", "license")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
load("//bazel:cc_proto_library.bzl", "cc_proto_library")
load("//bazel:java_lite_proto_library.bzl", "java_lite_proto_library")
@ -17,6 +18,12 @@ exports_files([
"PrivacyInfo.xcprivacy",
])
license(
name = "license",
package_name = "protobuf",
license_text = ":LICENSE",
)
################################################################################
# Well Known Types Proto Library Rules
#

@ -53,6 +53,11 @@ bazel_dep(
version = "1.9.0",
)
bazel_dep(
name = "rules_license",
version = "0.0.8",
)
bazel_dep(
name = "rules_pkg",
version = "0.7.0",

@ -1,5 +1,7 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
package(default_applicable_licenses = ["//:license"])
bzl_library(
name = "proto_common_bzl",
srcs = [

@ -1,6 +1,8 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//bazel/private:native_bool_flag.bzl", "native_bool_flag")
package(default_applicable_licenses = ["//:license"])
toolchain_type(
name = "proto_toolchain_type",
)

@ -1,3 +1,5 @@
load(":proto_common_compile_tests.bzl", "proto_common_compile_test_suite")
package(default_applicable_licenses = ["//:license"])
proto_common_compile_test_suite(name = "proto_common_compile_test_suite")

@ -1,4 +1,7 @@
package(default_visibility = ["//visibility:public"])
package(
default_applicable_licenses = ["//:license"],
default_visibility = ["//visibility:public"],
)
proto_lang_toolchain(
name = "toolchain",

@ -1,5 +1,7 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
package(default_applicable_licenses = ["//:license"])
bzl_library(
name = "proto_toolchain_bzl",
srcs = [

@ -20,9 +20,7 @@ load(
"tmpl_cc_binary",
)
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -1,5 +1,9 @@
load("//bazel:cc_proto_library.bzl", "cc_proto_library")
package(
default_applicable_licenses = ["//:license"],
)
exports_files(
glob(["*.proto"]),
visibility = [

@ -15,7 +15,7 @@ load(
)
# begin:google_only
# package(default_applicable_licenses = ["//src/google/protobuf:license"])
# package(default_applicable_licenses = ["//:license"])
# end:google_only
licenses(["notice"])

@ -6,7 +6,7 @@
# https://developers.google.com/open-source/licenses/bsd
# begin:google_only
# package(default_applicable_licenses = ["//src/google/protobuf:license"])
# package(default_applicable_licenses = ["//:license"])
# end:google_only
cc_library(

@ -7,9 +7,7 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -11,7 +11,7 @@ load(
)
# begin:google_only
# package(default_applicable_licenses = ["//src/google/protobuf:license"])
# package(default_applicable_licenses = ["//:license"])
# end:google_only
cc_library(

@ -11,7 +11,7 @@ load(
)
# begin:google_only
# package(default_applicable_licenses = ["//src/google/protobuf:license"])
# package(default_applicable_licenses = ["//:license"])
# end:google_only
licenses(["notice"])

@ -25,9 +25,7 @@
# )
# end:google_only
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
# todo: re-add post migration
# begin:google_only

@ -178,6 +178,16 @@ def protobuf_deps():
url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.9.0/rules_kotlin-v1.9.0.tar.gz",
)
if not native.existing_rule("rules_license"):
http_archive(
name = "rules_license",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.8/rules_license-0.0.8.tar.gz",
"https://github.com/bazelbuild/rules_license/releases/download/0.0.8/rules_license-0.0.8.tar.gz",
],
sha256 = "241b06f3097fd186ff468832150d6cc142247dc42a32aaefb56d0099895fd229",
)
# Python Downloads
python_source_archive(
name = "python-3.8.0",

@ -11,7 +11,7 @@
# "UPB_DEFAULT_CPPOPTS",
# )
#
# package(default_applicable_licenses = ["//upb:license"])
# package(default_applicable_licenses = ["//:license"])
#
# licenses(["notice"])
#

@ -20,9 +20,7 @@ build_targets(name = "python")
licenses(["notice"])
package(
# begin:google_only
# default_applicable_licenses = ["//upb:license"],
# end:google_only
default_applicable_licenses = ["//:license"],
default_visibility = ["//python/dist:__pkg__"],
)

@ -11,9 +11,7 @@ load("@pip_deps//:requirements.bzl", "requirement")
load(":pyproto_test_wrapper.bzl", "pyproto_test_wrapper")
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -19,6 +19,8 @@
load("@rules_rust//rust:defs.bzl", "rust_test")
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])
# TODO: Enable this for the cpp kernel and move these tests to shared.

@ -10,9 +10,7 @@ load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
rust_library(
name = "upb",

@ -4,13 +4,23 @@
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
load("@rules_license//rules:license.bzl", "license")
DEFAULT_VISIBILITY = [
"//src/google/protobuf:__subpackages__",
"//third_party/utf8_range:__subpackages__",
"//util/utf8/internal:__subpackages__",
]
package(default_visibility = ["//visibility:public"])
package(
default_applicable_licenses = ["//third_party/utf8_range:license"],
default_visibility = ["//visibility:public"],
)
license(
name = "license",
package_name = "utf8_range",
)
licenses(["notice"])

@ -1,5 +1,7 @@
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
package(default_applicable_licenses = ["//third_party/utf8_range:license"])
cc_fuzz_test(
name = "utf8_validity_fuzzer",
testonly = 1,

@ -12,7 +12,6 @@ load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
# begin:google_only
# load("//tools/build_defs/kotlin/native:rules.bzl", "kt_native_interop_hint")
# load("//tools/build_defs/license:license.bzl", "license")
# end:google_only
# begin:github_only
@ -22,14 +21,7 @@ load(
)
# end:github_only
# begin:google_only
# package(default_applicable_licenses = [":license"])
#
# license(
# name = "license",
# package_name = "upb",
# )
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -8,9 +8,7 @@
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
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -238,6 +238,8 @@ class BuildFileFunctions(object):
def alias(self, **kwargs):
pass
def package(self, **kwargs):
pass
class Converter(object):
def __init__(self):

@ -16,9 +16,7 @@ load(
"make_shell_script",
)
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -7,9 +7,7 @@
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
cc_library(
name = "hash",

@ -1,6 +1,4 @@
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
cc_library(
name = "string",

@ -7,9 +7,7 @@ load(
)
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
cc_library(
name = "json",

@ -7,9 +7,7 @@
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
cc_library(
name = "lex",

@ -19,9 +19,7 @@ load(
"UPB_DEFAULT_CPPOPTS",
)
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
cc_library(
name = "parse_text_proto",

@ -4,9 +4,7 @@ load(
"upb_proto_reflection_library",
)
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -25,9 +25,7 @@ load(
"bootstrap_upb_proto_library",
)
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -8,9 +8,7 @@ load(
"bootstrap_cc_library",
)
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -12,9 +12,7 @@ load(
"bootstrap_cc_library",
)
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

@ -7,9 +7,7 @@
load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS")
# begin:google_only
# package(default_applicable_licenses = ["//upb:license"])
# end:google_only
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])

Loading…
Cancel
Save