0.9.3: dist-apk carries the graph's shared libraries, and the manifest template gains the version tokens - #23
Merged
Conversation
…t template gains the version tokens
Two things an application whose framework is a separate `lib<fw>.so`
on Android (the shape Gradle builds) hits against 0.9.2.
The graph's shared libraries never reached the APK. A dependency declared
`linkage = "shared"` is linked as `lib<dep>.so` beside the app's object
in the ordinary build's `bin/` and NEEDed by name; the engine stages the
app's own object and the deployed files, but the closure on this row is
`not-walked` (a host cannot run an Android artifact), so `lib/` carried
the app and `libc++_shared.so` only, and the APK installed and died at
`dlopen`. `apk:needed` now walks NEEDED from the app's own object at
command time -- the set is not knowable at plan time without the
closure -- and copies every name that exists beside the object,
recursively, into `lib/<abi>/`; platform libraries live nowhere beside
it and are skipped.
The manifest template gains `{{version_name}}` (the package version as
written) and `{{version_code}}` (major * 1000000 + minor * 1000 +
patch over the leading numeric segments, 1 when none parses), so a
template can carry `android:versionName` / `android:versionCode`
without a second spelling of the version. The built-in default stays
byte-identical to 0.8.0's.
`tests/apk-consumer-shared` (a path dependency shared on the Android
row; the APK lists `lib/x86_64/libapk-consumer-dep.so`) and criterion
(h) of `tests/apk-consumer` (versionName 0.3.0, versionCode 3000).
Both measured locally with mcpp 2026.9.13.2; (a) to (g) unchanged.
Sunrisepeak
deleted the
fix/apk-needed-shared-libs-and-version-tokens
branch
September 13, 2026 17:34
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.
Two things an application whose framework is a separate
lib<fw>.soon Android — the shape Gradle builds, and the shape a Java host that callsSystem.loadLibrary("<fw>")requires — hits against 0.9.2.The graph's shared libraries never reached the APK
A dependency declared
linkage = "shared"in the root's Android row is linked aslib<dep>.sobeside the app's object in the ordinary build'sbin/, and the app's dynamic section NEEDs it by name. The engine stages the app's own object and the deployed files (2026.9.13.2, #630 3a), but the closure on this row isnot-walked— a host cannot run an Android artifact — solib/carried the app andlibc++_shared.soonly, and the APK installed and died atdlopen(measured with HuxerUI's framework as a shared library:NEEDED libhuxerui.so, 100 MB dev, absent from the archive).apk:neededwalks NEEDED from${mcpp.target_file:<app>}at command time (llvm-readelf -dfrom the toolchain that linked it, the same readerneeds_libcxx_shareduses) and copies every name that exists beside the object, recursively, intolib/<abi>/. Platform libraries (libandroid.so,libc.so) live nowhere beside it and are skipped;libc++_shared.sostays the plan-time copy. The engine's side of this — a declared, graph-built shared library is not a closure discovery and could be staged before the walk, as deployed files are — is worth an mcpp note; this member does not need it.{{version_name}}/{{version_code}}The manifest template gains the two tokens: the package version as written, and Android's integer as
major * 1000000 + minor * 1000 + patchover the leading numeric segments (1 when none parses; Android refuses 0). A template can now carryandroid:versionName/android:versionCodewithout a second spelling of the version. The built-in default stays byte-identical to 0.8.0's (criterion (a)).Tests
tests/apk-consumer-shared: an app with a path dependency declaredlinkage = "shared"on the Android row; the APK listslib/x86_64/libapk-consumer-dep.sobeside the app's own object. New CI step.tests/apk-consumercriterion (h): a template with both tokens;aapt2 dump badgingreportsversionName='0.3.0',versionCode='3000'..so.Version 0.9.3.