@@ -14,10 +14,9 @@ use spin_common::sloth;
1414use spin_common:: ui:: quoted_path;
1515use spin_common:: url:: parse_file_url;
1616use spin_factors:: RuntimeFactors ;
17- use spin_factors_executor:: FactorsExecutor ;
17+ use spin_factors_executor:: { ComponentLoader , FactorsExecutor } ;
1818
19- use crate :: loader:: ComponentLoader ;
20- use crate :: { Trigger , TriggerApp } ;
19+ use crate :: { loader:: ComponentLoader as ComponentLoaderImpl , Trigger , TriggerApp } ;
2120pub use initial_kv_setter:: InitialKvSetterHook ;
2221pub use launch_metadata:: LaunchMetadata ;
2322pub use sqlite_statements:: SqlStatementExecutorHook ;
@@ -220,7 +219,15 @@ impl<T: Trigger<B::Factors>, B: RuntimeFactorsBuilder> FactorsTriggerCommand<T,
220219 follow_components,
221220 log_dir,
222221 } ;
223- let run_fut = builder. run ( app, common_options, self . builder_args ) . await ?;
222+
223+ let run_fut = builder
224+ . run (
225+ app,
226+ common_options,
227+ self . builder_args ,
228+ & ComponentLoaderImpl :: new ( ) ,
229+ )
230+ . await ?;
224231
225232 let ( abortable, abort_handle) = futures:: future:: abortable ( run_fut) ;
226233 ctrlc:: set_handler ( move || abort_handle. abort ( ) ) ?;
@@ -302,6 +309,7 @@ impl<T: Trigger<B::Factors>, B: RuntimeFactorsBuilder> TriggerAppBuilder<T, B> {
302309 app : App ,
303310 common_options : FactorsConfig ,
304311 options : B :: CliArgs ,
312+ loader : & impl ComponentLoader ,
305313 ) -> anyhow:: Result < TriggerApp < T , B :: Factors > > {
306314 let mut core_engine_builder = {
307315 self . trigger . update_core_config ( & mut self . engine_config ) ?;
@@ -319,7 +327,7 @@ impl<T: Trigger<B::Factors>, B: RuntimeFactorsBuilder> TriggerAppBuilder<T, B> {
319327 let configured_app = {
320328 let _sloth_guard = warn_if_wasm_build_slothful ( ) ;
321329 executor
322- . load_app ( app, runtime_config. into ( ) , & ComponentLoader :: default ( ) )
330+ . load_app ( app, runtime_config. into ( ) , loader )
323331 . await ?
324332 } ;
325333
@@ -332,8 +340,9 @@ impl<T: Trigger<B::Factors>, B: RuntimeFactorsBuilder> TriggerAppBuilder<T, B> {
332340 app : App ,
333341 common_options : FactorsConfig ,
334342 options : B :: CliArgs ,
343+ loader : & impl ComponentLoader ,
335344 ) -> anyhow:: Result < impl Future < Output = anyhow:: Result < ( ) > > > {
336- let configured_app = self . build ( app, common_options, options) . await ?;
345+ let configured_app = self . build ( app, common_options, options, loader ) . await ?;
337346 Ok ( self . trigger . run ( configured_app) )
338347 }
339348}
0 commit comments