Merge pull request #12633 from deannagarcia/22.x

Cherrypick changes for 22.4
pull/12663/head
deannagarcia 2 years ago committed by GitHub
commit 585583316e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      WORKSPACE
  2. 4
      protobuf_deps.bzl
  3. 17
      python/internal.bzl

@ -7,6 +7,11 @@ local_repository(
path = "examples", path = "examples",
) )
# Load common dependencies first to ensure we use the correct version.
load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
protobuf_deps()
http_archive( http_archive(
name = "com_google_googletest", name = "com_google_googletest",
sha256 = "833bfaf9f8f508a4ef4a35e25131112ed55bf9ff5c073e272397ff38eb4d90ec", sha256 = "833bfaf9f8f508a4ef4a35e25131112ed55bf9ff5c073e272397ff38eb4d90ec",
@ -31,10 +36,6 @@ http_archive(
urls = ["https://github.com/bazelbuild/platforms/archive/da5541f26b7de1dc8e04c075c99df5351742a4a2.zip"], # 2022-05-27 urls = ["https://github.com/bazelbuild/platforms/archive/da5541f26b7de1dc8e04c075c99df5351742a4a2.zip"], # 2022-05-27
) )
# Load common dependencies.
load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
protobuf_deps()
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
rules_jvm_external_deps() rules_jvm_external_deps()

@ -40,8 +40,8 @@ def protobuf_deps():
_github_archive( _github_archive(
name = "com_google_absl", name = "com_google_absl",
repo = "https://github.com/abseil/abseil-cpp", repo = "https://github.com/abseil/abseil-cpp",
commit = "78be63686ba732b25052be15f8d6dee891c05749", # Abseil LTS 20230125 commit = "b971ac5250ea8de900eae9f95e06548d14cd95fe", # Abseil LTS 20230125.2
sha256 = "4f356a07b9ec06ef51f943928508566e992f621ed5fa4dd588865d7bed1284cd", sha256 = "f7c2cb2c5accdcbbbd5c0c59f241a988c0b1da2a3b7134b823c0bd613b1a6880",
) )
if not native.existing_rule("zlib"): if not native.existing_rule("zlib"):

@ -1,4 +1,12 @@
# Internal helpers for building the Python protobuf runtime. """
Internal helpers for building the Python protobuf runtime.
"""
def _remove_cross_repo_path(path):
components = path.split("/")
if components[0] == "..":
return "/".join(components[2:])
return path
def _internal_copy_files_impl(ctx): def _internal_copy_files_impl(ctx):
strip_prefix = ctx.attr.strip_prefix strip_prefix = ctx.attr.strip_prefix
@ -7,10 +15,11 @@ def _internal_copy_files_impl(ctx):
src_dests = [] src_dests = []
for src in ctx.files.srcs: for src in ctx.files.srcs:
if src.short_path[:len(strip_prefix)] != strip_prefix: short_path = _remove_cross_repo_path(src.short_path)
if short_path[:len(strip_prefix)] != strip_prefix:
fail("Source does not start with %s: %s" % fail("Source does not start with %s: %s" %
(strip_prefix, src.short_path)) (strip_prefix, short_path))
dest = ctx.actions.declare_file(src.short_path[len(strip_prefix):]) dest = ctx.actions.declare_file(short_path[len(strip_prefix):])
src_dests.append([src, dest]) src_dests.append([src, dest])
if ctx.attr.is_windows: if ctx.attr.is_windows:

Loading…
Cancel
Save