mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-20 16:11:10 +00:00
WIP compilation cache
This commit is contained in:
@@ -23,6 +23,7 @@ revive-dt-report = { workspace = true }
|
||||
|
||||
alloy = { workspace = true }
|
||||
anyhow = { workspace = true }
|
||||
cacache = { workspace = true }
|
||||
clap = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
indexmap = { workspace = true }
|
||||
@@ -30,5 +31,6 @@ tokio = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = { workspace = true }
|
||||
semver = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
temp-dir = { workspace = true }
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
//! A wrapper around the compiler which allows for caching of compilation artifacts so that they can
|
||||
//! be reused between runs.
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use anyhow::{Error, Result};
|
||||
use revive_dt_format::mode::SolcMode;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
struct ArtifactsCache {
|
||||
path: PathBuf,
|
||||
}
|
||||
|
||||
impl ArtifactsCache {
|
||||
pub fn new(path: impl AsRef<Path>) -> Self {
|
||||
Self {
|
||||
path: path.as_ref().to_path_buf(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_invalidated_cache(self) -> Result<Self> {
|
||||
cacache::clear_sync(self.path.as_path()).map_err(Into::<Error>::into)?;
|
||||
Ok(self)
|
||||
}
|
||||
}
|
||||
|
||||
struct CacheKey {
|
||||
metadata_file_path: PathBuf,
|
||||
solc_mode: SolcMode,
|
||||
}
|
||||
@@ -9,6 +9,7 @@ use revive_dt_format::traits::ResolverApi;
|
||||
use revive_dt_node::{Node, geth, kitchensink::KitchensinkNode};
|
||||
use revive_dt_node_interaction::EthereumNode;
|
||||
|
||||
mod cached_compiler;
|
||||
pub mod driver;
|
||||
|
||||
/// One platform can be tested differentially against another.
|
||||
|
||||
Reference in New Issue
Block a user