File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,14 @@ def _py_wheel_impl(ctx):
98
98
# Currently this is only the description file (if used).
99
99
other_inputs = []
100
100
101
+ # Wrap the inputs into a file to reduce command line length.
102
+ packageinputfile = ctx .actions .declare_file (ctx .attr .name + '_target_wrapped_inputs.txt' )
103
+ content = ''
104
+ for input_file in inputs_to_package .to_list ():
105
+ content += _input_file_to_arg (input_file ) + '\n '
106
+ ctx .actions .write (output = packageinputfile , content = content )
107
+ other_inputs .append (packageinputfile )
108
+
101
109
args = ctx .actions .args ()
102
110
args .add ("--name" , ctx .attr .distribution )
103
111
args .add ("--version" , ctx .attr .version )
@@ -107,7 +115,7 @@ def _py_wheel_impl(ctx):
107
115
args .add ("--out" , outfile .path )
108
116
args .add_all (ctx .attr .strip_path_prefixes , format_each = "--strip_path_prefix=%s" )
109
117
110
- args .add_all ( inputs_to_package , format_each = "--input_file=%s " , map_each = _input_file_to_arg )
118
+ args .add ( "--input_file_list " , packageinputfile )
111
119
112
120
extra_headers = []
113
121
if ctx .attr .author :
Original file line number Diff line number Diff line change @@ -242,6 +242,10 @@ def main():
242
242
help = "'package_path;real_path' pairs listing "
243
243
"files to be included in the wheel. "
244
244
"Can be supplied multiple times." )
245
+ contents_group .add_argument (
246
+ '--input_file_list' , action = 'append' ,
247
+ help = 'A file that has all the input files defined as a list to avoid the long command'
248
+ )
245
249
contents_group .add_argument (
246
250
'--console_script' , action = 'append' ,
247
251
help = "Defines a 'console_script' entry point. "
@@ -264,6 +268,14 @@ def main():
264
268
input_files = [i .split (';' ) for i in arguments .input_file ]
265
269
else :
266
270
input_files = []
271
+
272
+ if arguments .input_file_list :
273
+ for input_file in arguments .input_file_list :
274
+ with open (input_file ) as _file :
275
+ input_file_list = _file .read ().splitlines ()
276
+ for _input_file in input_file_list :
277
+ input_files .append (_input_file .split (';' ))
278
+
267
279
all_files = get_files_to_package (input_files )
268
280
# Sort the files for reproducible order in the archive.
269
281
all_files = sorted (all_files .items ())
You can’t perform that action at this time.
0 commit comments