Skip to content

[Local|Packaging] Fail pnpm dist on a missing toolchain, with the install command - #1928

Merged
CREDO23 merged 1 commit into
MODSetter:devfrom
CREDO23:fix/local-dist-toolchain
Sep 26, 2026
Merged

CREDO23 merged 1 commit into
MODSetter:devfrom
CREDO23:fix/local-dist-toolchain

Conversation

@CREDO23

@CREDO23 CREDO23 commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • pnpm dist stages sd.cpp and audio.cpp with --strict, as release CI does. Before, a machine without CMake or GCC 13 built an installer with no local audio, with only a warning in the scrollback, and the app then said "Audio models cannot run on this computer".
  • The native runtimes stage first, so a missing tool stops the build in about a second, before the frontend and PyInstaller steps.
  • The failure names every missing tool at once and prints the command that installs them with the machine's package manager (apt, dnf, pacman, Homebrew with xcode-select, winget). No stack trace:
    audio.cpp is not staged: on Linux it is compiled from source, and this machine lacks CMake and GCC 13 or newer. Install what is missing, then run the build again:
    
      sudo apt install cmake g++
    
  • predev stays lenient: dev prints the same message and runs without local audio.
  • build-audiocpp.yml and build-sdcpp.yml also run on changes to scripts/not-staged/, which both compile scripts now import.
  • Limits: g++ is GCC 13 only from Ubuntu 24.04 and Fedora 39, so an older g++ is named without a command. The winget and Homebrew commands have not been run on Windows or macOS.
  • Tested: pnpm test (87 pass, 7 new on the message), pnpm typecheck, and pnpm dist on Ubuntu 24.04 without and then with CMake and g++.

Follows #1914

🤖 Generated with Claude Code

High-level PR Summary

This PR improves the local packaging experience by making pnpm dist fail fast and clearly when build tools are missing, instead of silently creating broken installers. When CMake, GCC 13, or other required toolchains are absent, the build now stops immediately with a helpful error message that includes the exact package manager command to install what's missing (for apt, dnf, pacman, Homebrew, or winget). The native runtime builds (sd.cpp and audio.cpp) are moved to the front of the build pipeline to catch toolchain issues before the slower frontend and PyInstaller steps run. Development builds remain lenient so developers can still run without local audio/image support.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_local/electron/scripts/not-staged/tools.mjs
2 surfsense_local/electron/scripts/not-staged/install-commands.mjs
3 surfsense_local/electron/scripts/not-staged/package-manager.mjs
4 surfsense_local/electron/scripts/not-staged/message.mjs
5 surfsense_local/electron/scripts/not-staged/message.test.mjs
6 surfsense_local/electron/scripts/audiocpp/compile.mjs
7 surfsense_local/electron/scripts/sdcpp/compile.mjs
8 surfsense_local/electron/scripts/audiocpp/stage.mjs
9 surfsense_local/electron/scripts/sdcpp/stage.mjs
10 surfsense_local/electron/package.json
11 .github/workflows/build-audiocpp.yml
12 .github/workflows/build-sdcpp.yml
13 docs/architecture/packaging.md

Need help? Join our Discord

…l command

pnpm dist staged audio.cpp and sd.cpp leniently, so a machine without
CMake or GCC 13 built an installer with no local audio and only a warning
in the scrollback. It now passes --strict, as release CI does, and stages
the native runtimes first so a missing tool stops it in about a second.

The failure names every missing tool at once and prints the command that
installs them with the machine's package manager, without a stack trace.
predev stays lenient.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 26, 2026

Copy link
Copy Markdown

@CREDO23 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 53f9a3b8-efe9-4d3f-96a7-5a67ebd6ce58

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CREDO23
CREDO23 merged commit e1c50d5 into MODSetter:dev Sep 26, 2026
20 of 22 checks passed
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