Removed obsolete compatibility code from Bazel rules.

PiperOrigin-RevId: 639040724
pull/16966/head
Joshua Haberman 10 months ago committed by Copybara-Service
parent 5619d0cd3a
commit 2124e2687d
  1. 9
      bazel/private/upb_proto_library_internal/cc_library_func.bzl
  2. 19
      protos/bazel/upb_cc_proto_library.bzl

@ -1,9 +1,11 @@
"""A function to compile C/C++ code, like cc_library() but from Starlark."""
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
# begin:google_only
# load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
#
# def upb_use_cpp_toolchain():
# # TODO: We shouldn't need to add this to the result of use_cpp_toolchain().
# return [
# config_common.toolchain_type(
# "@bazel_tools//tools/cpp:cc_runtimes_toolchain_type",
@ -14,11 +16,8 @@
# end:google_only
# begin:github_only
# Compatibility code for Bazel 4.x. Remove this when we drop support for Bazel 4.x.
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
def upb_use_cpp_toolchain():
return ["@bazel_tools//tools/cpp:toolchain_type"]
return use_cpp_toolchain()
# end:github_only

@ -10,11 +10,13 @@
"""
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
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")
#
# def upb_use_cpp_toolchain():
# # TODO: We shouldn't need to add this to the result of use_cpp_toolchain().
# return [
# config_common.toolchain_type(
# "@bazel_tools//tools/cpp:cc_runtimes_toolchain_type",
@ -23,26 +25,15 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
# ] + use_cpp_toolchain()
#
# end:google_only
# begin:github_only
# Compatibility code for Bazel 4.x. Remove this when we drop support for Bazel 4.x.
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect")
# begin:github_only
def upb_use_cpp_toolchain():
return ["@bazel_tools//tools/cpp:toolchain_type"]
return use_cpp_toolchain()
# end:github_only
# Generic support code #########################################################
# begin:github_only
_is_google3 = False
# end:github_only
# begin:google_only
# _is_google3 = True
# end:google_only
def _get_real_short_path(file):
# For some reason, files from other archives have short paths that look like:
# ../com_google_protobuf/google/protobuf/descriptor.proto

Loading…
Cancel
Save