diff --git a/WORKSPACE b/WORKSPACE index 2301093274..4c403ac43b 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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", @@ -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() diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 4297b6c6cb..6ba6c12be6 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -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"): diff --git a/python/internal.bzl b/python/internal.bzl index d9ba37ef86..af87aed786 100644 --- a/python/internal.bzl +++ b/python/internal.bzl @@ -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 @@ -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: