@@ -25,18 +25,25 @@ 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+
35+ # Spill parameters to a file prefixed with '@'. Note, the '@' prefix is the same
36+ # prefix as used in the `generator.py` in `fromfile_prefix_chars` attribute.
37+ args .use_param_file (param_file_arg = "@%s" )
38+ args .set_param_file_format (format = "multiline" )
3439 if ctx .attr .include_stub_packages :
3540 args .add ("--include_stub_packages" )
41+ args .add ("--output_file" , modules_mapping )
3642 args .add_all ("--exclude_patterns" , ctx .attr .exclude_patterns )
37- args .add_all ("--wheels" , [whl .path for whl in all_wheels .to_list ()])
43+ args .add_all ("--wheels" , all_wheels )
44+
3845 ctx .actions .run (
39- inputs = all_wheels . to_list () ,
46+ inputs = all_wheels ,
4047 outputs = [modules_mapping ],
4148 executable = ctx .executable ._generator ,
4249 arguments = [args ],
0 commit comments