File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ Unreleased changes template.
5959* (pypi) The ` ppc64le ` is now pointing to the right target in the ` platforms ` package.
6060* (gazelle) No longer incorrectly merge ` py_binary ` targets during partial updates in
6161 ` file ` generation mode. Fixed in [ #2619 ] ( https://github.com/bazelbuild/rules_python/pull/2619 ) .
62+ * (gazelle) Don't collapse depsets to a list or into args when generating the modules mapping file.
63+ Support spilling modules mapping args into a params file.
6264
6365{#v0-0-0-added}
6466### Added
Original file line number Diff line number Diff line change @@ -25,18 +25,21 @@ 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+ args .use_param_file (param_file_arg = "@%s" )
3435 if ctx .attr .include_stub_packages :
3536 args .add ("--include_stub_packages" )
37+ args .add ("--output_file" , modules_mapping )
3638 args .add_all ("--exclude_patterns" , ctx .attr .exclude_patterns )
37- args .add_all ("--wheels" , [whl .path for whl in all_wheels .to_list ()])
39+ args .add_all ("--wheels" , all_wheels )
40+
3841 ctx .actions .run (
39- inputs = all_wheels . to_list () ,
42+ inputs = all_wheels ,
4043 outputs = [modules_mapping ],
4144 executable = ctx .executable ._generator ,
4245 arguments = [args ],
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ def data_has_purelib_or_platlib(path):
152152 parser = argparse .ArgumentParser (
153153 prog = "generator" ,
154154 description = "Generates the modules mapping used by the Gazelle manifest." ,
155+ fromfile_prefix_chars = "@" ,
155156 )
156157 parser .add_argument ("--output_file" , type = str )
157158 parser .add_argument ("--include_stub_packages" , action = "store_true" )
You can’t perform that action at this time.
0 commit comments