diff --git a/lib/runtime-core/build.rs b/lib/runtime-core/build.rs index 015c4785f..e91238bc6 100644 --- a/lib/runtime-core/build.rs +++ b/lib/runtime-core/build.rs @@ -1,5 +1,5 @@ use blake2b_simd::blake2bp; -use std::{fs, io::Write, path::PathBuf}; +use std::{env, fs, io::Write, path::PathBuf}; const WASMER_VERSION: &'static str = env!("CARGO_PKG_VERSION"); @@ -10,7 +10,7 @@ fn main() { let hasher = state.finalize(); let hash_string = hasher.to_hex().as_str().to_owned(); - let crate_dir = env!("CARGO_MANIFEST_DIR"); + let crate_dir = env::var("OUT_DIR").unwrap(); let wasmer_version_hash_file = { let mut path = PathBuf::from(&crate_dir); path.push("wasmer_version_hash.txt"); diff --git a/lib/runtime-core/src/cache.rs b/lib/runtime-core/src/cache.rs index 7c29b0237..93e14b0f9 100644 --- a/lib/runtime-core/src/cache.rs +++ b/lib/runtime-core/src/cache.rs @@ -209,4 +209,5 @@ pub trait Cache { } /// A unique ID generated from the version of Wasmer for use with cache versioning -pub const WASMER_VERSION_HASH: &'static str = include_str!("../wasmer_version_hash.txt"); +pub const WASMER_VERSION_HASH: &'static str = + include_str!(concat!(env!("OUT_DIR"), "/wasmer_version_hash.txt")); diff --git a/lib/runtime-core/wasmer_version_hash.txt b/lib/runtime-core/wasmer_version_hash.txt deleted file mode 100644 index 4694153e0..000000000 --- a/lib/runtime-core/wasmer_version_hash.txt +++ /dev/null @@ -1 +0,0 @@ -beb6542931f7f7c823b8d1804b12639fd794711af1f90263c5ed7d338bf4429d1cbe69a531f18144f208c33c49ca01315ffa2b23c170e4c979b1114ffcfbba54 \ No newline at end of file