diff --git a/lib/runtime/src/cache.rs b/lib/runtime/src/cache.rs index a91a84411..b5ecb825f 100644 --- a/lib/runtime/src/cache.rs +++ b/lib/runtime/src/cache.rs @@ -6,8 +6,8 @@ use std::{ path::PathBuf, }; -use wasmer_runtime_core::cache::{Error as CacheError, cache_versioned_sub_directory}; -pub use wasmer_runtime_core::cache::{Artifact, Cache, WasmHash}; +use wasmer_runtime_core::cache::{Error as CacheError}; +pub use wasmer_runtime_core::cache::{Artifact, Cache, WasmHash, cache_versioned_sub_directory}; /// Representation of a directory that contains compiled wasm artifacts. /// diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index e36e99cb6..da33415a5 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -12,7 +12,7 @@ use structopt::StructOpt; use wasmer::webassembly::InstanceABI; use wasmer::*; use wasmer_emscripten; -use wasmer_runtime::cache::{Cache as BaseCache, FileSystemCache, WasmHash}; +use wasmer_runtime::cache::{Cache as BaseCache, FileSystemCache, WasmHash, cache_versioned_sub_directory}; #[derive(Debug, StructOpt)] #[structopt(name = "wasmer", about = "Wasm execution runtime.")] @@ -71,6 +71,7 @@ fn get_cache_dir() -> PathBuf { Err(_) => { // We use a temporal directory for saving cache files let mut temp_dir = env::temp_dir(); + temp_dir.push(cache_versioned_sub_directory()); temp_dir.push("wasmer"); temp_dir }