Skip to content

Commit cdf5bd1

Browse files
lsteinLincoln Stein
andauthored
[Bugfix] Fix pyinstallers (#85)
* fix launch path in MacOS installer * do not generate --onefile installers * try using an older ubuntu distribution to avoid library incompatibility issues * try using ubuntu-22.04 --------- Co-authored-by: Lincoln Stein <[email protected]>
1 parent 288b088 commit cdf5bd1

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

.github/workflows/deploy-pyinstaller.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
build:
99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, macos-latest, windows-latest]
11+
os: [ubuntu-22.04, macos-latest, windows-latest]
1212
torch_variant: [cpu, cu129]
1313
include:
14-
- os: ubuntu-latest
14+
- os: ubuntu-22.04
1515
platform: linux-x64
1616
build_script: ./INSTALL/pyinstaller/make_pyinstaller_image.sh
1717
executable_ext: ""

INSTALL/pyinstaller/make_pyinstaller_image.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ switch ($TorchVariant) {
3131
}
3232

3333
# Set PyInstaller mode based on torch variant
34-
if ($TorchVariant -eq "cpu") {
35-
$pyinstallerMode = "--onefile"
36-
} else {
37-
$pyinstallerMode = "--onedir"
38-
}
34+
# if ($TorchVariant -eq "cpu") {
35+
# $pyinstallerMode = "--onefile"
36+
# } else {
37+
# $pyinstallerMode = "--onedir"
38+
# }
39+
40+
# --onefile has too many problems with large packages like torch!
41+
$pyinstallerMode = "--onedir"
3942

4043
# Upgrade build tools and hooks
4144
python -m pip install -U pip wheel setuptools

INSTALL/pyinstaller/make_pyinstaller_image.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ fi
3535
# Set PyInstaller mode based on torch variant and platform
3636
if [[ "$MACOS_APP" == true ]]; then
3737
PYINSTALLER_MODE="--windowed"
38-
elif [[ "$TORCH_VARIANT" == cpu ]]; then
39-
PYINSTALLER_MODE="--onefile"
38+
# always use --onedir for CPU builds to avoid startup issues
39+
# elif [[ "$TORCH_VARIANT" == cpu ]]; then
40+
# PYINSTALLER_MODE="--onefile"
4041
else
4142
PYINSTALLER_MODE="--onedir"
4243
fi
@@ -140,7 +141,8 @@ if [[ "$MACOS_APP" == true ]]; then
140141
LAUNCHER="$MACOS_DIR/run_in_terminal.sh"
141142
cat > "$LAUNCHER" <<EOF
142143
#!/bin/bash
143-
exec osascript -e 'tell application "Terminal" to do script "'"$MACOS_DIR/$BIN_NAME"'"'
144+
PWD=$(dirname "$0")
145+
exec osascript -e 'tell application "Terminal" to do script "'"$PWD/$BIN_NAME"'"'
144146
EOF
145147
chmod +x "$LAUNCHER"
146148

0 commit comments

Comments
 (0)