mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-31 23:32:04 +00:00
Merge remote-tracking branch 'origin/master' into feature/dynasm-backend
This commit is contained in:
@@ -7,7 +7,7 @@ use std::{
|
||||
};
|
||||
|
||||
use wasmer_runtime_core::cache::Error as CacheError;
|
||||
pub use wasmer_runtime_core::cache::{Artifact, Cache, WasmHash};
|
||||
pub use wasmer_runtime_core::cache::{Artifact, Cache, WasmHash, WASMER_VERSION_HASH};
|
||||
|
||||
/// Representation of a directory that contains compiled wasm artifacts.
|
||||
///
|
||||
@@ -40,12 +40,17 @@ pub struct FileSystemCache {
|
||||
|
||||
impl FileSystemCache {
|
||||
/// Construct a new `FileSystemCache` around the specified directory.
|
||||
/// The contents of the cache are stored in sub-versioned directories.
|
||||
///
|
||||
/// # Note:
|
||||
/// This method is unsafe because there's no way to ensure the artifacts
|
||||
/// stored in this cache haven't been corrupted or tampered with.
|
||||
pub unsafe fn new<P: Into<PathBuf>>(path: P) -> io::Result<Self> {
|
||||
let path: PathBuf = path.into();
|
||||
let path: PathBuf = {
|
||||
let mut path = path.into();
|
||||
path.push(WASMER_VERSION_HASH);
|
||||
path
|
||||
};
|
||||
|
||||
if path.exists() {
|
||||
let metadata = path.metadata()?;
|
||||
|
Reference in New Issue
Block a user