From 382d8ec8bd9b2f4ff3c5945912122bbd8cf424b7 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Fri, 10 Jul 2026 12:12:31 -0700 Subject: [PATCH 1/2] Bump to 4.3.1: Android empty sitepackages.zip fix for --arch subsets The substantive change is in serious_python_android: the ABI-common sitepackages.zip / extract.zip assets were built from a hardcoded primary ABI (abis.first() = arm64-v8a). When `flet build apk --arch x86_64` staged only x86_64 site-packages, the primary split task walked a nonexistent directory and silently shipped a valid-but-empty sitepackages.zip - the app had no Python dependencies and the first import failed at startup. The primary ABI is now the first manifest ABI whose site-packages tree was actually staged under SERIOUS_PYTHON_SITE_PACKAGES. If none is staged (legitimate when packaging with no requirements), fall back to abis.first() and log a warning instead of staying silent. All other packages are alignment-only bumps. --- src/serious_python/CHANGELOG.md | 4 ++++ src/serious_python/pubspec.yaml | 2 +- src/serious_python_android/CHANGELOG.md | 4 ++++ .../android/build.gradle.kts | 15 +++++++++++++-- src/serious_python_android/pubspec.yaml | 2 +- src/serious_python_darwin/CHANGELOG.md | 4 ++++ .../darwin/serious_python_darwin.podspec | 2 +- src/serious_python_darwin/pubspec.yaml | 2 +- src/serious_python_linux/CHANGELOG.md | 4 ++++ src/serious_python_linux/pubspec.yaml | 2 +- .../CHANGELOG.md | 4 ++++ .../pubspec.yaml | 2 +- src/serious_python_windows/CHANGELOG.md | 4 ++++ src/serious_python_windows/pubspec.yaml | 2 +- 14 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/serious_python/CHANGELOG.md b/src/serious_python/CHANGELOG.md index 2fb1b29b..aae0e32d 100644 --- a/src/serious_python/CHANGELOG.md +++ b/src/serious_python/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.3.1 + +* **Android:** fix `flet build apk --arch x86_64` (or any `--arch` subset not including `arm64-v8a`) producing an APK with an **empty `sitepackages.zip`** — the app shipped without its Python dependencies and the first import failed at startup. See `serious_python_android` 4.3.1. + ## 4.3.0 * **Desktop multiprocessing support** ([flet-dev/flet#4283](https://github.com/flet-dev/flet/issues/4283)). `dart_bridge` **1.5.0** adds `serious_python_is_mp_invocation` / `serious_python_main` (+ `_w` wide-char variants on Windows): host apps call them first thing in `main` to detect CPython child command lines (`--multiprocessing-fork`, `-c "from multiprocessing..."` — spawn workers, the resource tracker, and the forkserver) and service them as a plain headless interpreter (`Py_Main`/`Py_BytesMain`, stable ABI) instead of re-launching the GUI. The exports rely on the `PYTHONHOME`/`PYTHONPATH` the parent already stamped process-wide. diff --git a/src/serious_python/pubspec.yaml b/src/serious_python/pubspec.yaml index f52a7446..a34790c5 100644 --- a/src/serious_python/pubspec.yaml +++ b/src/serious_python/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.3.0 +version: 4.3.1 platforms: ios: diff --git a/src/serious_python_android/CHANGELOG.md b/src/serious_python_android/CHANGELOG.md index c44e2a94..37890e5b 100644 --- a/src/serious_python_android/CHANGELOG.md +++ b/src/serious_python_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.3.1 + +* Fix `flet build apk --arch ` shipping an **empty `sitepackages.zip`** whenever the selected ABI subset didn't include `arm64-v8a` (e.g. `--arch x86_64`) — the app bundled no Python site-packages at all and the very first dependency import failed at startup. The ABI-common pure-code zips (`sitepackages.zip` / `extract.zip`) were built from a hardcoded primary ABI (`abis.first()`, i.e. `arm64-v8a`); when only other ABIs were staged under `SERIOUS_PYTHON_SITE_PACKAGES`, the primary split task walked a nonexistent directory and silently produced a valid-but-empty zip. The primary ABI is now the first manifest ABI whose site-packages tree was actually staged. If none is staged at all (legitimate when packaging with no requirements), the build falls back to `abis.first()` and logs `sitepackages.zip will be empty` instead of staying silent. + ## 4.3.0 * `PYTHONINSPECT=1` is no longer set by any platform implementation. It had no effect on the embedded interpreter, but it leaked into the process environment where any *real* interpreter child (e.g. a serviced multiprocessing worker) would inherit it and hang in interactive mode after its command completed. No functional change on Android, which doesn't support process spawning. diff --git a/src/serious_python_android/android/build.gradle.kts b/src/serious_python_android/android/build.gradle.kts index 4cd78028..21d0e145 100644 --- a/src/serious_python_android/android/build.gradle.kts +++ b/src/serious_python_android/android/build.gradle.kts @@ -21,7 +21,7 @@ buildscript { } group = "com.flet.serious_python_android" -version = "4.3.0" +version = "4.3.1" rootProject.allprojects { repositories { @@ -136,7 +136,18 @@ val extractGlobs: List = extractPackages.filter { '*' in it || '?' in it }.map(::globToRegex) val extractPlain: List = extractPackages.filter { '*' !in it && '?' !in it } -val primaryAbi = abis.first() // pure zips are ABI-common: build once +// Pure zips are ABI-common: build once, from the first ABI whose site-packages +// tree was actually staged — `flet build --arch` may stage a subset of the ABIs +// (e.g. only x86_64), and a hardcoded abis.first() would then walk a missing +// dir and silently ship an EMPTY sitepackages.zip. No staged dir at all is +// legitimate (packaged with no requirements): fall back to abis.first(), whose +// empty walk correctly yields empty zips. +val primaryAbi = abis.firstOrNull { siteSrcDir != null && File(siteSrcDir, it).isDirectory } + ?: abis.first().also { + logger.lifecycle( + "serious_python: no staged site-packages under $siteSrcDir; " + + "sitepackages.zip will be empty") + } val assetsDir = file("src/main/assets") val bootstrapPy = file("../python/_sp_bootstrap.py") diff --git a/src/serious_python_android/pubspec.yaml b/src/serious_python_android/pubspec.yaml index c48b46c4..37bfcacf 100644 --- a/src/serious_python_android/pubspec.yaml +++ b/src/serious_python_android/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_android description: Android implementation of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.3.0 +version: 4.3.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_darwin/CHANGELOG.md b/src/serious_python_darwin/CHANGELOG.md index 8b2f210a..86323d2c 100644 --- a/src/serious_python_darwin/CHANGELOG.md +++ b/src/serious_python_darwin/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.3.1 + +* Version bump aligning with the `serious_python_*` 4.3.1 release. + ## 4.3.0 * Bump `dart_bridge` to **1.5.0** (python-build snapshot `20260708`): multiprocessing child-interception exports (`serious_python_is_mp_invocation` / `serious_python_main`), kept alive against the host link's `-dead_strip` both by `__attribute__((used))` in the archive and by keep-alive references in `SeriousPythonPlugin.swift`. See the `serious_python` 4.3.0 notes. diff --git a/src/serious_python_darwin/darwin/serious_python_darwin.podspec b/src/serious_python_darwin/darwin/serious_python_darwin.podspec index 23ba9d65..9c21def5 100644 --- a/src/serious_python_darwin/darwin/serious_python_darwin.podspec +++ b/src/serious_python_darwin/darwin/serious_python_darwin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'serious_python_darwin' - s.version = '4.3.0' + s.version = '4.3.1' s.summary = 'A cross-platform plugin for adding embedded Python runtime to your Flutter apps.' s.description = <<-DESC A cross-platform plugin for adding embedded Python runtime to your Flutter apps. diff --git a/src/serious_python_darwin/pubspec.yaml b/src/serious_python_darwin/pubspec.yaml index 3cf73ade..455378dc 100644 --- a/src/serious_python_darwin/pubspec.yaml +++ b/src/serious_python_darwin/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_darwin description: iOS and macOS implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.3.0 +version: 4.3.1 environment: # The Swift Package Manager build path needs Flutter 3.44 / Dart 3.11 (the diff --git a/src/serious_python_linux/CHANGELOG.md b/src/serious_python_linux/CHANGELOG.md index 6e38240e..62da2a71 100644 --- a/src/serious_python_linux/CHANGELOG.md +++ b/src/serious_python_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.3.1 + +* Version bump aligning with the `serious_python_*` 4.3.1 release. + ## 4.3.0 * Bump `dart_bridge` to **1.5.0** (python-build snapshot `20260708`): multiprocessing child-interception exports (`serious_python_is_mp_invocation` / `serious_python_main`), consumed by the flet build template's `main.cc` via `dlopen("libdart_bridge.so")`. Relevant on Linux since Python 3.14 made `forkserver` (which execs `sys.executable`) the default start method. See the `serious_python` 4.3.0 notes. diff --git a/src/serious_python_linux/pubspec.yaml b/src/serious_python_linux/pubspec.yaml index 5936b96c..40763c34 100644 --- a/src/serious_python_linux/pubspec.yaml +++ b/src/serious_python_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_linux description: Linux implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.3.0 +version: 4.3.1 environment: sdk: '>=3.1.3 <4.0.0' diff --git a/src/serious_python_platform_interface/CHANGELOG.md b/src/serious_python_platform_interface/CHANGELOG.md index 03fa108b..142b4c3c 100644 --- a/src/serious_python_platform_interface/CHANGELOG.md +++ b/src/serious_python_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.3.1 + +* Version bump aligning with the `serious_python_*` 4.3.1 release. + ## 4.3.0 * Version bump aligning with the `serious_python_*` 4.3.0 release. diff --git a/src/serious_python_platform_interface/pubspec.yaml b/src/serious_python_platform_interface/pubspec.yaml index 65a0069d..5abda345 100644 --- a/src/serious_python_platform_interface/pubspec.yaml +++ b/src/serious_python_platform_interface/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_platform_interface description: A common platform interface for the serious_python plugin. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.3.0 +version: 4.3.1 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_windows/CHANGELOG.md b/src/serious_python_windows/CHANGELOG.md index 266185f2..92a1d9fd 100644 --- a/src/serious_python_windows/CHANGELOG.md +++ b/src/serious_python_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.3.1 + +* Version bump aligning with the `serious_python_*` 4.3.1 release. + ## 4.3.0 * Bump `dart_bridge` to **1.5.0** (python-build snapshot `20260708`): multiprocessing child-interception exports, including the Windows wide-char variants `serious_python_is_mp_invocation_w` / `serious_python_main_w` (→ `Py_Main`) consumed by the flet build template's `wWinMain`. See the `serious_python` 4.3.0 notes. diff --git a/src/serious_python_windows/pubspec.yaml b/src/serious_python_windows/pubspec.yaml index ea5bdb28..55a51aa5 100644 --- a/src/serious_python_windows/pubspec.yaml +++ b/src/serious_python_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_windows description: Windows implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.3.0 +version: 4.3.1 environment: sdk: '>=3.1.3 <4.0.0' From b6a15e4a2e077b4a1a00b8a69c552421abd26228 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Sat, 11 Jul 2026 00:57:16 +0200 Subject: [PATCH 2/2] Update CI condition to handle workflow cancellation --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd7cd2f2..64512d60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -612,7 +612,7 @@ jobs: needs: - publish runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/v') }} + if: ${{ !cancelled() && needs.publish.result == 'success' && startsWith(github.ref, 'refs/tags/v') }} permissions: contents: write steps: