From 97fc9c7061a95646acf78fc8f2b5797b6b07bdf7 Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 09:59:16 -0700 Subject: [PATCH 01/10] Updated the AppImage CI workflow to explicitly verify built-in plugin .so files are present in AppDir after install, checking checksum, fishlim, lua, perl, python, and sysinfo (and therefore excluding the Windows updater plugin from required Linux AppImage contents). Updated the generated AppRun script to set ZOITECHAT_LIBDIR to the bundled plugin directory inside the AppImage (usr/lib/x86_64-linux-gnu/zoitechat/plugins with fallback to usr/lib/zoitechat/plugins) so plugin discovery resolves correctly at runtime from the AppImage payload. --- .github/workflows/appimage-build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index fde6780b..3ecee2b3 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -61,6 +61,17 @@ jobs: rm -rf AppDir DESTDIR="${PWD}/AppDir" ninja -C build install + - name: Verify bundled plugins + run: | + set -eux + + # Include every built-in plugin except the Windows-only update plugin. + find AppDir/usr/lib -maxdepth 4 -type f -name '*.so' -path '*/zoitechat/plugins/*' -print | sort + + for plugin in checksum fishlim lua perl python sysinfo; do + find "AppDir/usr/lib" -maxdepth 4 -type f -name "${plugin}.so" -path '*/zoitechat/plugins/*' -print -quit | grep -q . + done + - name: Build AppImage env: APPIMAGE_EXTRACT_AND_RUN: 1 @@ -91,6 +102,12 @@ jobs: export LD_LIBRARY_PATH="$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" export XDG_DATA_DIRS="$APPDIR/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + if [ -d "$APPDIR/usr/lib/x86_64-linux-gnu/zoitechat/plugins" ]; then + export ZOITECHAT_LIBDIR="$APPDIR/usr/lib/x86_64-linux-gnu/zoitechat/plugins" + elif [ -d "$APPDIR/usr/lib/zoitechat/plugins" ]; then + export ZOITECHAT_LIBDIR="$APPDIR/usr/lib/zoitechat/plugins" + fi + if [ -d "$APPDIR/usr/share/glib-2.0/schemas" ]; then export GSETTINGS_SCHEMA_DIR="$APPDIR/usr/share/glib-2.0/schemas${GSETTINGS_SCHEMA_DIR:+:$GSETTINGS_SCHEMA_DIR}" fi From 6b6869e3278c7c38b21b54254860ca703058f3a5 Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 10:10:24 -0700 Subject: [PATCH 02/10] Updated the AppImage AppRun generation in CI so PATH now keeps the host entries first and appends AppDir/usr/bin after, preventing helper modules from accidentally invoking an incomplete bundled python3. --- .github/workflows/appimage-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index 3ecee2b3..4b7a15a3 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -98,7 +98,7 @@ jobs: APPDIR="${APPDIR:-$(dirname "$(readlink -f "$0")")}" - export PATH="$APPDIR/usr/bin:${PATH:-/usr/bin:/bin}" + export PATH="${PATH:-/usr/bin:/bin}:$APPDIR/usr/bin" export LD_LIBRARY_PATH="$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" export XDG_DATA_DIRS="$APPDIR/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" From 2705d21f6e5e638cef3f67bcc75e2214be7cfd8a Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 10:27:27 -0700 Subject: [PATCH 03/10] Updated the AppImage GitHub Actions dependency install list to explicitly include runtime packages for Perl and Python (perl, python3, and python3-minimal) so the packaged app has the interpreter/runtime components needed at build/package time. This is in addition to the existing dev packages already present. --- .github/workflows/appimage-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index 4b7a15a3..89817109 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -34,7 +34,7 @@ jobs: libxkbcommon0 \ libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \ libluajit-5.1-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \ - python3-dev python3-cffi mono-devel desktop-file-utils \ + perl python3 python3-minimal python3-dev python3-cffi mono-devel desktop-file-utils \ patchelf file curl - name: Configure From 2713270e1f6712afe7c50ebe04b2393a58511d27 Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 10:38:08 -0700 Subject: [PATCH 04/10] =?UTF-8?q?Added=20a=20new=20workflow=20step,=20?= =?UTF-8?q?=E2=80=9CBundle=20scripting=20runtimes=20in=20AppDir=E2=80=9D,?= =?UTF-8?q?=20that=20copies=20Python=20and=20Perl=20runtime=20artifacts=20?= =?UTF-8?q?into=20AppDir=20(Python=20binary=20+=20stdlib=20+=20libpython3*?= =?UTF-8?q?.so*,=20Perl=20binary=20+=20common=20Perl=20library/share=20pat?= =?UTF-8?q?hs).=20This=20addresses=20the=20root=20issue=20that=20runner-in?= =?UTF-8?q?stalled=20runtimes=20were=20not=20necessarily=20ending=20up=20i?= =?UTF-8?q?nside=20the=20final=20AppImage=20payload.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated AppRun to explicitly set PYTHONHOME to the bundled runtime root and initialize PYTHONPATH from bundled Python directories, so embedded Python can resolve core modules like encodings at runtime. --- .github/workflows/appimage-build.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index 89817109..725cd533 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -61,6 +61,39 @@ jobs: rm -rf AppDir DESTDIR="${PWD}/AppDir" ninja -C build install + - name: Bundle scripting runtimes in AppDir + run: | + set -eux + + python3_version="$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')" + + install -Dm755 "$(command -v python3)" "AppDir/usr/bin/python3" + if [ -x "/usr/bin/perl" ]; then + install -Dm755 /usr/bin/perl AppDir/usr/bin/perl + fi + + install -d AppDir/usr/lib + cp -a "/usr/lib/python${python3_version}" "AppDir/usr/lib/" + + if [ -d "/usr/lib/x86_64-linux-gnu/perl" ]; then + install -d AppDir/usr/lib/x86_64-linux-gnu + cp -a /usr/lib/x86_64-linux-gnu/perl AppDir/usr/lib/x86_64-linux-gnu/ + fi + + if [ -d "/usr/share/perl" ]; then + install -d AppDir/usr/share + cp -a /usr/share/perl AppDir/usr/share/ + fi + + if [ -d "/usr/share/perl5" ]; then + install -d AppDir/usr/share + cp -a /usr/share/perl5 AppDir/usr/share/ + fi + if compgen -G '/usr/lib/x86_64-linux-gnu/libpython3*.so*' > /dev/null; then + install -d AppDir/usr/lib/x86_64-linux-gnu + cp -a /usr/lib/x86_64-linux-gnu/libpython3*.so* AppDir/usr/lib/x86_64-linux-gnu/ + fi + - name: Verify bundled plugins run: | set -eux @@ -118,6 +151,14 @@ jobs: export GIO_EXTRA_MODULES="$APPDIR/usr/lib/gio/modules${GIO_EXTRA_MODULES:+:$GIO_EXTRA_MODULES}" fi + export PYTHONHOME="$APPDIR/usr" + python_stdlib_dir="$(find "$APPDIR/usr/lib" -maxdepth 1 -type d -name 'python3.*' | head -n 1 || true)" + if [ -n "$python_stdlib_dir" ] && [ -d "$python_stdlib_dir/dist-packages" ]; then + export PYTHONPATH="$python_stdlib_dir/dist-packages:$APPDIR/usr/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}" + else + export PYTHONPATH="$APPDIR/usr/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}" + fi + # OpenSSL trust store override export SSL_CERT_FILE="${SSL_CERT_FILE:-$APPDIR/etc/ssl/certs/ca-certificates.crt}" export SSL_CERT_DIR="${SSL_CERT_DIR:-$APPDIR/etc/ssl/certs}" From 931dddcf0ef034a5d5f8a052845fe2b58438ea14 Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 10:47:01 -0700 Subject: [PATCH 05/10] Enabled the Python plugin in the Flatpak build by changing Meson config from -Dwith-python=false to -Dwith-python=python3, so it gets built in the Flatpak app module. Set Flatpak to prefer Wayland by default by adding --env=GDK_BACKEND=wayland,x11 (while keeping existing Wayland and X11 sockets for compatibility). --- flatpak/net.zoite.Zoitechat.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flatpak/net.zoite.Zoitechat.json b/flatpak/net.zoite.Zoitechat.json index b7436edd..5e3a8cfb 100644 --- a/flatpak/net.zoite.Zoitechat.json +++ b/flatpak/net.zoite.Zoitechat.json @@ -7,6 +7,7 @@ "command": "zoitechat", "finish-args": [ "--share=ipc", + "--env=GDK_BACKEND=wayland,x11", "--socket=wayland", "--socket=fallback-x11", "--share=network", @@ -59,7 +60,7 @@ "-Dgtk3=true", "-Ddbus-service-use-appid=true", "-Dwith-perl=false", - "-Dwith-python=false", + "-Dwith-python=python3", "-Dwith-lua=lua" ], "build-options": { From 796c5722929bcca0cb1dbded0d15d0a1b8fc284f Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 10:56:46 -0700 Subject: [PATCH 06/10] Updated the AppImage workflow to copy Python dist-packages into the AppDir for both standard and multiarch layouts (/usr/lib/python3/dist-packages and /usr/lib/x86_64-linux-gnu/python3/dist-packages). This ensures Python runtime modules needed by the embedded plugin are actually bundled. Updated AppRun Python environment setup to build PYTHONPATH dynamically from all bundled candidate directories instead of assuming only one path. This should address cases where the Python plugin fails to initialize in the AppImage due to missing import paths. --- .github/workflows/appimage-build.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index 725cd533..18d47a5c 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -75,6 +75,16 @@ jobs: install -d AppDir/usr/lib cp -a "/usr/lib/python${python3_version}" "AppDir/usr/lib/" + if [ -d "/usr/lib/python3/dist-packages" ]; then + install -d AppDir/usr/lib/python3 + cp -a /usr/lib/python3/dist-packages AppDir/usr/lib/python3/ + fi + + if [ -d "/usr/lib/x86_64-linux-gnu/python3/dist-packages" ]; then + install -d AppDir/usr/lib/x86_64-linux-gnu/python3 + cp -a /usr/lib/x86_64-linux-gnu/python3/dist-packages AppDir/usr/lib/x86_64-linux-gnu/python3/ + fi + if [ -d "/usr/lib/x86_64-linux-gnu/perl" ]; then install -d AppDir/usr/lib/x86_64-linux-gnu cp -a /usr/lib/x86_64-linux-gnu/perl AppDir/usr/lib/x86_64-linux-gnu/ @@ -153,10 +163,18 @@ jobs: export PYTHONHOME="$APPDIR/usr" python_stdlib_dir="$(find "$APPDIR/usr/lib" -maxdepth 1 -type d -name 'python3.*' | head -n 1 || true)" + pythonpath_entries="" if [ -n "$python_stdlib_dir" ] && [ -d "$python_stdlib_dir/dist-packages" ]; then - export PYTHONPATH="$python_stdlib_dir/dist-packages:$APPDIR/usr/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}" - else - export PYTHONPATH="$APPDIR/usr/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}" + pythonpath_entries="$python_stdlib_dir/dist-packages" + fi + if [ -d "$APPDIR/usr/lib/python3/dist-packages" ]; then + pythonpath_entries="${pythonpath_entries:+$pythonpath_entries:}$APPDIR/usr/lib/python3/dist-packages" + fi + if [ -d "$APPDIR/usr/lib/x86_64-linux-gnu/python3/dist-packages" ]; then + pythonpath_entries="${pythonpath_entries:+$pythonpath_entries:}$APPDIR/usr/lib/x86_64-linux-gnu/python3/dist-packages" + fi + if [ -n "$pythonpath_entries" ]; then + export PYTHONPATH="$pythonpath_entries${PYTHONPATH:+:$PYTHONPATH}" fi # OpenSSL trust store override From 76796f5f23bb0bfe5f7aed542c5e539aedf18f3e Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 11:03:57 -0700 Subject: [PATCH 07/10] Fixed Python plugin module discovery to search multiple valid install layouts before importing zoitechat, instead of assuming only one path. This includes: existing sibling fallback (../python) direct fallback (libdir/python) AppImage-aware fallbacks under $APPDIR/usr/lib/zoitechat/python and $APPDIR/usr/lib/x86_64-linux-gnu/zoitechat/python. Added guards so paths are appended only if the directory exists and is not already in sys.path, reducing duplicate/invalid entries while improving robustness across packaging layouts. --- plugins/python/python.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/python/python.py b/plugins/python/python.py index bab732f7..93c56040 100644 --- a/plugins/python/python.py +++ b/plugins/python/python.py @@ -538,8 +538,22 @@ def _on_plugin_init(plugin_name, plugin_desc, plugin_version, arg, libdir): try: libdir = __decode(_cstr(libdir)) - modpath = os.path.join(libdir, '..', 'python') - sys.path.append(os.path.abspath(modpath)) + modpaths = [ + os.path.abspath(os.path.join(libdir, '..', 'python')), + os.path.abspath(os.path.join(libdir, 'python')), + ] + + appdir = os.getenv('APPDIR') + if appdir: + modpaths.extend([ + os.path.join(appdir, 'usr', 'lib', 'zoitechat', 'python'), + os.path.join(appdir, 'usr', 'lib', 'x86_64-linux-gnu', 'zoitechat', 'python'), + ]) + + for modpath in modpaths: + if os.path.isdir(modpath) and modpath not in sys.path: + sys.path.append(modpath) + zoitechat = importlib.import_module('zoitechat') except (UnicodeDecodeError, ImportError) as e: From d379bb138cdbf1100f2c5bf64d45d0def8a768c1 Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 11:42:49 -0700 Subject: [PATCH 08/10] Added Flatpak-specific Python module search paths in plugin init: when FLATPAK_ID is present, the loader now also probes /app/lib/zoitechat/python and /app/lib/x86_64-linux-gnu/zoitechat/python before importing zoitechat. Kept the existing safe behavior intact: paths are only added if they exist and are not already in sys.path, so this broadens compatibility without duplicating entries. --- plugins/python/python.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/python/python.py b/plugins/python/python.py index 93c56040..b8767a8e 100644 --- a/plugins/python/python.py +++ b/plugins/python/python.py @@ -550,6 +550,12 @@ def _on_plugin_init(plugin_name, plugin_desc, plugin_version, arg, libdir): os.path.join(appdir, 'usr', 'lib', 'x86_64-linux-gnu', 'zoitechat', 'python'), ]) + if os.getenv('FLATPAK_ID'): + modpaths.extend([ + '/app/lib/zoitechat/python', + '/app/lib/x86_64-linux-gnu/zoitechat/python', + ]) + for modpath in modpaths: if os.path.isdir(modpath) and modpath not in sys.path: sys.path.append(modpath) From 6c699ac07b8e3d00ea503e1f777a7b7b8927324c Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 11:55:49 -0700 Subject: [PATCH 09/10] Added a Flatpak-specific guard in proxy auto-detection to skip g_proxy_resolver_lookup() when running inside Flatpak (/.flatpak-info present), preventing the Connect flow from appearing to freeze in sandbox environments with missing proxy backends. This still preserves normal behavior for explicit manual proxy settings. --- src/common/server.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common/server.c b/src/common/server.c index aa5b8ff4..38759d7c 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -1447,6 +1447,16 @@ server_child (server * serv) GProxyResolver *resolver; GError *error = NULL; + /* + * In Flatpak, auto proxy resolution may block indefinitely when + * proxy backends are unavailable in the sandbox. If this happens, + * the connection attempt appears to hang after pressing Connect. + * Prefer direct connections there unless the user configured a + * specific proxy manually. + */ + if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS)) + goto proxy_lookup_done; + resolver = g_proxy_resolver_get_default (); url = g_strdup_printf ("irc://%s:%d", hostname, port); proxy_list = g_proxy_resolver_lookup (resolver, url, NULL, &error); @@ -1477,6 +1487,8 @@ server_child (server * serv) g_strfreev (proxy_list); g_free (url); + + proxy_lookup_done:; } if (prefs.hex_net_proxy_host[0] && From 1b1855b14e9fc233ca9123fbc6edb532c7bb00e3 Mon Sep 17 00:00:00 2001 From: deepend Date: Sun, 22 Feb 2026 12:03:32 -0700 Subject: [PATCH 10/10] temporarily disable broken python implementation --- flatpak/net.zoite.Zoitechat.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flatpak/net.zoite.Zoitechat.json b/flatpak/net.zoite.Zoitechat.json index 5e3a8cfb..b7436edd 100644 --- a/flatpak/net.zoite.Zoitechat.json +++ b/flatpak/net.zoite.Zoitechat.json @@ -7,7 +7,6 @@ "command": "zoitechat", "finish-args": [ "--share=ipc", - "--env=GDK_BACKEND=wayland,x11", "--socket=wayland", "--socket=fallback-x11", "--share=network", @@ -60,7 +59,7 @@ "-Dgtk3=true", "-Ddbus-service-use-appid=true", "-Dwith-perl=false", - "-Dwith-python=python3", + "-Dwith-python=false", "-Dwith-lua=lua" ], "build-options": {