@@ -7,11 +7,11 @@ use std::{
77use anyhow:: { Context , Result } ;
88use spin_common:: ui:: quoted_path;
99use spin_core:: async_trait;
10+ use spin_factor_wasi:: WasiFactor ;
11+ use spin_factors:: { HasInstanceBuilder , RuntimeFactors } ;
1012use spin_factors_executor:: ExecutorHooks ;
1113use tokio:: io:: AsyncWrite ;
1214
13- use crate :: factors:: TriggerFactors ;
14-
1515/// Which components should have their logs followed on stdout/stderr.
1616#[ derive( Clone , Debug , Default ) ]
1717pub enum FollowComponents {
@@ -89,10 +89,10 @@ impl StdioLoggingExecutorHooks {
8989}
9090
9191#[ async_trait]
92- impl < U > ExecutorHooks < TriggerFactors , U > for StdioLoggingExecutorHooks {
92+ impl < F : RuntimeFactors , U > ExecutorHooks < F , U > for StdioLoggingExecutorHooks {
9393 async fn configure_app (
9494 & mut self ,
95- configured_app : & spin_factors:: ConfiguredApp < TriggerFactors > ,
95+ configured_app : & spin_factors:: ConfiguredApp < F > ,
9696 ) -> anyhow:: Result < ( ) > {
9797 self . validate_follows ( configured_app. app ( ) ) ?;
9898 if let Some ( dir) = & self . log_dir {
@@ -107,10 +107,12 @@ impl<U> ExecutorHooks<TriggerFactors, U> for StdioLoggingExecutorHooks {
107107
108108 fn prepare_instance (
109109 & self ,
110- builder : & mut spin_factors_executor:: FactorsInstanceBuilder < TriggerFactors , U > ,
110+ builder : & mut spin_factors_executor:: FactorsInstanceBuilder < F , U > ,
111111 ) -> anyhow:: Result < ( ) > {
112112 let component_id = builder. app_component ( ) . id ( ) . to_string ( ) ;
113- let wasi_builder = builder. factor_builders ( ) . wasi ( ) ;
113+ let Some ( wasi_builder) = builder. factor_builders ( ) . for_factor :: < WasiFactor > ( ) else {
114+ return Ok ( ( ) ) ;
115+ } ;
114116 wasi_builder. stdout_pipe ( self . component_stdio_writer (
115117 & component_id,
116118 "stdout" ,
0 commit comments