Skip to content

Commit

Permalink
Adjust build script output
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Apr 21, 2023
1 parent 536b349 commit 8c7dd10
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ concurrency:
group: rust-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,13 +41,13 @@ jobs:
- name: Rustup
run: rustup default ${{ matrix.toolchain }}
- name: Build
run: cargo build --verbose
run: cargo build -vv
- if: ${{ matrix.environment == 'macos-latest' }}
name: Run afl-system-config
run: sudo AFLPlusPlus/afl-system-config
- name: Build examples (with AFL instrumentation)
run: cargo run afl build --examples --verbose
run: cargo run afl build --examples -vv
- name: Run tests (with AFL instrumentation)
run: cargo run afl test --verbose
run: cargo run afl test -vv
env:
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: "1"
16 changes: 8 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ fn main() {
let work_dir = if installing || env::var("DOCS_RS").is_ok() {
let tempdir = tempfile::tempdir_in(&out_dir).unwrap();
if Path::new(AFL_SRC_PATH).join(".git").is_dir() {
let output = Command::new("git")
let status = Command::new("git")
.args(["clone", AFL_SRC_PATH, &*tempdir.path().to_string_lossy()])
.output()
.status()
.expect("could not run 'git'");
assert!(output.status.success(), "{output:#?}");
assert!(status.success());
} else {
fs_extra::dir::copy(
AFL_SRC_PATH,
Expand Down Expand Up @@ -68,8 +68,8 @@ fn build_afl(work_dir: &Path, base: Option<&Path>) {
if std::env::var("DEBUG").as_deref() == Ok("false") {
command.env_remove("DEBUG");
}
let output = command.output().expect("could not run 'make'");
assert!(output.status.success(), "{output:#?}");
let status = command.status().expect("could not run 'make'");
assert!(status.success());
}

fn build_afl_llvm_runtime(work_dir: &Path, base: Option<&Path>) {
Expand All @@ -79,11 +79,11 @@ fn build_afl_llvm_runtime(work_dir: &Path, base: Option<&Path>) {
)
.expect("Couldn't copy object file");

let output = Command::new(AR_CMD)
let status = Command::new(AR_CMD)
.arg("r")
.arg(common::archive_file_path(base))
.arg(common::object_file_path(base))
.output()
.status()
.expect("could not run 'ar'");
assert!(output.status.success(), "{output:#?}");
assert!(status.success());
}

0 comments on commit 8c7dd10

Please sign in to comment.