@@ -16,7 +16,7 @@ use crate::{
1616 packaging:: { Files , contains_prefix_binary, contains_prefix_text, rewrite_prefix_in_file} ,
1717 recipe:: {
1818 Jinja ,
19- parser:: { Dependency , Requirements , Source } ,
19+ parser:: { CacheOutput , CacheRequirements , Dependency , Requirements , RunExports , Source } ,
2020 } ,
2121 render:: resolved_dependencies:: {
2222 FinalizedDependencies , RunExportsDownload , install_environments, resolve_dependencies,
@@ -26,6 +26,7 @@ use crate::{
2626 fetch_sources,
2727 patch:: apply_patch_custom,
2828 } ,
29+ tool_configuration:: Configuration ,
2930} ;
3031
3132/// Check if a file contains the prefix and determine if it's binary or text
@@ -103,7 +104,7 @@ pub struct Cache {
103104
104105 /// The run exports declared by the cache at build time (rendered form is computed later)
105106 #[ serde( default ) ]
106- pub run_exports : crate :: recipe :: parser :: RunExports ,
107+ pub run_exports : RunExports ,
107108
108109 /// Files (relative to prefix/work_dir) that contain the old prefix string and
109110 /// should be rewritten when restoring to a different location.
@@ -131,20 +132,17 @@ impl Output {
131132 pub fn cache_key_for (
132133 & self ,
133134 cache_name : & str ,
134- cache_reqs : & crate :: recipe :: parser :: CacheRequirements ,
135+ cache_reqs : & CacheRequirements ,
135136 ) -> Result < String , CacheKeyError > {
136137 let requirement_names: HashSet < _ > = cache_reqs
137138 . build
138139 . iter ( )
139140 . chain ( cache_reqs. host . iter ( ) )
140141 . filter_map ( |dep| match dep {
141- crate :: recipe:: parser:: Dependency :: Spec ( spec)
142- if spec. version . is_none ( ) && spec. build . is_none ( ) =>
143- {
144- spec. name
145- . as_ref ( )
146- . map ( |name| name. as_normalized ( ) . to_string ( ) )
147- }
142+ Dependency :: Spec ( spec) if spec. version . is_none ( ) && spec. build . is_none ( ) => spec
143+ . name
144+ . as_ref ( )
145+ . map ( |name| name. as_normalized ( ) . to_string ( ) ) ,
148146 _ => None ,
149147 } )
150148 . chain (
@@ -349,8 +347,8 @@ impl Output {
349347 /// Build or fetch a specific cache output
350348 pub async fn build_or_fetch_cache_output (
351349 mut self ,
352- cache_output : & crate :: recipe :: parser :: CacheOutput ,
353- tool_configuration : & crate :: tool_configuration :: Configuration ,
350+ cache_output : & CacheOutput ,
351+ tool_configuration : & Configuration ,
354352 ) -> Result < Self , miette:: Error > {
355353 let cache_name = cache_output. name . as_normalized ( ) ;
356354 let cache_key = self
@@ -410,12 +408,12 @@ impl Output {
410408 . into_diagnostic ( ) ?;
411409
412410 // Convert CacheRequirements to Requirements
413- let requirements = crate :: recipe :: parser :: Requirements {
411+ let requirements = Requirements {
414412 build : cache_output. requirements . build . clone ( ) ,
415413 host : cache_output. requirements . host . clone ( ) ,
416414 run : Vec :: new ( ) ,
417415 run_constraints : Vec :: new ( ) ,
418- run_exports : crate :: recipe :: parser :: RunExports :: default ( ) ,
416+ run_exports : RunExports :: default ( ) ,
419417 ignore_run_exports : cache_output. ignore_run_exports . clone ( ) . unwrap_or_default ( ) ,
420418 } ;
421419
@@ -564,7 +562,7 @@ impl Output {
564562 /// Note: this modifies the output in place
565563 pub ( crate ) async fn build_or_fetch_cache (
566564 self ,
567- tool_configuration : & crate :: tool_configuration :: Configuration ,
565+ tool_configuration : & Configuration ,
568566 ) -> Result < Self , miette:: Error > {
569567 if let Some ( synthetic_cache) = self . recipe . synthetic_cache_output ( ) {
570568 // Convert to synthetic cache output
@@ -579,7 +577,7 @@ impl Output {
579577 #[ allow( dead_code) ]
580578 async fn build_or_fetch_cache_legacy (
581579 mut self ,
582- tool_configuration : & crate :: tool_configuration :: Configuration ,
580+ tool_configuration : & Configuration ,
583581 ) -> Result < Self , miette:: Error > {
584582 if let Some ( cache) = self . recipe . cache . clone ( ) {
585583 // if we don't have a cache, we need to run the cache build with our current
@@ -741,7 +739,7 @@ impl Output {
741739 work_dir_files : work_dir_files. copied_paths ( ) . to_vec ( ) ,
742740 prefix : self . prefix ( ) . to_path_buf ( ) ,
743741 work_dir : self . build_configuration . directories . work_dir . clone ( ) ,
744- run_exports : crate :: recipe :: parser :: RunExports :: default ( ) ,
742+ run_exports : RunExports :: default ( ) ,
745743 files_with_prefix,
746744 binary_files_with_prefix,
747745 files_with_work_dir : Vec :: new ( ) ,
0 commit comments