Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use portable-atomic to fix build on some 32-bit platforms #484

Merged
merged 2 commits into from Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/rust.yml
Expand Up @@ -12,6 +12,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, beta, 1.56]
features: [--all-features, ""]
target: [""]
exclude:
- os: ubuntu-latest
rust: beta
Expand Down Expand Up @@ -56,28 +57,48 @@ jobs:
- os: ubuntu-latest
rust: 1.56
features: --features improved_unicode
- os: ubuntu-latest
rust: stable
features: --all-features
target: --target armv5te-unknown-linux-gnueabi
use-cross: true

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v6
id: rust-target
with:
script: |
const target = '${{ matrix.target }}'
if (target) {
const rustTarget = target.slice('--target'.length).trim()
core.setOutput('rust-target', rustTarget)
} else {
core.setOutput('rust-target', '')
}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ steps.rust-target.outputs.rust-target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.use-cross }}
command: build
args: --workspace --all-targets
args: --workspace --all-targets ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.use-cross }}
command: test
args: --workspace
args: --workspace ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.use-cross }}
command: test
args: --workspace ${{ matrix.features }}
args: --workspace ${{ matrix.features }} ${{ matrix.target }}

lint:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -15,6 +15,7 @@ rust-version = "1.56"
[dependencies]
console = { version = "0.15", default-features = false, features = ["ansi-parsing"] }
number_prefix = "0.4"
portable-atomic = "0.3.15"
rayon = { version = "1.1", optional = true }
tokio = { version = "1", optional = true, features = ["fs", "io-util"] }
unicode-segmentation = { version = "1", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/progress_bar.rs
@@ -1,6 +1,6 @@
use std::borrow::Cow;
#[cfg(test)]
use std::sync::atomic::{AtomicBool, Ordering};
use portable_atomic::{AtomicBool, Ordering};
use std::borrow::Cow;
use std::sync::{Arc, Condvar, Mutex, MutexGuard, Weak};
use std::time::{Duration, Instant};
use std::{fmt, io, thread};
Expand Down
3 changes: 2 additions & 1 deletion src/state.rs
@@ -1,9 +1,10 @@
use std::borrow::Cow;
use std::sync::atomic::{AtomicU64, AtomicU8, Ordering};
use std::sync::Arc;
use std::time::{Duration, Instant};
use std::{fmt, io};

use portable_atomic::{AtomicU64, AtomicU8, Ordering};

use crate::draw_target::ProgressDrawTarget;
use crate::style::ProgressStyle;

Expand Down