@@ -106,7 +106,7 @@ where
106
106
stale_modules : & mut StaleTracker ,
107
107
incomplete_modules : & mut HashSet < EcoString > ,
108
108
telemetry : & dyn Telemetry ,
109
- ) -> Outcome < ( Vec < Module > , Vec < CacheMetadata > ) , Error > {
109
+ ) -> Outcome < Vec < Module > , Error > {
110
110
let span = tracing:: info_span!( "compile" , package = %self . config. name. as_str( ) ) ;
111
111
let _enter = span. enter ( ) ;
112
112
@@ -186,9 +186,7 @@ where
186
186
187
187
let mut modules = match outcome {
188
188
Outcome :: Ok ( modules) => modules,
189
- Outcome :: PartialFailure ( modules, err) => {
190
- return Outcome :: PartialFailure ( ( modules, loaded. cached_metadata ) , err)
191
- }
189
+ Outcome :: PartialFailure ( modules, err) => return Outcome :: PartialFailure ( modules, err) ,
192
190
Outcome :: TotalFailure ( err) => return Outcome :: TotalFailure ( err) ,
193
191
} ;
194
192
@@ -202,7 +200,7 @@ where
202
200
return error. into ( ) ;
203
201
}
204
202
205
- Outcome :: Ok ( ( modules, loaded . cached_metadata ) )
203
+ Outcome :: Ok ( modules)
206
204
}
207
205
208
206
fn compile_erlang_to_beam ( & mut self , modules : & HashSet < Utf8PathBuf > ) -> Result < ( ) , Error > {
@@ -309,13 +307,11 @@ where
309
307
let name = format ! ( "{}.cache_meta" , & module_name) ;
310
308
let path = artefact_dir. join ( name) ;
311
309
let info = CacheMetadata {
312
- name : module. name . clone ( ) ,
313
310
mtime : module. mtime ,
314
311
codegen_performed : self . perform_codegen ,
315
312
dependencies : module. dependencies . clone ( ) ,
316
313
fingerprint : SourceFingerprint :: new ( & module. code ) ,
317
314
line_numbers : module. ast . type_info . line_numbers . clone ( ) ,
318
- interface : package_interface:: ModuleInterface :: from_module ( module) ,
319
315
} ;
320
316
self . io . write_bytes ( & path, & info. to_binary ( ) ) ?;
321
317
@@ -601,28 +597,28 @@ pub(crate) fn module_name(package_path: &Utf8Path, full_module_path: &Utf8Path)
601
597
#[ derive( Debug ) ]
602
598
pub ( crate ) enum Input {
603
599
New ( UncompiledModule ) ,
604
- Cached ( CachedModule , CacheMetadata ) ,
600
+ Cached ( CachedModule ) ,
605
601
}
606
602
607
603
impl Input {
608
604
pub fn name ( & self ) -> & EcoString {
609
605
match self {
610
606
Input :: New ( m) => & m. name ,
611
- Input :: Cached ( m, _ ) => & m. name ,
607
+ Input :: Cached ( m) => & m. name ,
612
608
}
613
609
}
614
610
615
611
pub fn source_path ( & self ) -> & Utf8Path {
616
612
match self {
617
613
Input :: New ( m) => & m. path ,
618
- Input :: Cached ( m, _ ) => & m. source_path ,
614
+ Input :: Cached ( m) => & m. source_path ,
619
615
}
620
616
}
621
617
622
618
pub fn dependencies ( & self ) -> Vec < EcoString > {
623
619
match self {
624
620
Input :: New ( m) => m. dependencies . iter ( ) . map ( |( n, _) | n. clone ( ) ) . collect ( ) ,
625
- Input :: Cached ( m, _ ) => m. dependencies . iter ( ) . map ( |( n, _) | n. clone ( ) ) . collect ( ) ,
621
+ Input :: Cached ( m) => m. dependencies . iter ( ) . map ( |( n, _) | n. clone ( ) ) . collect ( ) ,
626
622
}
627
623
}
628
624
@@ -652,15 +648,13 @@ pub(crate) struct CachedModule {
652
648
pub line_numbers : LineNumbers ,
653
649
}
654
650
655
- #[ derive( Debug , serde:: Serialize , serde:: Deserialize , Clone ) ]
651
+ #[ derive( Debug , serde:: Serialize , serde:: Deserialize ) ]
656
652
pub struct CacheMetadata {
657
- pub name : EcoString ,
658
653
pub mtime : SystemTime ,
659
654
pub codegen_performed : bool ,
660
655
pub dependencies : Vec < ( EcoString , SrcSpan ) > ,
661
656
pub fingerprint : SourceFingerprint ,
662
657
pub line_numbers : LineNumbers ,
663
- pub interface : package_interface:: ModuleInterface ,
664
658
}
665
659
666
660
impl CacheMetadata {
@@ -673,24 +667,22 @@ impl CacheMetadata {
673
667
}
674
668
}
675
669
676
- #[ derive( Debug , Default ) ]
670
+ #[ derive( Debug , Default , PartialEq , Eq ) ]
677
671
pub ( crate ) struct Loaded {
678
672
pub to_compile : Vec < UncompiledModule > ,
679
673
pub cached : Vec < type_:: ModuleInterface > ,
680
- pub cached_metadata : Vec < CacheMetadata > ,
681
674
}
682
675
683
676
impl Loaded {
684
677
fn empty ( ) -> Self {
685
678
Self {
686
679
to_compile : vec ! [ ] ,
687
680
cached : vec ! [ ] ,
688
- cached_metadata : vec ! [ ] ,
689
681
}
690
682
}
691
683
}
692
684
693
- #[ derive( Debug , PartialEq , Eq , Clone ) ]
685
+ #[ derive( Debug , PartialEq , Eq ) ]
694
686
pub ( crate ) struct UncompiledModule {
695
687
pub path : Utf8PathBuf ,
696
688
pub name : EcoString ,
0 commit comments