Skip to content

Commit

Permalink
Merge pull request #12633 from deannagarcia/22.x
Browse files Browse the repository at this point in the history
Cherrypick changes for 22.4
  • Loading branch information
deannagarcia authored May 2, 2023
2 parents 177411a + 2399885 commit 5855833
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
9 changes: 5 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ local_repository(
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(
name = "com_google_googletest",
sha256 = "833bfaf9f8f508a4ef4a35e25131112ed55bf9ff5c073e272397ff38eb4d90ec",
Expand All @@ -31,10 +36,6 @@ http_archive(
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")

rules_jvm_external_deps()
Expand Down
4 changes: 2 additions & 2 deletions protobuf_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def protobuf_deps():
_github_archive(
name = "com_google_absl",
repo = "https://github.com/abseil/abseil-cpp",
commit = "78be63686ba732b25052be15f8d6dee891c05749", # Abseil LTS 20230125
sha256 = "4f356a07b9ec06ef51f943928508566e992f621ed5fa4dd588865d7bed1284cd",
commit = "b971ac5250ea8de900eae9f95e06548d14cd95fe", # Abseil LTS 20230125.2
sha256 = "f7c2cb2c5accdcbbbd5c0c59f241a988c0b1da2a3b7134b823c0bd613b1a6880",
)

if not native.existing_rule("zlib"):
Expand Down
17 changes: 13 additions & 4 deletions python/internal.bzl
Original file line number Diff line number Diff line change
@@ -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):
strip_prefix = ctx.attr.strip_prefix
Expand All @@ -7,10 +15,11 @@ def _internal_copy_files_impl(ctx):

src_dests = []
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" %
(strip_prefix, src.short_path))
dest = ctx.actions.declare_file(src.short_path[len(strip_prefix):])
(strip_prefix, short_path))
dest = ctx.actions.declare_file(short_path[len(strip_prefix):])
src_dests.append([src, dest])

if ctx.attr.is_windows:
Expand Down

0 comments on commit 5855833

Please sign in to comment.