From b9d8ff9f5f2ffd58a5df78f76b224f4a8b148b5d Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Tue, 2 May 2023 09:23:39 -0700 Subject: [PATCH] Remove patch to internal protobuf rules now that it's implemented in the proto repository. https://github.com/protocolbuffers/protobuf/commit/859410bccc59aeeef1c48e34960fe93827767bac moved the patch to the protobuf repository. PiperOrigin-RevId: 528804550 --- bazel/protobuf.patch | 32 +------------------------------- bazel/workspace_deps.bzl | 4 ++-- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/bazel/protobuf.patch b/bazel/protobuf.patch index f92bde95ca..16e41c0cbb 100644 --- a/bazel/protobuf.patch +++ b/bazel/protobuf.patch @@ -37,34 +37,4 @@ + return f # Search internally. - path = '.' - ---- python/internal.bzl -+++ python/internal.bzl -@@ -1,5 +1,11 @@ - # 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 - if strip_prefix[-1] != "/": -@@ -7,10 +13,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: + path = '.' \ No newline at end of file diff --git a/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl index 2d004d0c2a..362b602c25 100644 --- a/bazel/workspace_deps.bzl +++ b/bazel/workspace_deps.bzl @@ -23,8 +23,8 @@ def upb_deps(): _github_archive, name = "com_google_protobuf", repo = "https://github.com/protocolbuffers/protobuf", - commit = "65e047d098bfdbed787b39d8facc0b74cf3cff73", - sha256 = "807c22ebfb865aa35c17bae77b8f8ecc19c9509c122dbc36f6262cb3c83f1f3c", + commit = "859410bccc59aeeef1c48e34960fe93827767bac", + sha256 = "64829c7a42556d3b6a3e19908abc98c0bd920823ac7546ca5372903a53a0acea", patches = ["@upb//bazel:protobuf.patch"], )