File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1- # Internal helpers for building the Python protobuf runtime.
1+ """
2+ Internal helpers for building the Python protobuf runtime.
3+ """
4+
5+ def _remove_cross_repo_path (path ):
6+ components = path .split ("/" )
7+ if components [0 ] == ".." :
8+ return "/" .join (components [2 :])
9+ return path
210
311def _internal_copy_files_impl (ctx ):
412 strip_prefix = ctx .attr .strip_prefix
@@ -7,10 +15,11 @@ def _internal_copy_files_impl(ctx):
715
816 src_dests = []
917 for src in ctx .files .srcs :
10- if src .short_path [:len (strip_prefix )] != strip_prefix :
18+ short_path = _remove_cross_repo_path (src .short_path )
19+ if short_path [:len (strip_prefix )] != strip_prefix :
1120 fail ("Source does not start with %s: %s" %
12- (strip_prefix , src . short_path ))
13- dest = ctx .actions .declare_file (src . short_path [len (strip_prefix ):])
21+ (strip_prefix , short_path ))
22+ dest = ctx .actions .declare_file (short_path [len (strip_prefix ):])
1423 src_dests .append ([src , dest ])
1524
1625 if ctx .attr .is_windows :
You can’t perform that action at this time.
0 commit comments