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
2
10
3
11
def _internal_copy_files_impl (ctx ):
4
12
strip_prefix = ctx .attr .strip_prefix
@@ -7,10 +15,11 @@ def _internal_copy_files_impl(ctx):
7
15
8
16
src_dests = []
9
17
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 :
11
20
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 ):])
14
23
src_dests .append ([src , dest ])
15
24
16
25
if ctx .attr .is_windows :
You can’t perform that action at this time.
0 commit comments