mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 21:58:01 +00:00
7f81f37e0c
Pre-eliminary support for LLVM releases and resolc binary releases by streamlining the build process for all supported hosts platforms. - Introduce the revive-llvm-builder crate with the revive-llvm builder utilty. - Do not rely on the LLVM dependency in $PATH to decouple the system LLVM installation from the LLVM host dependency. - Fix the emscripten build by decoupling the host and native LLVM dependencies. Thus allowing a single LLVM emscripten release that can be used on any host platform. - An example Dockerfile building an alpine container with a fully statically linked resolc ELF binary. - Remove the Debian builder utilities and workflow.
37 lines
1.1 KiB
Rust
37 lines
1.1 KiB
Rust
use assert_fs::fixture::FileWriteStr;
|
|
|
|
pub const REVIVE_LLVM: &str = "revive-llvm";
|
|
pub const REVIVE_LLVM_REPO_URL: &str = "https://github.com/llvm/llvm-project";
|
|
pub const REVIVE_LLVM_REPO_TEST_BRANCH: &str = "release/18.x";
|
|
|
|
pub struct TestDir {
|
|
_lockfile: assert_fs::NamedTempFile,
|
|
path: std::path::PathBuf,
|
|
}
|
|
|
|
/// Creates a temporary lock file for testing.
|
|
impl TestDir {
|
|
pub fn with_lockfile(reference: Option<String>) -> anyhow::Result<Self> {
|
|
let file =
|
|
assert_fs::NamedTempFile::new(revive_llvm_builder::lock::LLVM_LOCK_DEFAULT_PATH)?;
|
|
let lock = revive_llvm_builder::Lock {
|
|
url: REVIVE_LLVM_REPO_URL.to_string(),
|
|
branch: REVIVE_LLVM_REPO_TEST_BRANCH.to_string(),
|
|
r#ref: reference,
|
|
};
|
|
file.write_str(toml::to_string(&lock)?.as_str())?;
|
|
|
|
Ok(Self {
|
|
path: file
|
|
.parent()
|
|
.expect("lockfile parent dir always exists")
|
|
.into(),
|
|
_lockfile: file,
|
|
})
|
|
}
|
|
|
|
pub fn path(&self) -> &std::path::Path {
|
|
&self.path
|
|
}
|
|
}
|