fix: unused TextModelArch import when luxtts feature is disabled - #88
Open
SAGAR-TAMANG wants to merge 1 commit into
Open
fix: unused TextModelArch import when luxtts feature is disabled#88SAGAR-TAMANG wants to merge 1 commit into
SAGAR-TAMANG wants to merge 1 commit into
Conversation
`TextModelArch` is imported unconditionally in cake-cli/src/main.rs, but its
only use site is inside a `#[cfg(feature = "luxtts")]` block in `run_master`.
Building the CLI without that feature produces:
warning: unused import: `TextModelArch`
--> cake-cli/src/main.rs:10:45
Reproduce with:
cargo build --release -p cake-cli --no-default-features \
--features "master,llama,qwen2,qwen3"
This goes unnoticed because `luxtts` is in the default feature set, and the
Android CI job builds cake-core with reduced features but only ever builds
cake-mobile -- never cake-cli. It breaks the zero-warning clippy requirement
in CLAUDE.md for any reduced-feature build.
Fixed by dropping the import and fully qualifying the path at the use site,
matching the adjacent `cake_core::dispatch_text_model!` call. This keeps the
fix valid under every feature combination without adding a second `#[cfg]`
attribute that has to stay in sync with the first.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TextModelArchis imported unconditionally incake-cli/src/main.rs:10, but its only use site is inside a#[cfg(feature = "luxtts")]block inrun_master(cake-cli/src/main.rs:321). Building the CLI without that feature warns:Reproduce:
cargo build --release -p cake-cli --no-default-features \ --features "master,llama,qwen2,qwen3"This breaks the zero-warning clippy requirement in
CLAUDE.mdfor any reduced-feature build of the CLI.Why it went unnoticed
luxttsis in the default feature set, so the import is always used in a normal build. And no CI job buildscake-cliwith--no-default-features:clippyjob (ci.yml:294) lintscake-cliwith default features plusvulkan,rocmtest-androidjob builds with reduced features, but only targetscake-coreandcake-mobile— never the CLItest-iosFix
Drop the import and fully qualify the path at the use site, matching the adjacent
cake_core::dispatch_text_model!call:This stays valid under every feature combination and avoids adding a second
#[cfg]attribute that would have to be kept in sync with the one at the use site.Verification
Relying on the existing
clippyjob to confirm the default-feature build is unaffected, since removing an import is the direction that could regress. Not yet built locally with the full default feature set.Context
Found while building for Termux/Android on-device, where a reduced feature set is necessary to keep compile time and memory usage in range.
Happy to follow up with a CI step that covers this configuration so it can't regress:
🤖 Generated with Claude Code