Skip to content

Commit 3e644ff

Browse files
committed
fix: separate MSRV per platform in CI and README
1 parent 8ab150b commit 3e644ff

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

.github/workflows/platforms.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ on:
2424

2525
env:
2626
# MSRV varies by backend due to platform-specific dependencies
27-
MSRV_DEFAULT: "1.70" # Linux (ALSA), macOS (CoreAudio), Android (AAudio), iOS, JACK
28-
MSRV_WINDOWS: "1.82" # Windows (WASAPI/ASIO) - due to windows crate
29-
MSRV_WASIP1: "1.78" # wasm32-wasip1 target stabilized in 1.78
27+
MSRV_DEFAULT: "1.70"
28+
MSRV_ALSA: "1.77"
29+
MSRV_WINDOWS: "1.82"
30+
MSRV_WASIP1: "1.78"
31+
MSRV_WASM: "1.71"
3032

3133
jobs:
3234
# Linux x86_64
@@ -40,10 +42,10 @@ jobs:
4042
with:
4143
packages: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev
4244

43-
- name: Install Rust MSRV (${{ env.MSRV_DEFAULT }})
45+
- name: Install Rust MSRV (${{ env.MSRV_ALSA }})
4446
uses: dtolnay/rust-toolchain@master
4547
with:
46-
toolchain: ${{ env.MSRV_DEFAULT }}
48+
toolchain: ${{ env.MSRV_ALSA }}
4749

4850
- name: Rust Cache
4951
uses: Swatinem/rust-cache@v2
@@ -65,10 +67,10 @@ jobs:
6567
with:
6668
packages: libasound2-dev libjack-jackd2-dev libjack-jackd2-0 libdbus-1-dev
6769

68-
- name: Install Rust MSRV (${{ env.MSRV_DEFAULT }})
70+
- name: Install Rust MSRV (${{ env.MSRV_ALSA }})
6971
uses: dtolnay/rust-toolchain@master
7072
with:
71-
toolchain: ${{ env.MSRV_DEFAULT }}
73+
toolchain: ${{ env.MSRV_ALSA }}
7274

7375
- name: Rust Cache
7476
uses: Swatinem/rust-cache@v2
@@ -85,10 +87,10 @@ jobs:
8587
steps:
8688
- uses: actions/checkout@v5
8789

88-
- name: Install Rust MSRV (${{ env.MSRV_DEFAULT }})
90+
- name: Install Rust MSRV (${{ env.MSRV_ALSA }})
8991
uses: dtolnay/rust-toolchain@master
9092
with:
91-
toolchain: ${{ env.MSRV_DEFAULT }}
93+
toolchain: ${{ env.MSRV_ALSA }}
9294
targets: armv7-unknown-linux-gnueabihf
9395

9496
- name: Rust Cache
@@ -213,9 +215,10 @@ jobs:
213215
steps:
214216
- uses: actions/checkout@v5
215217

216-
- name: Install Rust toolchain (Android targets)
217-
uses: dtolnay/rust-toolchain@stable
218+
- name: Install Rust MSRV (${{ env.MSRV_DEFAULT }})
219+
uses: dtolnay/rust-toolchain@master
218220
with:
221+
toolchain: ${{ env.MSRV_DEFAULT }}
219222
targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android
220223

221224
- name: Rust Cache
@@ -253,9 +256,10 @@ jobs:
253256
- name: Install dependencies
254257
run: brew install llvm
255258

256-
- name: Install Rust toolchain (iOS targets)
257-
uses: dtolnay/rust-toolchain@stable
259+
- name: Install Rust MSRV (${{ env.MSRV_DEFAULT }})
260+
uses: dtolnay/rust-toolchain@master
258261
with:
262+
toolchain: ${{ env.MSRV_DEFAULT }}
259263
targets: aarch64-apple-ios,x86_64-apple-ios
260264

261265
- name: Rust Cache
@@ -299,11 +303,11 @@ jobs:
299303
if: matrix.setup-emscripten
300304
uses: mymindstorm/setup-emsdk@v14
301305

302-
- name: Install Rust MSRV (${{ env.MSRV_DEFAULT }})
306+
- name: Install Rust MSRV (${{ env.MSRV_WASM }})
303307
if: ${{ !matrix.build-worklet-beep }}
304308
uses: dtolnay/rust-toolchain@master
305309
with:
306-
toolchain: ${{ env.MSRV_DEFAULT }}
310+
toolchain: ${{ env.MSRV_WASM }}
307311
targets: ${{ matrix.target }}
308312

309313
- name: Install Rust toolchain (nightly for build-std)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Low-level library for audio input and output in pure Rust.
99

1010
**cpal** maintains a conservative MSRV policy for maximum backwards compatibility. However, the actual minimum Rust version required depends on which audio backend and features you're using, as each platform has different dependencies:
1111

12-
- **Core library + ALSA, CoreAudio, AAudio (Android), JACK, Emscripten:** Rust **1.70**
12+
- **Core library + CoreAudio, AAudio (Android), JACK:** Rust **1.70**
13+
- **ALSA** (Linux/BSD):** Rust **1.77** (due to `alsa-sys` crate requirements)
1314
- **WASAPI/ASIO (Windows):** Rust **1.82** (due to `windows` crate requirements)
15+
- **WASM (`wasm-unknown`):** Rust **1.71** (due to `wasm-bindgen` crate requirements)
1416
- **WASM (`wasm32-wasip1`):** Rust **1.78** (target stabilized in 1.78)
1517
- **WASM (`audioworklet`):** Rust **nightly** (requires `-Zbuild-std` for atomics support)
1618

17-
If you're only using `cpal` on Linux, macOS, Emscripten, or mobile platforms, Rust 1.70 is sufficient. Windows and other WASM users will need the higher versions listed above.
18-
1919
## Supported Platforms
2020

2121
This library currently supports the following:

0 commit comments

Comments
 (0)