@@ -118,7 +118,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
118118 /// cache.join_artifacts_files(project.artifacts_path());
119119 /// # Ok::<_, Box<dyn std::error::Error>>(())
120120 /// ```
121- #[ instrument( skip_all , name = "sol-files-cache ::read" ) ]
121+ #[ instrument( name = "CompilerCache ::read" , skip_all ) ]
122122 pub fn read ( path : & Path ) -> Result < Self > {
123123 trace ! ( "reading solfiles cache at {}" , path. display( ) ) ;
124124 let cache: Self = utils:: read_json_file ( path) ?;
@@ -149,6 +149,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
149149 }
150150
151151 /// Write the cache as json file to the given path
152+ #[ instrument( name = "CompilerCache::write" , skip_all) ]
152153 pub fn write ( & self , path : & Path ) -> Result < ( ) > {
153154 trace ! ( "writing cache with {} entries to json file: \" {}\" " , self . len( ) , path. display( ) ) ;
154155 utils:: create_parent_dir_all ( path) ?;
@@ -158,6 +159,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
158159 }
159160
160161 /// Removes build infos which don't have any artifacts linked to them.
162+ #[ instrument( skip_all) ]
161163 pub fn remove_outdated_builds ( & mut self ) {
162164 let mut outdated = Vec :: new ( ) ;
163165 for build_id in & self . builds {
@@ -180,6 +182,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
180182 }
181183
182184 /// Sets the `CacheEntry`'s file paths to `root` adjoined to `self.file`.
185+ #[ instrument( skip_all) ]
183186 pub fn join_entries ( & mut self , root : & Path ) -> & mut Self {
184187 self . files = std:: mem:: take ( & mut self . files )
185188 . into_iter ( )
@@ -189,6 +192,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
189192 }
190193
191194 /// Removes `base` from all `CacheEntry` paths
195+ #[ instrument( skip_all) ]
192196 pub fn strip_entries_prefix ( & mut self , base : & Path ) -> & mut Self {
193197 self . files = std:: mem:: take ( & mut self . files )
194198 . into_iter ( )
@@ -198,12 +202,14 @@ impl<S: CompilerSettings> CompilerCache<S> {
198202 }
199203
200204 /// Sets the artifact files location to `base` adjoined to the `CachEntries` artifacts.
205+ #[ instrument( skip_all) ]
201206 pub fn join_artifacts_files ( & mut self , base : & Path ) -> & mut Self {
202207 self . files . values_mut ( ) . for_each ( |entry| entry. join_artifacts_files ( base) ) ;
203208 self
204209 }
205210
206211 /// Removes `base` from all artifact file paths
212+ #[ instrument( skip_all) ]
207213 pub fn strip_artifact_files_prefixes ( & mut self , base : & Path ) -> & mut Self {
208214 self . files . values_mut ( ) . for_each ( |entry| entry. strip_artifact_files_prefixes ( base) ) ;
209215 self
@@ -212,6 +218,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
212218 /// Removes all `CacheEntry` which source files don't exist on disk
213219 ///
214220 /// **NOTE:** this assumes the `files` are absolute
221+ #[ instrument( skip_all) ]
215222 pub fn remove_missing_files ( & mut self ) {
216223 trace ! ( "remove non existing files from cache" ) ;
217224 self . files . retain ( |file, _| {
@@ -292,6 +299,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
292299 ///
293300 /// **NOTE**: unless the cache's `files` keys were modified `contract_file` is expected to be
294301 /// absolute.
302+ #[ instrument( skip_all) ]
295303 pub fn read_artifact < Artifact : DeserializeOwned > (
296304 & self ,
297305 contract_file : & Path ,
@@ -318,6 +326,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
318326 /// let artifacts = cache.read_artifacts::<CompactContractBytecode>()?;
319327 /// # Ok::<_, Box<dyn std::error::Error>>(())
320328 /// ```
329+ #[ instrument( skip_all) ]
321330 pub fn read_artifacts < Artifact : DeserializeOwned + Send + Sync > (
322331 & self ,
323332 ) -> Result < Artifacts < Artifact > > {
@@ -335,6 +344,7 @@ impl<S: CompilerSettings> CompilerCache<S> {
335344 /// objects, so we are basically just partially deserializing build infos here.
336345 ///
337346 /// [BuildContext]: crate::buildinfo::BuildContext
347+ #[ instrument( skip_all) ]
338348 pub fn read_builds < L : Language > ( & self , build_info_dir : & Path ) -> Result < Builds < L > > {
339349 use rayon:: prelude:: * ;
340350
@@ -491,6 +501,7 @@ impl CacheEntry {
491501 /// Reads all artifact files associated with the `CacheEntry`
492502 ///
493503 /// **Note:** all artifact file paths should be absolute.
504+ #[ instrument( skip_all) ]
494505 fn read_artifact_files < Artifact : DeserializeOwned > (
495506 & self ,
496507 ) -> Result < BTreeMap < String , Vec < ArtifactFile < Artifact > > > > {
@@ -514,6 +525,7 @@ impl CacheEntry {
514525 Ok ( artifacts)
515526 }
516527
528+ #[ instrument( skip_all) ]
517529 pub ( crate ) fn merge_artifacts < ' a , A , I , T : ' a > ( & mut self , artifacts : I )
518530 where
519531 I : IntoIterator < Item = ( & ' a String , A ) > ,
@@ -1017,6 +1029,7 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
10171029 ArtifactsCache < ' a , T , C >
10181030{
10191031 /// Create a new cache instance with the given files
1032+ #[ instrument( name = "ArtifactsCache::new" , skip( project, edges) ) ]
10201033 pub fn new (
10211034 project : & ' a Project < C , T > ,
10221035 edges : GraphEdges < C :: ParsedSource > ,
@@ -1042,6 +1055,8 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
10421055 }
10431056 }
10441057
1058+ trace ! ( invalidate_cache, "cache invalidated" ) ;
1059+
10451060 // new empty cache
10461061 CompilerCache :: new ( Default :: default ( ) , paths, preprocessed)
10471062 }
@@ -1135,6 +1150,7 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
11351150 }
11361151
11371152 /// Adds the file's hashes to the set if not set yet
1153+ #[ instrument( skip_all) ]
11381154 pub fn remove_dirty_sources ( & mut self ) {
11391155 match self {
11401156 ArtifactsCache :: Ephemeral ( ..) => { }
@@ -1161,6 +1177,7 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
11611177 }
11621178
11631179 /// Filters out those sources that don't need to be compiled
1180+ #[ instrument( name = "ArtifactsCache::filter" , skip_all) ]
11641181 pub fn filter ( & mut self , sources : & mut Sources , version : & Version , profile : & str ) {
11651182 match self {
11661183 ArtifactsCache :: Ephemeral ( ..) => { }
@@ -1173,6 +1190,7 @@ impl<'a, T: ArtifactOutput<CompilerContract = C::CompilerContract>, C: Compiler>
11731190 /// compiled and written to disk `written_artifacts`.
11741191 ///
11751192 /// Returns all the _cached_ artifacts.
1193+ #[ instrument( name = "ArtifactsCache::consume" , skip_all) ]
11761194 pub fn consume < A > (
11771195 self ,
11781196 written_artifacts : & Artifacts < A > ,
0 commit comments