Skip to content

Linux build: fix resource_path resolution for frozen build + auto build script #1031

@TurekCom

Description

@TurekCom

Title: Linux build: fix resource_path resolution for frozen build + auto build script

Hi, I tested basiliskLLM on Linux and found a resource path issue in frozen builds.

Problem

  • Runtime error:
    Failed to load sound: .../dist/basilisk/res/sounds/progress.wav
  • In Linux cx_Freeze build, resources are in dist/res/..., while code expected a different path in some layouts.

What I changed

  1. basilisk/global_vars.py
  • Added _resolve_resource_path() that checks multiple valid locations and picks the first existing one:
    • <base_path>/res
    • <base_path>/_internal/basilisk/res (PyInstaller-style layout)
    • <package_dir>/res (source run)
  1. Added helper build script
  • scripts/update_and_build_from_github.py
  • Clones/updates repo and builds automatically on Linux using uv (or pip/venv fallback).

Result

  • Rebuild completed successfully on Linux.
  • progress.wav resolved correctly from dist/res/sounds/progress.wav.
  • App starts and sound loading error is gone.

Patch

  • I attached a patch generated from commit:
    4a0c023 Fix frozen resource path and add GitHub auto-build script

If you want, I can split this into 2 separate commits (bugfix + build tooling).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions