@@ -41,7 +41,7 @@ use crate::{
4141 CacheOverride , PlanOptions , PlanRequest , QueryPlanRequest , ScriptCommand ,
4242 SyntheticPlanRequest ,
4343 } ,
44- remote_cache:: { self , RemoteCacheConfig } ,
44+ remote_cache:: { self , ResolvedRemoteCacheConfig } ,
4545 resolve_cache_with_override,
4646} ;
4747
@@ -306,7 +306,7 @@ async fn plan_task_as_execution_node(
306306 & cwd,
307307 package_path,
308308 parent_cache_config,
309- context. remote_cache ( ) ,
309+ context. resolved_remote_cache ( ) ,
310310 ) ?;
311311 ExecutionItemKind :: Leaf ( LeafExecutionKind :: Spawn ( spawn_execution) )
312312 }
@@ -337,7 +337,7 @@ async fn plan_task_as_execution_node(
337337 Some ( task_execution_cache_key) ,
338338 & and_item. envs ,
339339 & resolved_options,
340- context. remote_cache ( ) ,
340+ context. resolved_remote_cache ( ) ,
341341 & script_command. envs ,
342342 program_path,
343343 spawn_args,
@@ -405,7 +405,7 @@ async fn plan_task_as_execution_node(
405405 } ) ,
406406 & BTreeMap :: new ( ) ,
407407 & resolved_options,
408- context. remote_cache ( ) ,
408+ context. resolved_remote_cache ( ) ,
409409 context. envs ( ) ,
410410 Arc :: clone ( & * SHELL_PROGRAM_PATH ) ,
411411 SHELL_ARGS . iter ( ) . map ( |s| Str :: from ( * s) ) . chain ( std:: iter:: once ( script) ) . collect ( ) ,
@@ -496,7 +496,7 @@ fn resolve_synthetic_cache_config(
496496 Some ( enabled_cache_config) => {
497497 let EnabledCacheConfig { env, untracked_env, input, output, remote } =
498498 enabled_cache_config;
499- parent_config. remote_cache &= remote. unwrap_or ( true ) ;
499+ parent_config. remote_cache_allowed &= remote. unwrap_or ( true ) ;
500500 parent_config. env_config . fingerprinted_envs . extend ( env. unwrap_or_default ( ) ) ;
501501 parent_config
502502 . env_config
@@ -559,7 +559,7 @@ pub fn plan_synthetic_request(
559559 cwd : & Arc < AbsolutePath > ,
560560 package_dir : & AbsolutePath ,
561561 parent_cache_config : ParentCacheConfig ,
562- remote_cache : Option < & RemoteCacheConfig > ,
562+ resolved_remote_cache : Option < & ResolvedRemoteCacheConfig > ,
563563) -> Result < SpawnExecution , Error > {
564564 let SyntheticPlanRequest { program, args, cache_config, envs } = synthetic_plan_request;
565565
@@ -580,7 +580,7 @@ pub fn plan_synthetic_request(
580580 execution_cache_key,
581581 prefix_envs,
582582 & resolved_options,
583- remote_cache ,
583+ resolved_remote_cache ,
584584 & envs,
585585 program_path,
586586 args,
@@ -617,7 +617,7 @@ fn plan_spawn_execution(
617617 execution_cache_key : Option < ExecutionCacheKey > ,
618618 prefix_envs : & BTreeMap < EnvName < Str > , Str > ,
619619 resolved_task_options : & ResolvedTaskOptions ,
620- remote_cache : Option < & RemoteCacheConfig > ,
620+ resolved_remote_cache : Option < & ResolvedRemoteCacheConfig > ,
621621 envs : & Arc < FxHashMap < EnvName < Arc < OsStr > > , Arc < OsStr > > > ,
622622 program_path : Arc < AbsolutePath > ,
623623 args : Arc < [ Str ] > ,
@@ -691,7 +691,11 @@ fn plan_spawn_execution(
691691 execution_cache_key,
692692 input_config : cache_config. input_config . clone ( ) ,
693693 output_config : cache_config. output_config . clone ( ) ,
694- remote_cache : if cache_config. remote_cache { remote_cache. cloned ( ) } else { None } ,
694+ remote_cache : if cache_config. remote_cache_allowed {
695+ resolved_remote_cache. cloned ( )
696+ } else {
697+ None
698+ } ,
695699 unfiltered_envs : Arc :: clone ( envs) ,
696700 } ) ;
697701 }
@@ -760,16 +764,17 @@ pub async fn plan_query_request(
760764 ) ;
761765 context. set_resolved_global_cache ( final_cache) ;
762766 }
763- // Resolve `context.remote_cache` for this level (see its doc for the data
764- // flow). Write this level's `--remote-cache` flag to `VP_REMOTE_CACHE` first,
765- // so it overrides inherited values and nested levels inherit it. Leave the
766- // default unset so each level picks its own from the endpoint it sees.
767- if let Some ( mode) = plan_options. remote_cache {
767+ // Resolve `context.resolved_remote_cache` for this level (see its doc for
768+ // the data flow). Write this level's `--remote-cache` flag to
769+ // `VP_REMOTE_CACHE` first, so it overrides inherited values and nested
770+ // levels inherit it. Leave the default unset so each level picks its own
771+ // from the endpoint it sees.
772+ if let Some ( mode) = plan_options. remote_cache_mode {
768773 context. add_envs ( std:: iter:: once ( ( remote_cache:: MODE_ENV , mode. as_str ( ) ) ) ) ;
769774 }
770- let remote_cache =
775+ let resolved_remote_cache =
771776 remote_cache:: resolve ( context. resolved_global_cache ( ) . remote_url . as_ref ( ) , context. envs ( ) ) ?;
772- context. set_remote_cache ( remote_cache ) ;
777+ context. set_resolved_remote_cache ( resolved_remote_cache ) ;
773778
774779 // Resolve effective concurrency for this level.
775780 //
@@ -974,7 +979,7 @@ mod tests {
974979
975980 fn parent_config ( includes_auto : bool , positive_globs : & [ & str ] ) -> CacheConfig {
976981 CacheConfig {
977- remote_cache : true ,
982+ remote_cache_allowed : true ,
978983 env_config : EnvConfig {
979984 fingerprinted_envs : FxHashSet :: default ( ) ,
980985 untracked_env : FxHashSet :: default ( ) ,
@@ -1175,7 +1180,7 @@ mod tests {
11751180 )
11761181 . unwrap ( )
11771182 . unwrap ( ) ;
1178- assert ! ( !result. remote_cache ) ;
1183+ assert ! ( !result. remote_cache_allowed ) ;
11791184 }
11801185
11811186 #[ test]
0 commit comments