Bump to 4.3.1: Android x86_64 empty sitepackages.zip fix#229
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
flet build apk --arch x86_64(any--archsubset not includingarm64-v8a) produced an APK with an emptysitepackages.zip: the app shipped with no Python site-packages at all, and the bootstrap's very first dependency import (e.g.import certifi) failed at startup. Reported against flet 0.86.0.dev2 / serious_python 4.3.0.Root cause
Since the 4.3.0 native-mmap packaging, the pure-code zips (
sitepackages.zip/extract.zip) are ABI-common assets built once from a "primary" ABI, hardcoded asabis.first()frompython_versions.properties— alwaysarm64-v8a. With--arch x86_64, flet stages onlybuild/site-packages/x86_64/; the primary split task then walks the nonexistentarm64-v8a/dir (Kotlin'swalkTopDown()on a missing root yields nothing) and silently writes a valid-but-empty stored zip. The default build worked only because it happens to stagearm64-v8a.Fix
primaryAbiis now the first manifest ABI whose per-ABI tree actually exists underSERIOUS_PYTHON_SITE_PACKAGES. If none is staged — legitimate when packaging with no requirements (the package command skips staging entirely, so this must not be an error) — fall back toabis.first(), whose empty walk correctly yields empty zips, and logsitepackages.zip will be emptyso that state is visible in the build log instead of silent.No flet-cli change needed: Gradle infers the staged ABI set on its own.
Verification
Reproduced the failing scenario locally with
run_example:dart run serious_python:main package app/src -p Android --arch x86_64 ...→ onlybuild/site-packages/x86_64/staged (noarm64-v8a/).flutter build apk --debug --target-platform android-x64→ before the fix this produced a ~22-bytesitepackages.zip; after the fix it's 25 MB, containingnumpy,jnius,lru+ dist-infos, with 21.sorefmarkers resolving to 83 relocated native libs inlib/x86_64/.Release
Standard aligned bump of all six packages to 4.3.1; only
serious_python_androidhas a substantive change, the rest are alignment-only CHANGELOG entries. Prepared per the release process — not tagged/published.