feat(build): gate gpu/media modules behind Cargo features #1

Merged
vsidot merged 1 commit from feat/module-feature-flags into master 2026-06-27 23:51:35 +02:00
Owner

The nvidia feature was nominal — nvml-wrapper was optional but
gpu.rs imported it unconditionally, so --no-default-features failed
to compile and alfred could not be built on non-NVIDIA machines.

Make the feature real and add a parallel media feature:

  • nvidia gates modules::gpu + nvml-wrapper (libnvidia-ml.so)
  • media gates modules::media + zbus (D-Bus/MPRIS)

Both default-on, so the default build/behavior is unchanged. The
ModuleKind enum stays ungated (dependency-free); a compiled-out module
simply never spawns. Modules without an optional dep remain always
compiled and toggleable at runtime via [modules.*] enabled = false.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

The `nvidia` feature was nominal — `nvml-wrapper` was optional but `gpu.rs` imported it unconditionally, so `--no-default-features` failed to compile and alfred could not be built on non-NVIDIA machines. Make the feature real and add a parallel `media` feature: - `nvidia` gates `modules::gpu` + nvml-wrapper (libnvidia-ml.so) - `media` gates `modules::media` + zbus (D-Bus/MPRIS) Both default-on, so the default build/behavior is unchanged. The ModuleKind enum stays ungated (dependency-free); a compiled-out module simply never spawns. Modules without an optional dep remain always compiled and toggleable at runtime via `[modules.*] enabled = false`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The `nvidia` feature was nominal — `nvml-wrapper` was optional but
`gpu.rs` imported it unconditionally, so `--no-default-features` failed
to compile and alfred could not be built on non-NVIDIA machines.

Make the feature real and add a parallel `media` feature:
- `nvidia` gates `modules::gpu` + nvml-wrapper (libnvidia-ml.so)
- `media`  gates `modules::media` + zbus (D-Bus/MPRIS)

Both default-on, so the default build/behavior is unchanged. The
ModuleKind enum stays ungated (dependency-free); a compiled-out module
simply never spawns. Modules without an optional dep remain always
compiled and toggleable at runtime via `[modules.*] enabled = false`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vsidot merged commit 6f049c68f1 into master 2026-06-27 23:51:35 +02:00
vsidot deleted branch feat/module-feature-flags 2026-06-27 23:51:35 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
vsidot/alfred!1
No description provided.