Pin spec interpreter to a specific revision (#3868)
This commit updates the build script which clones the spec interpreter for fuzzing to specifically pin at a hardcoded revision. This is intended at improving reproducibility if we hit any issues while fuzzing to ensure that the same wasmtime revision is always using the same spec interpreter revision.
This commit is contained in:
@@ -12,6 +12,7 @@ const OCAML_DIR: &'static str = "ocaml";
|
||||
const SPEC_DIR: &'static str = "ocaml/spec";
|
||||
const SPEC_REPOSITORY: &'static str = "https://github.com/conrad-watt/spec";
|
||||
const SPEC_REPOSITORY_BRANCH: &'static str = "wasmtime_fuzzing";
|
||||
const SPEC_REPOSITORY_REV: &'static str = "7485eb0084b74871f96f261b9f916864596d8f1d";
|
||||
|
||||
fn main() {
|
||||
if cfg!(feature = "build-libinterpret") {
|
||||
@@ -33,7 +34,7 @@ fn build() {
|
||||
} else {
|
||||
// Ensure the spec repository is present.
|
||||
if is_spec_repository_empty(SPEC_DIR) {
|
||||
retrieve_spec_repository(SPEC_REPOSITORY, SPEC_REPOSITORY_BRANCH, SPEC_DIR)
|
||||
retrieve_spec_repository(SPEC_DIR)
|
||||
}
|
||||
|
||||
// Build the library to link to.
|
||||
@@ -72,17 +73,23 @@ fn is_spec_repository_empty(destination: &str) -> bool {
|
||||
// Clone the spec repository into `destination`. This exists due to the large
|
||||
// size of the dependencies (e.g. KaTeX) that are pulled if this were cloned
|
||||
// recursively as a submodule.
|
||||
fn retrieve_spec_repository(repository: &str, branch: &str, destination: &str) {
|
||||
fn retrieve_spec_repository(destination: &str) {
|
||||
let status = Command::new("git")
|
||||
.arg("clone")
|
||||
.arg("--depth")
|
||||
.arg("1")
|
||||
.arg(repository)
|
||||
.arg(SPEC_REPOSITORY)
|
||||
.arg("-b")
|
||||
.arg(branch)
|
||||
.arg(SPEC_REPOSITORY_BRANCH)
|
||||
.arg(destination)
|
||||
.status()
|
||||
.expect("Failed to execute 'git' command to clone spec repository.");
|
||||
assert!(status.success(), "Failed to retrieve the spec repository.");
|
||||
|
||||
assert!(status.success(), "Failed to retrieve the spec repository.")
|
||||
let status = Command::new("git")
|
||||
.arg("reset")
|
||||
.arg("--hard")
|
||||
.arg(SPEC_REPOSITORY_REV)
|
||||
.current_dir(destination)
|
||||
.status()
|
||||
.expect("Failed to execute 'git' command to clone spec repository.");
|
||||
assert!(status.success(), "Failed to reset to revision.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user