From 84a9e36acfeb44929eecef75ff2b743c086cef07 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Fri, 2 Jul 2021 20:51:22 +0200 Subject: [PATCH] Github Actions Cache (#205) * trying out github actions cache * split up build steps * deactivated cache for macos * debugging * also for windows (?)) * clippy fix * out folder ignored --- .github/workflows/build_and_test.yml | 54 +++++++++++++++++++++------- .gitignore | 1 + libafl/src/events/llmp.rs | 4 +-- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4428cd530e..fcb53dbdf6 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -17,13 +17,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: Cache cargo registry - uses: actions/cache@v2 + - uses: actions-rs/toolchain@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: clippy-cargo-${{ hashFiles('**/Cargo.toml') }} + profile: minimal + toolchain: stable - name: Add clippy run: rustup component add clippy #- name: Run clippy @@ -36,8 +33,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable - name: Install deps - run: sudo apt-get install -y llvm llvm-dev clang nasm + run: sudo apt-get install -y llvm llvm-dev clang - name: get clang version run: command -v llvm-config && clang -v - name: Install cargo-hack @@ -62,12 +63,26 @@ jobs: run: cargo test --all-features --doc - name: Run clippy run: ./scripts/clippy.sh - - name: Build fuzzers + ubuntu-fuzzers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Install deps + run: sudo apt-get install -y llvm llvm-dev clang nasm + - name: Build and run example fuzzers run: ./scripts/build_all_fuzzers.sh windows: runs-on: windows-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable - name: Windows Build run: cargo build --verbose - name: Run clippy @@ -78,18 +93,33 @@ jobs: runs-on: macOS-latest steps: - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable - name: MacOS Build run: cargo build --verbose - - name: Install deps - run: brew install llvm libpng nasm - name: Run clippy run: ./scripts/clippy.sh - - name: Build fuzzers - run: ./scripts/build_all_fuzzers.sh - name: Increase map sizes run: ./scripts/shmem_limits_macos.sh - name: Run Tests run: cargo test + macos-fuzzers: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Install deps + run: brew install llvm libpng nasm + + - name: Increase map sizes + run: ./scripts/shmem_limits_macos.sh + - name: Build and run example fuzzers + run: ./scripts/build_all_fuzzers.sh # TODO: Figure out how to properly build stuff with clang #- name: Add clang path to $PATH env # if: runner.os == 'Windows' diff --git a/.gitignore b/.gitignore index 533cef3cac..a6aa4df4cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ target +out Cargo.lock *.o diff --git a/libafl/src/events/llmp.rs b/libafl/src/events/llmp.rs index 0ad3a084a1..803f32ba85 100644 --- a/libafl/src/events/llmp.rs +++ b/libafl/src/events/llmp.rs @@ -382,14 +382,14 @@ where _sender_id, client_config, input ); - let res = if client_config == self.configuration { + let _res = if client_config == self.configuration { let observers: OT = postcard::from_bytes(&observers_buf)?; fuzzer.process_execution(state, self, input, &observers, &exit_kind, false)? } else { fuzzer.evaluate_input_with_observers(state, executor, self, input, false)? }; #[cfg(feature = "std")] - if let Some(item) = res.1 { + if let Some(item) = _res.1 { println!("Added received Testcase as item #{}", item); } Ok(())