Skip to content

Future build: Updated workflows and builds#1966

Open
Suika wants to merge 22 commits intohydrusnetwork:masterfrom
Suika:future-build-final
Open

Future build: Updated workflows and builds#1966
Suika wants to merge 22 commits intohydrusnetwork:masterfrom
Suika:future-build-final

Conversation

@Suika
Copy link
Collaborator

@Suika Suika commented Feb 12, 2026

Changes:

  • Prebuilt packages are now using a single spec
  • Prebuilt packages move all the files to "lib"
  • Docker builds now cache their stages
  • Some workflow logic is now in spec and innosetup
  • Cleaner windows and linux builds
  • mpv 20260201
  • sqlite3 3.51.2
  • docker alpine 3.23

For this pull to work it needs something like bellow, or better yet https://pyinstaller.org/en/stable/runtime-information.html with __file__ usage, since it will either point to _MEIPASS or the .py file being executed. I see some old logic in the code, but it is kinda twisted:

From 3e78c3ad534733e6af1f277e033ab6ac4ac821da Mon Sep 17 00:00:00 2001
From: Suika <2320837+Suika@users.noreply.github.com>
Date: Sat, 31 Jan 2026 19:05:38 +0100
Subject: [PATCH] Temp: Fix static paths in a frozen build

This should be done in a more proper way.
---
 hydrus/core/HydrusConstants.py | 14 ++++++++++----
 hydrus/core/HydrusStaticDir.py |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/hydrus/core/HydrusConstants.py b/hydrus/core/HydrusConstants.py
index c123dc394..8a7f97a04 100644
--- a/hydrus/core/HydrusConstants.py
+++ b/hydrus/core/HydrusConstants.py
@@ -77,8 +77,16 @@
 elif RUNNING_FROM_MACOS_APP:
     NICE_RUNNING_AS_STRING = 'from App'
 
-BIN_DIR = os.path.join( BASE_DIR, 'bin' )
-HELP_DIR = os.path.join( BASE_DIR, 'help' )
+if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
+    BIN_DIR = os.path.join( BASE_DIR, 'lib', 'bin' )
+    HELP_DIR = os.path.join( BASE_DIR, 'lib', 'help' )
+    INCLUDE_DIR = os.path.join( BASE_DIR, 'lib', 'include' )
+    LICENSE_PATH = os.path.join( BASE_DIR, 'lib', 'license.txt' )
+else:
+    BIN_DIR = os.path.join( BASE_DIR, 'bin' )
+    HELP_DIR = os.path.join( BASE_DIR, 'help' )
+    INCLUDE_DIR = os.path.join( BASE_DIR, 'include' )
+    LICENSE_PATH = os.path.join( BASE_DIR, 'license.txt' )
 
 DEFAULT_DB_DIR = os.path.join( BASE_DIR, 'db' )
 
@@ -102,8 +110,6 @@
 
 WE_SWITCHED_TO_USERPATH = False
 
-LICENSE_PATH = os.path.join( BASE_DIR, 'license.txt' )
-
 #
 
 options = {}
diff --git a/hydrus/core/HydrusStaticDir.py b/hydrus/core/HydrusStaticDir.py
index 5162fc462..b3f83e5b6 100644
--- a/hydrus/core/HydrusStaticDir.py
+++ b/hydrus/core/HydrusStaticDir.py
@@ -3,7 +3,7 @@
 from hydrus.core import HydrusConstants as HC
 from hydrus.core import HydrusGlobals as HG
 
-INSTALL_STATIC_DIR = os.path.join( HC.BASE_DIR, 'static' )
+INSTALL_STATIC_DIR = os.path.join( HC.BASE_DIR, 'lib', 'static' )
 
 USE_USER_STATIC_DIR = True
 

Suika added 22 commits February 8, 2026 01:47
Use contents_directory to create cleaner builds as well as consolidating the build specs for the server and client into one spec. Files are moved via the spec.
Use contents_directory to create cleaner builds as well as consolidating the build specs for the server and client into one spec.
In general it is not advised to remove any .so files from pyinstaller builds.
      --no-same-owner
              Extract files as yourself (default for ordinary users).

       --no-same-permissions
              Apply the user's umask when extracting permissions from the
              archive (default for ordinary users).

       -p, --preserve-permissions, --same-permissions
              Set permissions of extracted files to those recorded in the
              archive (default for superuser).

       --same-owner
              Try extracting files with the same ownership as exists in
              the archive (default for superuser).
gha does not cache anything. And this should live longer than then gha cache either way.
@hydrusnetwork
Copy link
Owner

Thank you again! I hope to fold this into a 'future build' test for v661 and will merge this into a new branch probably next Saturday.

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.

2 participants