Making caching support optional in Wasmtime (#2119)

This commit moves all of the caching support that currently lives in
`wasmtime-environ` into a `wasmtime-cache` crate and makes it optional. The
goal here is to slim down the `wasmtime-environ` crate and clearly separate
boundaries where caching is a standalone and optional feature, not intertwined
with other crates.
This commit is contained in:
Alex Crichton
2020-08-07 15:42:40 -05:00
committed by GitHub
parent a796d65467
commit 08f9eb1725
21 changed files with 104 additions and 54 deletions

View File

@@ -1,8 +1,7 @@
//! The module that implements the `wasmtime config` command.
use anyhow::{anyhow, Result};
use anyhow::Result;
use structopt::StructOpt;
use wasmtime_environ::cache_create_new_config;
const CONFIG_NEW_AFTER_HELP: &str =
"If no file path is specified, the system configuration file path will be used.";
@@ -37,7 +36,7 @@ pub struct ConfigNewCommand {
impl ConfigNewCommand {
/// Executes the command.
pub fn execute(&self) -> Result<()> {
let path = cache_create_new_config(self.path.as_ref()).map_err(|e| anyhow!(e))?;
let path = wasmtime_cache::create_new_config(self.path.as_ref())?;
println!(
"Successfully created a new configuation file at '{}'.",