File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,14 @@ impl Cache {
5050
5151 /// Return the path to a wasm file given its digest.
5252 pub fn wasm_file ( & self , digest : impl AsRef < str > ) -> Result < PathBuf > {
53- let path = self . wasm_path ( & digest) ;
53+ // Check the expected wasm directory first; else check the data directory as a fallback.
54+ // (Layers with unknown media types are currently saved to the data directory in client.pull())
55+ // This adds a bit of futureproofing for fetching wasm layers with different/updated media types
56+ // (see WASM_LAYER_MEDIA_TYPE, which is subject to change in future versions).
57+ let mut path = self . wasm_path ( & digest) ;
58+ if !path. exists ( ) {
59+ path = self . data_path ( & digest) ;
60+ }
5461 ensure ! (
5562 path. exists( ) ,
5663 "cannot find wasm file for digest {}" ,
You can’t perform that action at this time.
0 commit comments