@@ -329,6 +329,16 @@ def _collect_mixed_language_output_files(
329329 ],
330330 )
331331
332+ # TODO: Once BwB mode no longer has target dependencies, remove
333+ # transitive products. Until then we need them, to allow `Copy Bazel
334+ # Outputs` to be able to copy the products of transitive dependencies.
335+ transitive_products = memory_efficient_depset (
336+ transitive = [
337+ info .outputs ._transitive_products
338+ for info in mixed_target_infos
339+ ],
340+ )
341+
332342 transitive_compile_params = memory_efficient_depset (
333343 compile_params_files ,
334344 transitive = [
@@ -354,13 +364,15 @@ def _collect_mixed_language_output_files(
354364 )
355365
356366 products_depset = memory_efficient_depset (
357- (
358- # We don't want to declare indexstore files as outputs, because they
359- # expand to individual files and blow up the BEP. Instead they are
360- # declared as inputs to `indexstores_filelist`, ensuring they are
361- # downloaded as needed.
362- [indexstores_filelist ]
363- ),
367+ # We don't want to declare indexstore files as outputs, because they
368+ # expand to individual files and blow up the BEP. Instead they are
369+ # declared as inputs to `indexstores_filelist`, ensuring they are
370+ # downloaded as needed.
371+ [indexstores_filelist ],
372+ transitive = [
373+ info .outputs ._transitive_products
374+ for info in mixed_target_infos
375+ ],
364376 )
365377
366378 direct_group_list = [
@@ -382,8 +394,7 @@ def _collect_mixed_language_output_files(
382394 _transitive_indexstores = transitive_indexstores ,
383395 _transitive_infoplists = transitive_infoplists ,
384396 _transitive_link_params = transitive_link_params ,
385- # Only top-level targets will have products or dSYM files
386- _transitive_products = EMPTY_DEPSET ,
397+ _transitive_products = products_depset ,
387398 ),
388399 struct (
389400 _direct_group_list = direct_group_list ,
0 commit comments