fix(A.2 #13): propagate whisper feature from kon crate through to kon-transcription
Review feedback: src-tauri/src/commands/models.rs was still naming load_whisper unconditionally, so a --no-default-features workspace build (kon-transcription without the whisper feature) would have compiled the transcription crate cleanly but failed in the kon crate as soon as it tried to resolve the load_whisper symbol. Adds a matching [features] section to src-tauri/Cargo.toml: - default = ["whisper"] - whisper = ["kon-transcription/whisper"] and declares the kon-transcription dep with default-features = false so the feature actually propagates rather than being forced-on by the child crate's default. Cfg-gates the load_whisper import in models.rs and adds a companion match arm that returns a runtime error when the feature is off, keeping the API shape intact. Verified with both cargo build -p kon and cargo build -p kon --no-default-features.
This commit is contained in:
@@ -9,6 +9,15 @@ edition = "2021"
|
||||
name = "kon_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[features]
|
||||
# Default build includes the Whisper backend. Disabling this feature
|
||||
# also drops it from kon-transcription (see Cargo.toml in that crate)
|
||||
# so a --no-default-features workspace build does not pull whisper-rs-sys.
|
||||
# load_model_from_disk returns a runtime error for Engine::Whisper when
|
||||
# this feature is off; Parakeet continues to work.
|
||||
default = ["whisper"]
|
||||
whisper = ["kon-transcription/whisper"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
# Used by the CSP regression guard in build.rs to parse tauri.conf.json
|
||||
@@ -21,7 +30,7 @@ serde_json = "1"
|
||||
# Workspace crates
|
||||
kon-core = { path = "../crates/core" }
|
||||
kon-audio = { path = "../crates/audio" }
|
||||
kon-transcription = { path = "../crates/transcription" }
|
||||
kon-transcription = { path = "../crates/transcription", default-features = false }
|
||||
kon-ai-formatting = { path = "../crates/ai-formatting" }
|
||||
kon-storage = { path = "../crates/storage" }
|
||||
kon-cloud-providers = { path = "../crates/cloud-providers" }
|
||||
|
||||
Reference in New Issue
Block a user