Skip to content

Route the explicit Vulkan setup failures through the setup failure helpers - #7645

Merged
danielhanchen merged 1 commit into
mainfrom
fix-setup-tauri-error-surfacing
Jul 30, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-setup-tauri-error-surfacing

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

tests/sh/test_tauri_retry_failure_context.sh fails on current main:

FAIL: Unix setup has explicit exits outside setup_fail

studio/setup.sh carries 4 explicit exit statements and studio/setup.ps1 carries 4, where the guard allows exactly 1 each: the one inside setup_fail / Exit-SetupFailure. The three extra in each file are the explicit-Vulkan paths added by #7188.

Why it matters

#7529 added the [TAURI:ERROR] <message> channel so Studio desktop can surface an actionable reason when the installer fails. setup_fail and Exit-SetupFailure are the only places that emit it. A bare exit 1 bypasses them, so a user who explicitly requests Vulkan and hits one of these three conditions gets a failed install in Studio desktop with no context attached, which is the exact failure mode #7529 set out to remove.

Why nobody noticed

Backend CI runs Shell installer tests after Repo tests (CPU, auto-discovered) in the same job. That earlier step had been failing on an unrelated encoding assertion, so every later step was skipped, including the one that runs this guard. #7642 fixed the encoding assertion, the shell step started running again, and this surfaced immediately.

Change

Each of the six sites now calls the helper instead of exiting directly, carrying the message that the adjacent step / substep already prints. The preceding step / substep output is untouched, so the terminal experience is identical.

Exit codes are unchanged. Verified directly against the extracted helper:

UNSLOTH_TAURI_MODE exit code stdout
unset 1 (none)
0 1 (none)
1 1 [TAURI:ERROR] <message>
true 1 [TAURI:ERROR] <message>

Identical to the bare exit 1 for CLI users, and it restores the Tauri channel.

Verification

  • tests/sh/test_tauri_retry_failure_context.sh: all assertions pass, including the two that were previously unreachable (Windows setup routes explicit exits through Exit-SetupFailure never ran before, because the Unix assertion exited first).
  • The full Backend CI Shell installer tests step run verbatim: 26 files, 0 failed (was 1 failed).
  • bash -n studio/setup.sh clean; studio/setup.ps1 parses under the PowerShell AST parser.
  • The 25 Python test files that reference either setup script: 1387 passed. The 4 unrelated failures in test_managed_node_runtime.py and test_tokenizers_and_torch_constraint.py reproduce identically on unmodified main.

…lpers

#7188 added three bare exits to studio/setup.sh and three to studio/setup.ps1
for the explicit-Vulkan paths. Bare exits skip setup_fail / Exit-SetupFailure,
so the [TAURI:ERROR] line that #7529 added never reaches Studio desktop and a
Vulkan install failure shows up there with no actionable context.

tests/sh/test_tauri_retry_failure_context.sh already asserts that each setup
script has exactly one explicit exit and that it lives inside the helper. That
assertion was failing, but the failure was invisible: Backend CI skips the
Shell installer tests step whenever the auto-discovered pytest step fails
first, and it had been failing on an unrelated encoding assertion until #7642.

Exit codes are unchanged: setup_fail 1 and Exit-SetupFailure both exit 1, and
the Tauri line is still emitted only when UNSLOTH_TAURI_MODE is set.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ffb313f58

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread studio/setup.sh
step "llama.cpp" "Vulkan was explicitly requested, but this installation requires a source build" "$C_ERR"
substep "Vulkan source builds are not supported by this installer; use the prebuilt Vulkan bundle or unset the Vulkan override"
exit 1
setup_fail 1 "Vulkan was explicitly requested, but this installation requires a source build, which this installer does not support. Use the prebuilt Vulkan bundle or unset the Vulkan override."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the Vulkan fail-closed tests for the helpers

When Backend CI runs studio/backend/tests, test_explicit_vulkan_prebuilt_failure_does_not_change_backend and test_explicit_vulkan_source_build_fails_closed still require the guarded Unix and PowerShell blocks to contain the literal exit 1 (lines 137/146 and 159/169 of test_setup_llama_cpp_backend.py). Replacing those exits with setup_fail/Exit-SetupFailure therefore makes both tests fail in every Python matrix job; update these assertions to verify the corresponding helper invocation instead.

Useful? React with 👍 / 👎.

@danielhanchen
danielhanchen merged commit 07fb20f into main Jul 30, 2026
72 of 78 checks passed
@danielhanchen
danielhanchen deleted the fix-setup-tauri-error-surfacing branch July 30, 2026 12:37
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