@@ -21,7 +21,7 @@ _PLAT_DETECTION_ATTRS = {
21
21
22
22
_PLAT_PLACEHOLDER = "{CODEQL_PLATFORM}"
23
23
24
- def _process_path (path , platform ):
24
+ def _expand_path (path , platform ):
25
25
if _PLAT_PLACEHOLDER in path :
26
26
path = path .replace (_PLAT_PLACEHOLDER , platform )
27
27
return ("arch" , path )
@@ -89,9 +89,9 @@ def _extract_pkg_filegroup_impl(ctx):
89
89
for pfi , origin in src .pkg_files :
90
90
dest_src_map = {}
91
91
for dest , file in pfi .dest_src_map .items ():
92
- file_kind , dest = _process_path (dest , platform )
92
+ file_kind , expanded_dest = _expand_path (dest , platform )
93
93
if file_kind == ctx .attr .kind :
94
- dest_src_map [dest ] = file
94
+ dest_src_map [expanded_dest ] = file
95
95
if dest_src_map :
96
96
pkg_files .append ((PackageFilesInfo (dest_src_map = dest_src_map , attributes = pfi .attributes ), origin ))
97
97
@@ -124,9 +124,10 @@ def _imported_zips_manifest_impl(ctx):
124
124
manifest = []
125
125
files = []
126
126
for zip , prefix in ctx .attr .zips .items ():
127
- _ , prefix = _process_path (prefix , platform )
127
+ # we don't care about the kind here, as we're taking all zips together
128
+ _ , expanded_prefix = _expand_path (prefix , platform )
128
129
zip_files = zip .files .to_list ()
129
- manifest += ["%s:%s" % (prefix , f .short_path ) for f in zip_files ]
130
+ manifest += ["%s:%s" % (expanded_prefix , f .short_path ) for f in zip_files ]
130
131
files += zip_files
131
132
132
133
output = ctx .actions .declare_file (ctx .label .name + ".params" )
@@ -158,9 +159,9 @@ def _zipmerge_impl(ctx):
158
159
output = ctx .actions .declare_file (filename )
159
160
args = [output .path , "--prefix=%s" % ctx .attr .zip_prefix , ctx .file .base .path ]
160
161
for zip , prefix in ctx .attr .zips .items ():
161
- zip_kind , prefix = _process_path (prefix , platform )
162
+ zip_kind , expanded_prefix = _expand_path (prefix , platform )
162
163
if zip_kind == ctx .attr .kind :
163
- args .append ("--prefix=%s/%s" % (ctx .attr .zip_prefix , prefix .rstrip ("/" )))
164
+ args .append ("--prefix=%s/%s" % (ctx .attr .zip_prefix , expanded_prefix .rstrip ("/" )))
164
165
args += [f .path for f in zip .files .to_list ()]
165
166
zips .append (zip .files )
166
167
ctx .actions .run (
0 commit comments