219 files, 2.0 MB, untracked in souveraine/docs and existing nowhere else. The volume is at 100% with no snapshots.
1.6 KiB
1.6 KiB
| scope | status | created |
|---|---|---|
| build | proposed | 2026-05-18 |
Feature-gate voice/audio dependencies
Problem
cargo build fails on a fresh Linux install because cpal pulls in alsa-sys,
which requires alsa-lib-devel (or equivalent) to be installed. First-time
users hit a cryptic pkg-config error about missing ALSA.
Solution
- Feature-gate
cpalandrodiobehind an optionalvoicefeature inCargo.toml. Default: off. #[cfg(feature = "voice")]thesrc/core/voice/module so the module and its imports don't compile when the feature is off.- Graceful fallback — if the user runs
souveraine tuiwithout voice, the setup wizard or TUI should show "Voice disabled (compile with--features voice)" instead of crashing. - Build-time hint — if
cpalfails to build (pkg-config error), the error should suggestdnf install alsa-lib-devel(Fedora) orapt install libasound2-dev(Debian) rather than panicking with the raw pkg-config output. This might need a build.rs or a note in a README instead, since build-script panics come from upstream crates.
Files to touch
Cargo.toml— makecpal,rodiooptional; addvoicefeaturesrc/core/voice/mod.rs—#[cfg(feature = "voice")]src/core/mod.rs— gate thepub mod voicedeclarationsrc/core/config.rs—VoiceConfigbehind feature gate or default stubsrc/ui/— any voice UI that imports voice types
Non-goals
- Don't remove or rework the voice subsystem. Just make it opt-in at build time.
- Don't split ALSA detection into a build.rs for upstream crates. That's
cpal/alsa-sys's job.