From c6fb545121fdd793d3460048627c02e12f897ce7 Mon Sep 17 00:00:00 2001 From: Elliott Linder Date: Wed, 6 Mar 2024 11:12:51 +0100 Subject: [PATCH] chore: update build for openbsd/mips/android --- .github/workflows/ci.yml | 12 +++++++----- src/query.rs | 20 +++++++++++--------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b068894..f37d48a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,9 +28,11 @@ jobs: os: ubuntu-20.04 use-cross: true - target: aarch64-linux-android + toolchain: '1.52.0' # See: https://github.com/rust-lang/rust/issues/110786 os: ubuntu-20.04 use-cross: true - target: mips-unknown-linux-gnu + toolchain: '1.52.0' # See: https://github.com/rust-lang/compiler-team/issues/648 os: ubuntu-20.04 use-cross: true @@ -56,7 +58,7 @@ jobs: - name: Install toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ matrix.toolchain || 'stable' }} profile: minimal target: ${{ matrix.target }} override: true @@ -85,8 +87,8 @@ jobs: md5: 01ad7883c69476d90872eb38180085c0 args: -net nic,model=virtio - target: x86_64-unknown-openbsd - image: https://www.dropbox.com/s/p4buykmmjd8hjgx/openbsd69.qcow2.xz?dl=1 - md5: 37ff51c30e360429550debf87a39d801 + image: https://gitlab.com/kit-ty-kate/qemu-base-images/-/raw/master/OpenBSD-7.4-amd64.qcow2?inline=false + md5: 1b7f3867c72f1dac3901b4a08257f580 args: -net nic fail-fast: false @@ -125,7 +127,7 @@ jobs: ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa cat > ~/.ssh/config <(), usize::max_value() as *const ()); @@ -172,7 +178,8 @@ mod tests { #[test] fn query_returns_correct_descriptor_for_text_segment() -> Result<()> { let region = query(query_returns_correct_descriptor_for_text_segment as *const ())?; - assert_eq!(region.protection(), Protection::READ_EXECUTE); + + assert_eq!(region.protection(), TEXT_SEGMENT_PROT); assert_eq!(region.is_shared(), cfg!(windows)); assert!(!region.is_guarded()); Ok(()) @@ -251,16 +258,11 @@ mod tests { fn query_range_can_iterate_over_entire_process() -> Result<()> { let regions = query_range(std::ptr::null::<()>(), usize::max_value())?.collect::>>()?; - let (r, rw, rx) = ( - Protection::READ, - Protection::READ_WRITE, - Protection::READ_EXECUTE, - ); // This test is a bit rough around the edges - assert!(regions.iter().any(|region| region.protection() == r)); - assert!(regions.iter().any(|region| region.protection() == rw)); - assert!(regions.iter().any(|region| region.protection() == rx)); + assert!(regions.iter().any(|region| region.protection() == Protection::READ)); + assert!(regions.iter().any(|region| region.protection() == Protection::READ_WRITE)); + assert!(regions.iter().any(|region| region.protection() == TEXT_SEGMENT_PROT)); assert!(regions.len() > 5); Ok(()) }