Skip to content

fix(transcription): compile the GGUF session owner on Linux - #93

Open
burak-s wants to merge 1 commit into
anomalyco:mainfrom
burak-s:fix/linux-gguf-session-owner
Open

burak-s wants to merge 1 commit into
anomalyco:mainfrom
burak-s:fix/linux-gguf-session-owner

Conversation

@burak-s

@burak-s burak-s commented Sep 19, 2026

Copy link
Copy Markdown

Summary

main does not compile for the Linux target. Check Linux on 61d401a fails in both jobs at the same error:

  • test: cargo test --locked --bin voice-control
  • nix: nix build .#checks.x86_64-linux.package, at Compiling voice-control v2.1.19
error[E0432]: unresolved import `crate::transcription`
   --> src/linux_transcriber.rs:8:12
    |
  8 | use crate::transcription::OfflineGgufSession;
    |            ^^^^^^^^^^^^^ could not find `transcription` in the crate root
    |
note: found an item that was configured out
   --> src/main.rs:123:5
    |
122 | #[cfg(target_os = "macos")]
    |       ------------------- the item is gated behind the `macos` feature
123 | mod transcription;

The previous main push, 983c71c (run 35392493576), fails the same way.

Reproduction: git checkout 61d401a && cargo check.

Cause

2324ee4 moved OfflineGgufSession into src/transcription.rs and pointed the Linux-only src/linux_transcriber.rs at it, but src/transcription.rs is #[cfg(target_os = "macos")] and cannot simply be ungated: it depends on the macOS-only apple_speech and parakeet modules.

The move itself was right. Before 2324ee4, Linux held a raw transcribe_cpp::Session and never had the bounded-scratch session handling. This keeps one shared owner and only moves it to where both platforms compile it.

Change

  • add src/offline_gguf.rs: the OfflineGgufSession owner moved verbatim, gated for macOS and Linux;
  • src/linux_transcriber.rs and src/parakeet.rs import it from the new module;
  • src/transcription.rs drops its now-duplicate definition.

macOS behavior is unchanged: a move plus two import lines. .github/workflows has no macOS job, so that half relies on the release build as before.

Placement note: src/transcription.rs is the natural home but is macOS-only, and src/transcription_models.rs owns the catalog and installation rather than inference. Happy to relocate it if you prefer another module.

No map or doc changes: no user-facing behavior, entry point, default, prerequisite, or recovery path changes.

Verification

x86_64 Fedora 44, local, non-root:

cargo fmt --all --check                                            # pass
cargo build                                                        # pass
cargo test --locked --bin voice-control                            # 145 passed; 0 failed; 7 ignored
cargo clippy --locked --bin voice-control --tests -- -D warnings    # pass
cargo clippy --locked --all-targets --all-features -- -D warnings   # pass
git diff --check                                                   # pass

The 7 ignored tests are the Xvfb-gated X11 grab tests (linux_input::tests), which need the workflow's isolated display. Wayland paste, virtual-microphone dictation, service IPC, and installer checks are left to CI.

The Check Linux run for this PR is action_required pending maintainer approval (run 35442068703), so the results above are from a local run rather than CI on the branch.

2324ee4 moved `OfflineGgufSession` into `src/transcription.rs`, which is
`#[cfg(target_os = "macos")]`, while the Linux-only
`src/linux_transcriber.rs` imports it, so `main` does not compile for the
Linux target:

    error[E0432]: unresolved import `crate::transcription`
     --> src/linux_transcriber.rs:8:12

`transcription.rs` cannot be ungated because it depends on the macOS-only
`apple_speech` and `parakeet` modules, so the session owner moves to a
platform-neutral module that both adapters import.

macOS behavior is unchanged. Linux keeps the shared session owner from
2324ee4 instead of the raw `transcribe_cpp::Session` it held before that
commit.

Verified on x86_64 Linux: `cargo test --locked --bin voice-control` (145
passed), `cargo clippy --locked --bin voice-control --tests -- -D warnings`,
`cargo fmt --all --check`.
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.

1 participant