fix(release): install python shared libraries for PyInstaller and add zipapp fallback
This commit is contained in:
@@ -21,8 +21,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Python and Build Dependencies
|
- name: Install System and Python Build Dependencies
|
||||||
run: |
|
run: |
|
||||||
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
|
echo "[*] Installing Python shared libraries and headers for PyInstaller..."
|
||||||
|
SUDO=""
|
||||||
|
if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then
|
||||||
|
SUDO="sudo"
|
||||||
|
fi
|
||||||
|
$SUDO apt-get update && $SUDO apt-get install -y --no-install-recommends python3-dev libpython3-dev python3-all-dev "libpython3.*" || true
|
||||||
|
fi
|
||||||
python3 compilation/ensure_pip.py
|
python3 compilation/ensure_pip.py
|
||||||
python3 -m pip install --upgrade pip --break-system-packages 2>/dev/null || python3 -m pip install --upgrade pip 2>/dev/null || true
|
python3 -m pip install --upgrade pip --break-system-packages 2>/dev/null || python3 -m pip install --upgrade pip 2>/dev/null || true
|
||||||
python3 -m pip install pyinstaller -r compilation/requirements.txt --break-system-packages 2>/dev/null || python3 -m pip install pyinstaller -r compilation/requirements.txt
|
python3 -m pip install pyinstaller -r compilation/requirements.txt --break-system-packages 2>/dev/null || python3 -m pip install pyinstaller -r compilation/requirements.txt
|
||||||
|
|||||||
@@ -112,11 +112,15 @@ def build_linux():
|
|||||||
is_linux_host = platform.system() == "Linux"
|
is_linux_host = platform.system() == "Linux"
|
||||||
|
|
||||||
if is_linux_host:
|
if is_linux_host:
|
||||||
linux_client_script = os.path.join(SRC_DIR, "Linux_Client.py")
|
try:
|
||||||
build_pyinstaller_binary(linux_client_script, "Linux_Client.bin")
|
linux_client_script = os.path.join(SRC_DIR, "Linux_Client.py")
|
||||||
|
build_pyinstaller_binary(linux_client_script, "Linux_Client.bin")
|
||||||
|
|
||||||
server_script = os.path.join(SRC_DIR, "Server.py")
|
server_script = os.path.join(SRC_DIR, "Server.py")
|
||||||
build_pyinstaller_binary(server_script, "Server.bin")
|
build_pyinstaller_binary(server_script, "Server.bin")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"[!] PyInstaller compilation encountered an issue ({e}). Falling back to standalone zipapp packaging...")
|
||||||
|
build_linux_zipapp_fallback()
|
||||||
|
|
||||||
# Normalize extensions in case PyInstaller dropped .bin
|
# Normalize extensions in case PyInstaller dropped .bin
|
||||||
for name in ["Linux_Client", "Server"]:
|
for name in ["Linux_Client", "Server"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user