@@ -25,18 +25,24 @@ module name doesn't match the wheel distribution name.
2525
2626def _modules_mapping_impl (ctx ):
2727 modules_mapping = ctx .actions .declare_file (ctx .attr .modules_mapping_name )
28- args = ctx .actions .args ()
2928 all_wheels = depset (
3029 [whl for whl in ctx .files .wheels ],
3130 transitive = [dep [DefaultInfo ].files for dep in ctx .attr .wheels ] + [dep [DefaultInfo ].data_runfiles .files for dep in ctx .attr .wheels ],
3231 )
33- args .add ("--output_file" , modules_mapping .path )
32+
33+ args = ctx .actions .args ()
34+ # Spill parameters to a file prefixed with '@'. Note, the '@' prefix is the same
35+ # prefix as used in the `generator.py` in `fromfile_prefix_chars` attribute.
36+ args .use_param_file (param_file_arg = "@%s" )
37+ args .set_param_file_format (format = "multiline" )
3438 if ctx .attr .include_stub_packages :
3539 args .add ("--include_stub_packages" )
40+ args .add ("--output_file" , modules_mapping )
3641 args .add_all ("--exclude_patterns" , ctx .attr .exclude_patterns )
37- args .add_all ("--wheels" , [whl .path for whl in all_wheels .to_list ()])
42+ args .add_all ("--wheels" , all_wheels )
43+
3844 ctx .actions .run (
39- inputs = all_wheels . to_list () ,
45+ inputs = all_wheels ,
4046 outputs = [modules_mapping ],
4147 executable = ctx .executable ._generator ,
4248 arguments = [args ],
0 commit comments