[protobuf dependency] Remove dangling protobuf2.patch file (#34252)

The patch was stopped being used in
https://github.com/grpc/grpc/pull/32914/files#diff-71613c5804416c5789b4eca93269d89a16bb45071456c8212bb4851fbfcd4851L265
and is not referenced from anywhere.
pull/34224/head
Jan Tattermusch 1 year ago committed by GitHub
parent b38bb68e80
commit 0991b86619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      third_party/protobuf2.patch

@ -1,31 +0,0 @@
diff --git a/python/internal.bzl b/python/internal.bzl
index d9ba37ef8..6596a2d39 100644
--- a/python/internal.bzl
+++ b/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:
Loading…
Cancel
Save