Skip to content

Commit

Permalink
Merge pull request #335 from moka-rs/ci-no-fail-fast-for-cross/v0.11.x
Browse files Browse the repository at this point in the history
CI: Update Linux cross compile tests (v0.11.x)
  • Loading branch information
tatsuya6502 authored Oct 14, 2023
2 parents e153e6f + e34a354 commit 8aafbb1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 31 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/LinuxCrossCompileTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,43 @@ jobs:
linux-cross:
runs-on: ubuntu-latest
strategy:
# Continue running other jobs in the matrix even if one fails.
fail-fast: false
matrix:
platform:
- target: aarch64-unknown-linux-musl
rust-version: stable
- target: i686-unknown-linux-musl
rust-version: stable
- target: armv7-unknown-linux-musleabihf
rust-version: stable
# Platforms without AtomicU64 support.
- target: armv5te-unknown-linux-musleabi
cargo-opts: "--no-default-features" # Disable atomic64 and quanta features.
rust-version: stable
- target: mips-unknown-linux-musl
cargo-opts: "--no-default-features" # Disable atomic64 and quanta features.
rust-version: "1.72.1"
cargo-version: "+1.72.1"
- target: mipsel-unknown-linux-musl
cargo-opts: "--no-default-features" # Disable atomic64 and quanta features.
rust-version: "1.72.1"
cargo-version: "+1.72.1"

steps:
- name: Checkout Moka
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: stable
target: ${{ matrix.platform.target }}
override: true
toolchain: ${{ matrix.platform.rust-version }}
targets: ${{ matrix.platform.target }}

- name: Install cross
uses: taiki-e/install-action@v2
with:
tool: cross

- name: Remove integration tests and force enable rustc_version crate
run: |
Expand All @@ -54,25 +67,16 @@ jobs:
sed -i 's/build = "build.rs"/build = ".ci_extras\/build_linux_cross.rs"/' Cargo.toml
cat Cargo.toml
- uses: Swatinem/rust-cache@v1

- name: cargo clean
uses: actions-rs/cargo@v1
with:
command: clean
- run: cargo clean

- name: Run tests (sync feature)
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --release --features sync --target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }}
run: |
cross ${{ matrix.platform.carge-version }} test --release -F sync \
--target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }}
env:
RUSTFLAGS: '--cfg rustver'

- name: Run tests (future feature)
uses: actions-rs/cargo@v1
with:
use-cross: true
command: test
args: --release --features future --target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }}
run: |
cross ${{ matrix.platform.cargo-version }} test --release -F future \
--target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }}
16 changes: 12 additions & 4 deletions src/cht/map/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ impl<'g, K: 'g + Eq, V: 'g> BucketArray<K, V> {
mut eq: impl FnMut(&K) -> bool,
) -> Result<Shared<'g, Bucket<K, V>>, RelocatedError> {
for bucket in self.probe(guard, hash) {
let Ok((_, _, this_bucket_ptr)) = bucket else { return Err(RelocatedError); };
let Ok((_, _, this_bucket_ptr)) = bucket else {
return Err(RelocatedError);
};

let this_bucket_ref = if let Some(r) = unsafe { this_bucket_ptr.as_ref() } {
r
Expand Down Expand Up @@ -121,7 +123,9 @@ impl<'g, K: 'g + Eq, V: 'g> BucketArray<K, V> {
{
let mut probe = self.probe(guard, hash);
while let Some(bucket) = probe.next() {
let Ok((_, this_bucket, this_bucket_ptr)) = bucket else { return Err(condition); };
let Ok((_, this_bucket, this_bucket_ptr)) = bucket else {
return Err(condition);
};

let this_bucket_ref = if let Some(r) = unsafe { this_bucket_ptr.as_ref() } {
r
Expand Down Expand Up @@ -233,7 +237,9 @@ impl<'g, K: 'g + Eq, V: 'g> BucketArray<K, V> {
{
let mut probe = self.probe(guard, hash);
while let Some(bucket) = probe.next() {
let Ok((_, this_bucket, this_bucket_ptr)) = bucket else { return Err((state, modifier)); };
let Ok((_, this_bucket, this_bucket_ptr)) = bucket else {
return Err((state, modifier));
};

let (new_bucket, maybe_insert_value) =
if let Some(this_bucket_ref) = unsafe { this_bucket_ptr.as_ref() } {
Expand Down Expand Up @@ -294,7 +300,9 @@ impl<'g, K: 'g + Eq, V: 'g> BucketArray<K, V> {

let mut probe = self.probe(guard, hash);
while let Some(bucket) = probe.next() {
let Ok((i, this_bucket, this_bucket_ptr)) = bucket else { return None; };
let Ok((i, this_bucket, this_bucket_ptr)) = bucket else {
return None;
};

if let Some(Bucket { key: this_key, .. }) = unsafe { this_bucket_ptr.as_ref() } {
if this_bucket_ptr == bucket_ptr {
Expand Down
1 change: 1 addition & 0 deletions src/common/concurrent/entry_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ mod test {

use TargetArch::*;

#[allow(clippy::option_env_unwrap)]
// e.g. "1.64"
let ver = option_env!("RUSTC_SEMVER").expect("RUSTC_SEMVER env var not set");
let is_quanta_enabled = cfg!(feature = "quanta");
Expand Down
5 changes: 1 addition & 4 deletions src/notification/notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,9 @@ impl<K, V> ThreadPoolRemovalNotifier<K, V> {
is_shutting_down: Default::default(),
};

#[cfg_attr(beta_clippy, allow(clippy::arc_with_non_send_sync))]
let state = Arc::new(state);

Self {
snd,
state,
state: Arc::new(state),
thread_pool,
}
}
Expand Down
1 change: 0 additions & 1 deletion src/sync_base/invalidator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ impl<K, V, S> Invalidator<K, V, S> {
Self {
predicates: RwLock::new(HashMap::new()),
is_empty: AtomicBool::new(true),
#[cfg_attr(beta_clippy, allow(clippy::arc_with_non_send_sync))]
scan_context: Arc::new(ScanContext::new(cache)),
thread_pool,
}
Expand Down

0 comments on commit 8aafbb1

Please sign in to comment.