From 57590447c7eb3c7046d6473b14b761a72b19c2ef Mon Sep 17 00:00:00 2001 From: mio Date: Thu, 15 May 2025 21:01:18 +0800 Subject: [PATCH 1/3] Add android CI --- .github/workflows/build_and_test.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 53389b5e2bc..9d023be8d2d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -112,6 +112,27 @@ jobs: # --- miri undefined behavior test -- - name: Run miri tests run: RUST_BACKTRACE=1 MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test + + ubuntu-ndk-x86_64: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/ubuntu-prepare + - uses: Swatinem/rust-cache@v2 + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r26d + add-to-path: false + - name: cargo-ndk + run: cargo install cargo-ndk + - name: cargo android targets + run: | + rustup target add x86_64-linux-android + - name: Build Android + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + run: cargo ndk -t x86_64 build ubuntu: runs-on: ubuntu-24.04 From 9bf7b068856248fc271ed8fbcbf06d7463374f30 Mon Sep 17 00:00:00 2001 From: mio Date: Thu, 15 May 2025 21:11:48 +0800 Subject: [PATCH 2/3] update --- .github/workflows/build_and_test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 9d023be8d2d..288efa91b0f 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -122,7 +122,7 @@ jobs: - uses: nttld/setup-ndk@v1 id: setup-ndk with: - ndk-version: r26d + ndk-version: r27c add-to-path: false - name: cargo-ndk run: cargo install cargo-ndk @@ -132,6 +132,7 @@ jobs: - name: Build Android env: ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} run: cargo ndk -t x86_64 build ubuntu: From a3753aa404ea3748d710d67a267df1458c2d4d4f Mon Sep 17 00:00:00 2001 From: mio Date: Fri, 16 May 2025 15:06:04 +0800 Subject: [PATCH 3/3] Move together --- .github/workflows/build_and_test.yml | 45 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 288efa91b0f..5168a93ed35 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -112,28 +112,6 @@ jobs: # --- miri undefined behavior test -- - name: Run miri tests run: RUST_BACKTRACE=1 MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test - - ubuntu-ndk-x86_64: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - uses: ./.github/workflows/ubuntu-prepare - - uses: Swatinem/rust-cache@v2 - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r27c - add-to-path: false - - name: cargo-ndk - run: cargo install cargo-ndk - - name: cargo android targets - run: | - rustup target add x86_64-linux-android - - name: Build Android - env: - ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} - ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} - run: cargo ndk -t x86_64 build ubuntu: runs-on: ubuntu-24.04 @@ -658,7 +636,7 @@ jobs: - name: Clippy run: cargo +nightly clippy --tests --all --exclude libafl_nyx --exclude symcc_runtime --exclude runtime_test - android: + ubuntu-cross-android-arm64: runs-on: ubuntu-24.04 steps: - uses: dtolnay/rust-toolchain@stable @@ -674,6 +652,27 @@ jobs: - name: Build Android run: cd libafl && PYO3_CROSS_PYTHON_VERSION=$(python3 -c "print('{}.{}'.format(__import__('sys').version_info.major, __import__('sys').version_info.minor))") cargo ndk -t arm64-v8a build --release + ubuntu-cross-android-x86_64: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/workflows/ubuntu-prepare + - uses: Swatinem/rust-cache@v2 + - uses: nttld/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r27c + add-to-path: false + - name: cargo-ndk + run: cargo install cargo-ndk + - name: cargo android targets + run: | + rustup target add x86_64-linux-android + - name: Build Android + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} + run: cargo ndk -t x86_64 build #run: cargo build --target aarch64-linux-android # TODO: Figure out how to properly build stuff with clang #- name: Add clang path to $PATH env