feat(runtime): cache compiled components
Enable Wasmtime's persistent compilation cache and expose an optional cache directory in RuntimeConfig. Create and canonicalize the configured directory before Engine construction, and report cache filesystem and configuration failures through dedicated RuntimeError variants.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Runtime error taxonomy exposed to management layers.
|
||||
|
||||
use std::time::Duration;
|
||||
use std::{path::PathBuf, time::Duration};
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
@@ -36,6 +36,16 @@ pub enum RuntimeError {
|
||||
#[error("runtime creation failed: {0}")]
|
||||
RuntimeCreation(#[source] wasmtime::Error),
|
||||
|
||||
#[error("failed to prepare Component compilation cache {path}: {source}")]
|
||||
CacheDirectory {
|
||||
path: PathBuf,
|
||||
#[source]
|
||||
source: std::io::Error,
|
||||
},
|
||||
|
||||
#[error("invalid Component compilation cache configuration: {0}")]
|
||||
CacheConfiguration(#[source] wasmtime::Error),
|
||||
|
||||
#[error("failed to read component artifact {path}: {source}")]
|
||||
ArtifactRead {
|
||||
path: String,
|
||||
|
||||
Reference in New Issue
Block a user