@@ -19,6 +19,7 @@ use std::{
1919
2020use futures_util:: future:: LocalBoxFuture ;
2121use tokio_util:: sync:: CancellationToken ;
22+ use vite_glob:: path:: PathGlobSet ;
2223use vite_path:: { AbsolutePath , RelativePathBuf } ;
2324use vite_task_ipc_shared:: NODE_CLIENT_PATH_ENV_NAME ;
2425use vite_task_plan:: { SpawnExecution , cache_metadata:: CacheMetadata } ;
@@ -92,7 +93,7 @@ struct CacheState<'a> {
9293 /// available, and fspy path tracing is attached only when auto input or
9394 /// output inference needs it. Parts are borrowed in place during the
9495 /// wait/join; the struct is never moved out.
95- tracking : Tracking ,
96+ tracking : Tracking < ' a > ,
9697}
9798
9899/// The IPC server's driver future: resolves with the recorded reports after
@@ -101,15 +102,15 @@ type IpcDriver = LocalBoxFuture<'static, Result<Recorder, vite_task_server::Erro
101102
102103/// fspy path-tracking state, present only when a cached task needs automatic
103104/// input or output inference.
104- struct FspyTracking {
105- input_negative_globs : Vec < wax :: Glob < ' static > > ,
106- output_negative_globs : Vec < wax :: Glob < ' static > > ,
105+ struct FspyTracking < ' a > {
106+ input_negative_globs : PathGlobSet < ' a > ,
107+ output_negative_globs : PathGlobSet < ' a > ,
107108}
108109
109110/// Per-task runner-aware tracking: IPC server handle plus optional fspy state.
110111/// Lifetime-tied to a single `execute_spawn` call.
111- struct Tracking {
112- fspy : Option < FspyTracking > ,
112+ struct Tracking < ' a > {
113+ fspy : Option < FspyTracking < ' a > > ,
113114 ipc_envs : Vec < ( & ' static OsStr , OsString ) > ,
114115 ipc_server_fut : IpcDriver ,
115116 stop_accepting : StopAccepting ,
@@ -168,20 +169,10 @@ impl<'a> ExecutionMode<'a> {
168169 let fspy = if metadata. input_config . includes_auto || metadata. output_config . includes_auto {
169170 // Resolve negative globs for fspy path filtering (already
170171 // workspace-root-relative).
171- let input_negative_globs = metadata
172- . input_config
173- . negative_globs
174- . iter ( )
175- . map ( |p| Ok ( wax:: Glob :: new ( p. as_str ( ) ) ?. into_owned ( ) ) )
176- . collect :: < anyhow:: Result < Vec < _ > > > ( )
177- . map_err ( ExecutionError :: PostRunFingerprint ) ?;
178- let output_negative_globs = metadata
179- . output_config
180- . negative_globs
181- . iter ( )
182- . map ( |p| Ok ( wax:: Glob :: new ( p. as_str ( ) ) ?. into_owned ( ) ) )
183- . collect :: < anyhow:: Result < Vec < _ > > > ( )
184- . map_err ( ExecutionError :: PostRunFingerprint ) ?;
172+ let input_negative_globs = PathGlobSet :: new ( & metadata. input_config . negative_globs )
173+ . map_err ( |err| ExecutionError :: PostRunFingerprint ( err. into ( ) ) ) ?;
174+ let output_negative_globs = PathGlobSet :: new ( & metadata. output_config . negative_globs )
175+ . map_err ( |err| ExecutionError :: PostRunFingerprint ( err. into ( ) ) ) ?;
185176 Some ( FspyTracking { input_negative_globs, output_negative_globs } )
186177 } else {
187178 None
0 commit comments