3535 PythonPackageResource , PythonResource ,
3636 } ,
3737 resource_collection:: {
38- PrePackagedResource , PythonResourceAddCollectionContext , PythonResourceCollector ,
38+ AddResourceAction , PrePackagedResource , PythonResourceAddCollectionContext ,
39+ PythonResourceCollector ,
3940 } ,
4041 } ,
4142 slog:: warn,
@@ -657,7 +658,9 @@ impl PythonBinaryBuilder for StandalonePythonExecutableBuilder {
657658 fn add_distribution_resources (
658659 & mut self ,
659660 callback : Option < ResourceAddCollectionContextCallback > ,
660- ) -> Result < ( ) > {
661+ ) -> Result < Vec < AddResourceAction > > {
662+ let mut actions = vec ! [ ] ;
663+
661664 let core_component = self
662665 . target_distribution
663666 . core_license
@@ -686,7 +689,7 @@ impl PythonBinaryBuilder for StandalonePythonExecutableBuilder {
686689 . add_licensed_component ( component. clone ( ) ) ?;
687690 }
688691
689- self . add_python_extension_module ( & ext, Some ( add_context) ) ?;
692+ actions . extend ( self . add_python_extension_module ( & ext, Some ( add_context) ) ?) ;
690693 }
691694
692695 for resource in self
@@ -725,23 +728,23 @@ impl PythonBinaryBuilder for StandalonePythonExecutableBuilder {
725728 component. set_flavor ( ComponentFlavor :: PythonPackage ) ;
726729
727730 self . resources_collector . add_licensed_component ( component) ?;
728- self . add_python_module_source ( source, Some ( add_context) ) ?;
731+ actions . extend ( self . add_python_module_source ( source, Some ( add_context) ) ?) ;
729732 }
730733 PythonResource :: PackageResource ( r) => {
731- self . add_python_package_resource ( r, Some ( add_context) ) ?;
734+ actions . extend ( self . add_python_package_resource ( r, Some ( add_context) ) ?) ;
732735 }
733736 _ => panic ! ( "should not get here since resources should be filtered above" ) ,
734737 }
735738 }
736739
737- Ok ( ( ) )
740+ Ok ( actions )
738741 }
739742
740743 fn add_python_module_source (
741744 & mut self ,
742745 module : & PythonModuleSource ,
743746 add_context : Option < PythonResourceAddCollectionContext > ,
744- ) -> Result < ( ) > {
747+ ) -> Result < Vec < AddResourceAction > > {
745748 let add_context = add_context. unwrap_or_else ( || {
746749 self . packaging_policy
747750 . derive_add_collection_context ( & module. into ( ) )
@@ -755,7 +758,7 @@ impl PythonBinaryBuilder for StandalonePythonExecutableBuilder {
755758 & mut self ,
756759 resource : & PythonPackageResource ,
757760 add_context : Option < PythonResourceAddCollectionContext > ,
758- ) -> Result < ( ) > {
761+ ) -> Result < Vec < AddResourceAction > > {
759762 let add_context = add_context. unwrap_or_else ( || {
760763 self . packaging_policy
761764 . derive_add_collection_context ( & resource. into ( ) )
@@ -769,7 +772,7 @@ impl PythonBinaryBuilder for StandalonePythonExecutableBuilder {
769772 & mut self ,
770773 resource : & PythonPackageDistributionResource ,
771774 add_context : Option < PythonResourceAddCollectionContext > ,
772- ) -> Result < ( ) > {
775+ ) -> Result < Vec < AddResourceAction > > {
773776 let add_context = add_context. unwrap_or_else ( || {
774777 self . packaging_policy
775778 . derive_add_collection_context ( & resource. into ( ) )
@@ -783,16 +786,17 @@ impl PythonBinaryBuilder for StandalonePythonExecutableBuilder {
783786 & mut self ,
784787 extension_module : & PythonExtensionModule ,
785788 add_context : Option < PythonResourceAddCollectionContext > ,
786- ) -> Result < ( ) > {
789+ ) -> Result < Vec < AddResourceAction > > {
787790 let add_context = add_context. unwrap_or_else ( || {
788791 self . packaging_policy
789792 . derive_add_collection_context ( & extension_module. into ( ) )
790793 } ) ;
791794
792- if let Some ( mut build_context) = self
795+ let ( actions , build_context) = self
793796 . resources_collector
794- . add_python_extension_module_with_context ( extension_module, & add_context) ?
795- {
797+ . add_python_extension_module_with_context ( extension_module, & add_context) ?;
798+
799+ if let Some ( mut build_context) = build_context {
796800 // Resources collector doesn't doesn't know about ignored libraries. So filter
797801 // them here.
798802 build_context. static_libraries = build_context
@@ -816,14 +820,14 @@ impl PythonBinaryBuilder for StandalonePythonExecutableBuilder {
816820 . insert ( extension_module. name . clone ( ) , build_context) ;
817821 }
818822
819- Ok ( ( ) )
823+ Ok ( actions )
820824 }
821825
822826 fn add_file_data (
823827 & mut self ,
824828 file : & File ,
825829 add_context : Option < PythonResourceAddCollectionContext > ,
826- ) -> Result < ( ) > {
830+ ) -> Result < Vec < AddResourceAction > > {
827831 let add_context = add_context. unwrap_or_else ( || {
828832 self . packaging_policy
829833 . derive_add_collection_context ( & file. into ( ) )
0 commit comments