Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup output if version mismatch. #4

Merged
merged 1 commit into from
Apr 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::env;
use std::process::Command;
use std::process::{self, Command};

const VERSION: &'static str = env!("CARGO_PKG_VERSION");

Expand All @@ -21,9 +21,11 @@ fn main() {

// check that "cargo hfuzz" command is at the same version as this file
let honggfuzz_build_version = env::var("CARGO_HONGGFUZZ_BUILD_VERSION").unwrap_or("unknown".to_string());
assert!(VERSION == honggfuzz_build_version,
"hongfuzz dependency ({}) and build command ({}) versions do not match",
VERSION, honggfuzz_build_version);
if VERSION != honggfuzz_build_version {
eprintln!("hongfuzz dependency ({}) and build command ({}) versions do not match",
VERSION, honggfuzz_build_version);
process::exit(1);
}

let out_dir = env::var("OUT_DIR").unwrap(); // from cargo
let crate_root = env::var("CRATE_ROOT").unwrap(); //from honggfuzz
Expand Down