wasmtime-internal-cache 46.0.1

INTERNAL: Support for automatic module caching with Wasmtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::process::Command;
use std::str;

fn main() {
    let (compiler_version, use_mtime) =
        match Command::new("git").args(["rev-parse", "HEAD"]).output() {
            Ok(output) if output.status.success() => (
                str::from_utf8(&output.stdout).unwrap().trim().to_string(),
                true,
            ),
            _ => (env!("CARGO_PKG_VERSION").to_string(), false),
        };
    println!("cargo:rustc-env=COMPILER_VERSION={compiler_version}");
    println!("cargo:rustc-env=USE_MTIME={use_mtime}");
}