fix: bundle all Python deps (PYTHONNOUSERSITE) + no blocking plugin install in packaged builds - #18
Open
mogul wants to merge 1 commit into
Open
fix: bundle all Python deps (PYTHONNOUSERSITE) + no blocking plugin install in packaged builds#18mogul wants to merge 1 commit into
mogul wants to merge 1 commit into
Conversation
…ackages Two related fixes for the bundled embeddable/standalone Python: - build-common.sh exports PYTHONNOUSERSITE=1 for the whole build. Without it, pip on a dev/CI machine that has a system Python sees transitive deps as 'already satisfied' via the per-user site (~/.local, %APPDATA%\Python) and SKIPS bundling them (typing_extensions, urllib3, certifi, ...). The packaged app then crashes with ModuleNotFoundError on clean end-user machines while 'working' on the build box. Clean CI runners have no user site, so this is a no-op there. - python.ts sets PYTHONNOUSERSITE=1 in the spawned server env so a stray user-site package on an end-user machine can't shadow (or mask a gap in) the bundled deps. When packaged it also sets SLOPSMITH_SKIP_PLUGIN_INSTALL=1 so the server doesn't block startup doing runtime 'pip install' of heavy optional plugin deps (torch/whisperx/demucs) — that hung the backend past the readiness window on first launch. (Pairs with the slopsmith core change that honours that flag.) Co-Authored-By: Claude Opus 4.8 <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
Windows portable builds crash on clean tester machines with
ModuleNotFoundError: No module named 'typing_extensions'("Backend failed: python process failed before startup completed") — yet work on the build machine. First-launch also hangs while the server runs blockingpip installfor heavy optional plugins.Cause
The embeddable Python's
import siteenables the per-user site (%APPDATA%\Python\...). On a build machine with a system Python, pip sees transitive deps as already satisfied via user-site and skips bundling them (typing_extensions,urllib3,certifi,idna,charset_normalizer,psutil,requests). The dev box masks it at runtime too; clean machines have no user-site → import crash. Separately, the serverpip installs plugin requirements at startup, which blocks on multi-GB deps.Fix
build-common.sh:export PYTHONNOUSERSITE=1so the build's pip resolves against the bundle only and installs every transitive dep. No-op on clean CI (no user-site).python.ts: setPYTHONNOUSERSITE=1in the server env (never read an end user's user-site); and when packaged, setSLOPSMITH_SKIP_PLUGIN_INSTALL=1so startup isn't blocked by runtime plugin installs (pairs with the slopsmith-core change that honours the flag; plugins load degraded until deps exist).Safety
Build-script + spawn-env only; no app-logic change. Fixes a real shipped-build crash. Recommended before the 0.2.9 desktop release. Verified: with
PYTHONNOUSERSITE=1, the Windows bundle imports the full server cleanly under a clean-machine simulation.