Repository navigation
apk: assemble owns the app folder; leftovers of older builds are removed and excluded - #2109
Merged
Merged
Conversation
…s are removed The app folder is reused between builds, and assemble.py removed only source copies of recipe-built packages, so a package that left the closure (watchdog) and an earlier layout's folder (deployment/, recipes and jars from 16 Nov) kept shipping: buildozer packs every file under the folder whose extension it includes, and the spec excluded nothing. app_folder.py declares every entry the folder holds besides the closure, with who writes it and whether the APK ships it. assemble.py removes every entry that is neither the closure's nor declared (and the top-level bytecode folder, which it compiles afresh), then fails if the laid-out folder holds anything else. buildozer.spec's source.exclude_dirs and source.exclude_patterns are the declared entries that do not ship. bundle_check reads the shipped packages as the entries not declared. check.sh plants an older build's leftovers (a departed package, module and its bytecode, a stale layout folder) before assembling and fails if any survives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
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.
The APK build on main (c4e25bd), run in the shared app folder, failed the bytecode check: 30 modules under
watchdog/had no.opt-1.pyc. watchdog had left the import closure, but its folder from an older build was still in the app folder.assemble.pyonly removed stale copies of recipe-built packages, andbuildozer.specexcluded nothing, so any package that dropped out of the closure kept shipping as stale source. The same was true of the 16 Novdeployment/folder.The fix:
tools/android/app_folder.pydeclares, in one place, every entry the folder holds besides the closure. For each entry it records who writes it and whether the APK ships it:main.py,profile.json,cacert.pem,wal,__pycache__;jar,buildozer.spec,keepalive.aar,closure.json,.build.lock,build.log,.buildozer,bin,toadcomms-*.apk.assemble.pynow:__pycache__, which it recompiles;buildozer.spec.in:source.exclude_dirs(jar, .buildozer, bin) andsource.exclude_patternsare filled from the declared build-only entries. This keepsclosure.jsonout of the APK; it used to ship because buildozer includes.jsonfiles.bundle_check.pytreats every entry not declared as a shipped package.check.shplants an older build's leftovers before assembling: a package and a module that left the closure, the module's bytecode, and adeployment/recipes/…/__init__.py. It fails if any of them survives.Proof, from the full
tools/android/check.shrun once on this head:state/andpysidedeploy.spec, awatchdog/package, ashiboken6/source copy, and the build's own.buildozer/,build.log,.build.lockand APK.deployment,left_closure_module.py,left_closure_package,pysidedeploy.spec,shiboken6,state,watchdogand__pycache__, then printed "assemble removed every planted leftover"..buildozer/andbuild.logwere kept.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3