Skip to content

Fix/all targets - #1382

Open
ErwanLegrand wants to merge 4 commits into
RustAudio:masterfrom
ErwanLegrand:fix/all-targets
Open

ErwanLegrand wants to merge 4 commits into
RustAudio:masterfrom
ErwanLegrand:fix/all-targets

Conversation

@ErwanLegrand

Copy link
Copy Markdown
Contributor

Fix CI so that clippy runs with all features enabled and with just the default set. Also, add --all-targets.

Some issues were found while running this. This PR also fixes these.

Fixes #1375

WASAPI does not use the helper, so gating it on `target_os = "windows"` alone left it compiled but unused on Windows without ASIO or JACK, tripping `dead_code` under `-D warnings`. CI only ran `--all-features`, where ASIO consumes it, so this stayed hidden.

Mirror the consuming backends' own module gates.
The module has not compiled since the 0.19 API changes: it was missing the `CallbackInfo` and trait imports, still constructed `SampleRate` as a tuple struct, and passed `&StreamConfig` where the config is now taken by value. CI never compiled it because clippy did not run `--all-targets`.

Unverified on a device: iOS has no CI runner, so this is a compile fix only.
@ErwanLegrand

Copy link
Copy Markdown
Contributor Author

Let me fix those conflicts...

@ErwanLegrand

Copy link
Copy Markdown
Contributor Author

What do you think about checking both the default feature set and all features? This adds three additional jobs, but it catches issues which aren't caught otherwise.

The sender was only ever reassigned: the value captured by the listener thread is never read, so `unused_assignments` fires on stable 1.94.1 and the macOS clippy rows fail under `-D warnings`. The leading underscore silences `unused_variables`, not `unused_assignments`.

Take the sender out to shut the previous listener down, and swap the replacement in with `mem::replace`, dropping the displaced sender.
The clippy job denied warnings but ran only `--all-features` without `--all-targets`, so lints in test and example bodies went unchecked and regressions that appear only under the default feature set slipped through. Lint `--all-targets`, add default-feature rows for each host platform, and use `--workspace` instead of the deprecated `--all` alias.

- Only rows that build ASIO need the SDK, so the setup step is gated on `--all-features` rather than on any non-empty feature list.

Closes RustAudio#1375
@roderickvd

Copy link
Copy Markdown
Member

What do you think about checking both the default feature set and all features? This adds three additional jobs, but it catches issues which aren't caught otherwise.

Yes, that's what we should normally do, ensuring we don't do anything double when we don't mean to.
Weren't we already doing that, where it made sense, and CI system libraries allow us?

@ErwanLegrand

ErwanLegrand commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

As I remember, CI was running clippy only with all features enabled, never with the default set

I noticed that when working on a branch to add support for WASAPI exclusive mode, a while back. (I need this for realtime effects processing.)

CI was green, but just running cargo clippy returned a dead code error.

Possibly, this is the only class of bugs CI misses by not running clippy with the default feature set?

@roderickvd

Copy link
Copy Markdown
Member

I agree clippy should be OK for both default features and all features.

@ErwanLegrand

Copy link
Copy Markdown
Contributor Author

OK. This PR is an attempt at checking exactly this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hole in CI checks?

2 participants