Skip to content

fix: AppImage pydantic-core module missing (closes #13)#14

Merged
I4cTime merged 1 commit intomainfrom
13-appimage-module-missing
Apr 18, 2026
Merged

fix: AppImage pydantic-core module missing (closes #13)#14
I4cTime merged 1 commit intomainfrom
13-appimage-module-missing

Conversation

@I4cTime
Copy link
Copy Markdown
Owner

@I4cTime I4cTime commented Apr 18, 2026

Summary

Fixes #13 — AppImage fails to start on systems where the Python minor version differs from the one used in CI (e.g. CachyOS with Python 3.13 vs CI-built with 3.12).

Root cause: Vendored pydantic_core contains a native .so extension compiled for a specific Python ABI (cpython-312-x86_64-linux-gnu). When the user's Python is a different minor version, the .so doesn't load and the app crashes with ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'.

Changes

File Change
src/game_setup_hub/_vendor_compat.py New — startup bootstrap that detects ABI-incompatible vendored native extensions and removes them so Python falls back to system site-packages
src/game_setup_hub/api.py Import _vendor_compat before all other imports
electron/main.ts Ensure PYTHONNOUSERSITE is unset so system packages are reachable
electron/scripts/vendor-python-deps.sh Clean up __pycache__ and dist-info bloat; log Python version and .so count
.github/workflows/build-release.yml Add actions/setup-python@v5 with Python 3.12 pinned
electron/package.json Add python3-pydantic to deb/rpm depends; bump to 0.8.11
pyproject.toml Bump to 0.8.11

How it works

  1. On startup, _vendor_compat.py checks each vendored package with native .so files
  2. Compares the .so filename's ABI tag against the running Python's SOABI
  3. If incompatible, removes the vendored package directory at runtime
  4. Python then falls back to system-installed packages (e.g. python-pydantic-core from pacman)

Made with Cursor

)

The bundled pydantic_core .so extension was compiled for one Python
minor version but failed on systems running a different version
(e.g. built with 3.12 but user has 3.13).

- Add _vendor_compat.py bootstrap that detects ABI-incompatible
  vendored native extensions and removes them at startup so Python
  falls back to system site-packages
- Pin Python 3.12 in CI build workflow via actions/setup-python
- Add python3-pydantic to deb/rpm package dependencies
- Clean up vendor script (remove __pycache__, trim dist-info)
- Ensure PYTHONNOUSERSITE is unset so system packages are reachable
- Bump version to 0.8.11

Made-with: Cursor
@I4cTime I4cTime linked an issue Apr 18, 2026 that may be closed by this pull request
@I4cTime I4cTime merged commit 1d6e23a into main Apr 18, 2026
4 checks passed
@alligatorshoes
Copy link
Copy Markdown

alligatorshoes commented Apr 18, 2026

Still broken in the latest version:

❯ ./ProtonShift-0.8.11.AppImage
[2026-04-18 16:51:46.512] [MANGOHUD] [info] [gpu.cpp:89] Set renderD128 as active GPU (driver=nvidia id=10de:2484 pci_dev=0000:0a:00.0)
[python] Traceback (most recent call last):
[python] File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/tmp/.mount_Protond8MJMp/resources/python/src/game_setup_hub/api.py", line 13, in
from fastapi import FastAPI, HTTPException
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/fastapi/init.py", line 7, in
from .applications import FastAPI as FastAPI
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/fastapi/applications.py", line 6, in
from fastapi import routing
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/fastapi/routing.py", line 35, in
from fastapi import params
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/fastapi/params.py", line 7, in
from fastapi.exceptions import FastAPIDeprecationWarning
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/fastapi/exceptions.py", line 5, in
from pydantic import BaseModel, create_model
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/pydantic/init.py", line 5, in
from ._migration import getattr_migration
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/pydantic/_migration.py", line 4, in
from pydantic.warnings import PydanticDeprecatedSince20
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/pydantic/warnings.py", line 5, in
from .version import version_short
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/pydantic/version.py", line 7, in
from pydantic_core import version as pydantic_core_version
File "/tmp/.mount_Protond8MJMp/resources/python/vendor/pydantic_core/init.py", line 8, in
from ._pydantic_core import (
...<21 lines>...
)
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
Failed to start Python backend: Error: Python exited with code 1
at ChildProcess. (/tmp/.mount_Protond8MJMp/resources/app.asar/dist/main.js:134:24)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)

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.

AppImage Module Missing

2 participants