Skip to content

Commit dd67d0f

Browse files
Bump to 4.3.1: Android x86_64 empty sitepackages.zip fix (#229)
* 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. * Update CI condition to handle workflow cancellation --------- Co-authored-by: ndonkoHenri <robotcoder4@protonmail.com>
1 parent 8f326f8 commit dd67d0f

15 files changed

Lines changed: 45 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ jobs:
612612
needs:
613613
- publish
614614
runs-on: ubuntu-latest
615-
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
615+
if: ${{ !cancelled() && needs.publish.result == 'success' && startsWith(github.ref, 'refs/tags/v') }}
616616
permissions:
617617
contents: write
618618
steps:

src/serious_python/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.3.1
2+
3+
* **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+
15
## 4.3.0
26

37
* **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.

src/serious_python/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: serious_python
22
description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps.
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/serious-python
5-
version: 4.3.0
5+
version: 4.3.1
66

77
platforms:
88
ios:

src/serious_python_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.3.1
2+
3+
* Fix `flet build apk --arch <abi>` 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+
15
## 4.3.0
26

37
* `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.

src/serious_python_android/android/build.gradle.kts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
}
2222

2323
group = "com.flet.serious_python_android"
24-
version = "4.3.0"
24+
version = "4.3.1"
2525

2626
rootProject.allprojects {
2727
repositories {
@@ -136,7 +136,18 @@ val extractGlobs: List<Regex> =
136136
extractPackages.filter { '*' in it || '?' in it }.map(::globToRegex)
137137
val extractPlain: List<String> =
138138
extractPackages.filter { '*' !in it && '?' !in it }
139-
val primaryAbi = abis.first() // pure zips are ABI-common: build once
139+
// Pure zips are ABI-common: build once, from the first ABI whose site-packages
140+
// tree was actually staged — `flet build --arch` may stage a subset of the ABIs
141+
// (e.g. only x86_64), and a hardcoded abis.first() would then walk a missing
142+
// dir and silently ship an EMPTY sitepackages.zip. No staged dir at all is
143+
// legitimate (packaged with no requirements): fall back to abis.first(), whose
144+
// empty walk correctly yields empty zips.
145+
val primaryAbi = abis.firstOrNull { siteSrcDir != null && File(siteSrcDir, it).isDirectory }
146+
?: abis.first().also {
147+
logger.lifecycle(
148+
"serious_python: no staged site-packages under $siteSrcDir; " +
149+
"sitepackages.zip will be empty")
150+
}
140151
val assetsDir = file("src/main/assets")
141152
val bootstrapPy = file("../python/_sp_bootstrap.py")
142153

src/serious_python_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: serious_python_android
22
description: Android implementation of the serious_python plugin
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/serious-python
5-
version: 4.3.0
5+
version: 4.3.1
66

77
environment:
88
sdk: ">=3.0.0 <4.0.0"

src/serious_python_darwin/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.3.1
2+
3+
* Version bump aligning with the `serious_python_*` 4.3.1 release.
4+
15
## 4.3.0
26

37
* 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.

src/serious_python_darwin/darwin/serious_python_darwin.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'serious_python_darwin'
7-
s.version = '4.3.0'
7+
s.version = '4.3.1'
88
s.summary = 'A cross-platform plugin for adding embedded Python runtime to your Flutter apps.'
99
s.description = <<-DESC
1010
A cross-platform plugin for adding embedded Python runtime to your Flutter apps.

src/serious_python_darwin/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: serious_python_darwin
22
description: iOS and macOS implementations of the serious_python plugin
33
homepage: https://flet.dev
44
repository: https://github.com/flet-dev/serious-python
5-
version: 4.3.0
5+
version: 4.3.1
66

77
environment:
88
# The Swift Package Manager build path needs Flutter 3.44 / Dart 3.11 (the

src/serious_python_linux/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.3.1
2+
3+
* Version bump aligning with the `serious_python_*` 4.3.1 release.
4+
15
## 4.3.0
26

37
* 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.

0 commit comments

Comments
 (0)