Fix: support macOS arm64 packaged webapp startup#5777
Open
Acfufu wants to merge 1 commit into
Open
Conversation
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.
Summary
process.cwd()Deploy.Python.PythonExecutablewhen it existsalasconda environment when the default Windows./toolkit/python.exepath is missingProblem
Fixes #5105.
On macOS arm64, the packaged Electron app can start from Finder or another non-repo working directory. In that case the main process should not assume
process.cwd()is the project root. The default Python path inconfig/deploy.yamlalso points to./toolkit/python.exe, which does not exist on Apple Silicon setups and causesspawn .../toolkit/python.exe ENOENT.Issue #1873 already shows that Apple Silicon users need to provide their own Python environment. This change keeps the current config-first behavior, but lets the packaged app recover by using a local
alasconda environment when the configured Windows path is unavailable.Verification
cd webapp && PATH=/Users/acfufu/.nvm/versions/node/v16.20.2/bin:$PATH npm run typecheckcd webapp && PATH=/Users/acfufu/.nvm/versions/node/v16.20.2/bin:$PATH npm run buildcd webapp && PATH=/Users/acfufu/.nvm/versions/node/v16.20.2/bin:$PATH npm run compilewebapp/dist/mac-arm64/alas.app/Contents/MacOS/alasfrom/tmphttp://127.0.0.1:22267/withouttoolkit/python.exespawn errorsNotes
npm run typecheckfrom the repo root, but the onlypackage.jsonis underwebapp/, so that hook fails before checking the actual webapp workspacenpm teststill times out in the existing Electron smoke test while waiting for the first window, even though the packaged app and WebUI start successfully