Use nightly for miri (#3268)

* miri nightly

* actually add miri

* ??

* clp cache new
This commit is contained in:
Dongjia "toka" Zhang 2025-05-23 19:22:15 +02:00 committed by GitHub
parent 9611c59a6c
commit 7b9be937f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 11 deletions

View File

@ -104,11 +104,15 @@ jobs:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
if: contains( github.event.pull_request.labels.*.name, 'pre-release') if: contains( github.event.pull_request.labels.*.name, 'pre-release')
steps: steps:
- name: Add miri
run: rustup toolchain install --component miri --allow-downgrade
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: ./.github/workflows/ubuntu-prepare - uses: ./.github/workflows/ubuntu-prepare
with:
use_nightly: 'true'
- name: Add miri
run: rustup +nightly component add miri
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with:
shared-key: ubuntu-miri
# --- miri undefined behavior test -- # --- miri undefined behavior test --
- name: Run miri tests - name: Run miri tests
run: RUST_BACKTRACE=1 MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test run: RUST_BACKTRACE=1 MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test
@ -145,7 +149,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: ./.github/workflows/ubuntu-prepare - uses: ./.github/workflows/ubuntu-prepare
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with: { shared-key: "ubuntu" } with:
shared-key: "ubuntu-clippy"
- name: Run clippy - name: Run clippy
run: LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} ./scripts/clippy.sh run: LLVM_CONFIG=llvm-config-${{env.MAIN_LLVM_VERSION}} ./scripts/clippy.sh
# --- test embedding the libafl_libfuzzer_runtime library # --- test embedding the libafl_libfuzzer_runtime library

View File

@ -1,25 +1,51 @@
name: Setup Rust Environment name: Setup Rust Environment
description: Sets up the Rust environment for the CI workflow description: Sets up the Rust environment for the CI workflow and optionally installs nightly
# ---------- new section ----------
inputs:
use_nightly:
description: "If true, install the Rust nightly toolchain instead of stable"
required: false
default: "false"
# ---------------------------------
runs: runs:
using: composite using: composite
steps: steps:
- name: Uninstall all currently installed rust - name: Uninstall all currently installed Rust
shell: bash shell: bash
run: | run: |
sudo apt purge -y 'cargo*' 'rust*' sudo apt purge -y 'cargo*' 'rust*'
- name: Install and cache deps - name: Install and cache deps
shell: bash shell: bash
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y curl lsb-release wget software-properties-common gnupg shellcheck pax-utils libsqlite3-dev libpixman-1-dev libc6-dev gcc g++ build-essential libglib2.0-dev sudo apt-get install -y \
- uses: dtolnay/rust-toolchain@stable curl lsb-release wget software-properties-common gnupg shellcheck pax-utils \
libsqlite3-dev libpixman-1-dev libc6-dev gcc g++ build-essential libglib2.0-dev
# ---------- toolchain selection ----------
- name: Install Rust (stable)
if: ${{ inputs.use_nightly == 'false' }}
uses: dtolnay/rust-toolchain@stable
with: with:
components: clippy, rustfmt components: clippy, rustfmt
- name: install just
- name: Install Rust (nightly)
if: ${{ inputs.use_nightly == 'true' }}
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
# -----------------------------------------
- name: Install just
uses: extractions/setup-just@v2 uses: extractions/setup-just@v2
with: with:
just-version: '1.40.0' just-version: '1.40.0'
- uses: taiki-e/install-action@cargo-hack - uses: taiki-e/install-action@cargo-hack
- name: Install LLVM - name: Install LLVM
shell: bash shell: bash
run: | run: |
@ -27,6 +53,7 @@ runs:
chmod +x llvm.sh chmod +x llvm.sh
sudo ./llvm.sh ${{ env.MAIN_LLVM_VERSION }} all sudo ./llvm.sh ${{ env.MAIN_LLVM_VERSION }} all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ env.MAIN_LLVM_VERSION }} 200 sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ env.MAIN_LLVM_VERSION }} 200
- name: Symlink Headers
- name: Symlink headers
shell: bash shell: bash
run: sudo ln -s /usr/include/asm-generic /usr/include/asm run: sudo ln -s /usr/include/asm-generic /usr/include/asm