Skip to content

fix: re-export __tauri_command_name_* alongside __cmd__ in summary mod.rs (Tauri 2.6 generate_handler! resolution)#485

Open
baral50 wants to merge 1 commit into
Zackriya-Solutions:mainfrom
baral50:fix/tauri-2.6-generate-handler-reexports
Open

fix: re-export __tauri_command_name_* alongside __cmd__ in summary mod.rs (Tauri 2.6 generate_handler! resolution)#485
baral50 wants to merge 1 commit into
Zackriya-Solutions:mainfrom
baral50:fix/tauri-2.6-generate-handler-reexports

Conversation

@baral50
Copy link
Copy Markdown

@baral50 baral50 commented May 30, 2026

Summary

  • Adds __tauri_command_name_<fn> to the existing pub use commands::{...} and pub use template_commands::{...} re-exports in src-tauri/src/summary/mod.rs + src-tauri/src/summary/summary_engine/mod.rs
  • 20 insertions / 3 deletions across 2 files; purely additive — no behaviour change
  • Fixes the 15× E0433 cannot find __tauri_command_name_<fn> in <module> build errors seen when running ./build-gpu.sh on a fresh clone of 91b0c09 (current main HEAD / v0.3.0 tag)

The bug

Tauri 2.6's #[tauri::command] proc-macro emits two sibling constants per command function:

  • __cmd__<fn_name> — legacy Tauri 1.x compat name (per tauri-macros-2.6.2/src/command/mod.rs:15)
  • __tauri_command_name_<fn_name> — what generate_handler! looks up in Tauri 2.x (per tauri-macros-2.6.2/src/command/handler.rs:166 and command/wrapper.rs:299)

The existing pub use commands::{__cmd__api_*, api_*, ...} re-exports in summary/mod.rs only re-export the legacy __cmd__* form. The __tauri_command_name_* constants stay private to the commands submodule.

src-tauri/src/lib.rs then calls tauri::generate_handler![summary::api_process_transcript, summary_engine::builtin_ai_list_models, ...], which expands to lookups like summary::__tauri_command_name_api_process_transcript — names that don't exist at that path because they were never re-exported.

Result: 15 compile errors on a fresh build, blocking everyone from building the project from current main.

Reproducer

git clone https://github.com/Zackriya-Solutions/meetily
cd meetily/frontend
pnpm install
./build-gpu.sh
# → 15× error[E0433]: cannot find `__tauri_command_name_<fn>` in `<module>`
# → error: could not compile `meetily` (lib) due to 15 previous errors

The fix

In summary/mod.rs and summary/summary_engine/mod.rs, extend the existing pub use commands::{...} and pub use template_commands::{...} lists to include the __tauri_command_name_<fn> variant of every re-exported Tauri command.

Diff is mechanical — for each __cmd__<fn> already re-exported, add __tauri_command_name_<fn> alongside it.

The functions themselves are still annotated #[tauri::command] and the proc-macro already emits both constants — this PR only widens the visibility of the new-form constants so generate_handler! (which expects them at the same path it uses for the function name) can resolve them.

Verification

After the fix, ./build-gpu.sh completes cleanly and produces:

  • target/release/meetily (77 MB ELF)
  • target/release/bundle/deb/meetily_0.3.0_amd64.deb
  • target/release/bundle/appimage/meetily_0.3.0_amd64.AppImage

Tested on:

  • rustc 1.95.0 / cargo 1.95.0
  • Ubuntu 24.04 LTS x86_64
  • tauri 2.6.2 + tauri-macros 2.6.2 (resolved from current Cargo.toml)

Test plan

  • Fresh clone + pnpm install + ./build-gpu.sh produces binary + bundles without errors
  • No behaviour change at runtime (re-exports are purely additive; same constants the proc-macro already emits)
  • Reviewer: confirm fix resolves the 15× E0433 build error on their machine

Notes

The legacy __cmd__* re-exports are kept in place for backward compatibility with any external consumers — this PR is additive, not a rename.

If a wholesale pub use commands::*; is preferred over the explicit name list, happy to revise. The explicit form was chosen to match the existing style of these mod.rs files.

…d.rs

Tauri 2.6's `#[tauri::command]` proc-macro generates TWO sibling
constants for each command: the legacy `__cmd__<fn_name>` (Tauri 1.x
compat) and the new `__tauri_command_name_<fn_name>`. The
`tauri::generate_handler![...]` macro in `src/lib.rs` looks up the
LATTER at the module path used in the handler list — e.g. for
`summary_engine::builtin_ai_list_models` it expects to find
`summary_engine::__tauri_command_name_builtin_ai_list_models`.

The existing re-exports in `summary/mod.rs` and
`summary/summary_engine/mod.rs` only re-export the `__cmd__*` form
and the function itself. The `__tauri_command_name_*` consts stay
private to the `commands` sub-module, so `generate_handler!`
resolution fails with 15 `cannot find __tauri_command_name_<fn> in
<module>` errors when building on a fresh clone of `91b0c09`.

Reproducer:

  git clone https://github.com/Zackriya-Solutions/meeting-minutes
  cd meeting-minutes/frontend
  pnpm install && ./build-gpu.sh
  # → 15× E0433 cannot find __tauri_command_name_<fn> in <mod>

Fix is mechanical: in both mod.rs files, extend the existing
`pub use commands::{...}` and `pub use template_commands::{...}` lists
to include the `__tauri_command_name_<fn>` variant of every re-exported
Tauri command. After the fix, `cargo tauri build` completes cleanly
and produces the meetily binary + .deb + .AppImage bundles.

Verified on:
  rustc 1.95.0
  cargo 1.95.0
  Ubuntu 24.04 LTS x86_64
  tauri 2.6.2 + tauri-macros 2.6.2

No behaviour change: the additional re-exports are the same constants
the proc-macro already emits at the use-site; this PR only widens
their visibility so the macro that already expected them can find them.
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