Repository navigation
perf(lite): ship 22 of the 98 rootfs libraries in the native package - #21
Conversation
The wrapper-lite-linux-x86_64 package carried all 98 libraries of rootfs/system/lib64 (119 MiB unpacked), most of them Android UI, graphics, audio and media frameworks that the Apple libraries list in DT_NEEDED and a headless service never calls. tools/slim-rootfs.py, run on the packaged copy only, keeps the 22 libraries lite loads and rewrites seven DT_NEEDED entries (libCoreFoundation, libandroidappmusic, libdaapkit, libmedialibrarycore, libmediaplatform, libstoreservicescore -> libandroid / libOpenSLES) to name libc.so again, so the loader skips them. rootfs/ stays whole: lite links against it, and the QEMU assets and the Docker image copy it. libCoreADI.so stays although nothing imports from it: libCoreFP and libstoreservicescore find its exports with dlsym, and without it every request fails to build its anisette headers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: LYJW131 <153256373+LYJW131@users.noreply.github.com>
| freed = 0 | ||
| for n in removed: | ||
| p = os.path.join(lib, n) | ||
| freed += os.path.getsize(p) | ||
| os.unlink(p) |
There was a problem hiding this comment.
🟡 Existing installations retain 76 obsolete libraries
When an installed manager updates, slim-rootfs.py removes libraries only from the downloaded package. extractZip overwrites existing files without removing them, leaving all 76 obsolete libraries on disk.
Learn more
The manager installs the native artifact by extracting its zip over the existing payload in installWrapperLite. extractZip only creates or overwrites files, so deleting libraries from the new zip cannot remove copies installed by an earlier build. A manager upgrading from the full payload therefore retains the old libraries and their disk usage, even though the new archive contains only 22.
Example: A manager already has 98 files under rootfs/system/lib64. It downloads the new 22-library artifact and extracts it into the same directory; the other 76 files remain there.
Recommended fix: Make the manager's payload upgrade prune obsolete library files after extracting a validated artifact, or atomically replace the rootfs/system subtree while preserving account data under rootfs/data.
Was this helpful? React with 👍 or 👎 to provide feedback.
| # The package keeps only the libraries wrapper-lite loads. rootfs/ | ||
| # stays whole: lite links against it, and the QEMU assets and the | ||
| # Docker image copy it. | ||
| python3 tools/slim-rootfs.py dist-native/rootfs |
There was a problem hiding this comment.
|
Both points are right and neither blocks the merge.
|
…s 98 libraries The payload the guest's manager installs drops from 50.1 MB to 30.6 MB zipped, and from 119 MiB to 66 MiB unpacked (AMDL-Web/wrapper#21). Run on a copy of a logged-in account beside the previous payload, it gave the same /m3u8, /lyrics and /webplayback answers, keys for ALAC, Atmos, AAC-LC and HE-AAC that decrypt, and album and song downloads whose audio streams hash the same. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: LYJW131 <153256373+LYJW131@users.noreply.github.com>
The
wrapper-lite-linux-x86_64package carries every library ofrootfs/system/lib64: 98 files, 119 MiB unpacked, 50 MB zipped. Most are Android UI, graphics, audio and media frameworks that the Apple libraries list in DT_NEEDED and a headless service never calls.tools/slim-rootfs.pyruns on the packaged copy in build-lite's "Package native release" step. It keeps the 22 libraries lite loads and removes the other 76. It rewrites seven DT_NEEDED entries (libCoreFoundation, libandroidappmusic x2, libdaapkit, libmedialibrarycore, libmediaplatform, libstoreservicescore) so they name libc.so again; the loader then skips them. It fails the build if a kept library still lists a removed one, or if a kept library is not reachable fromlite.Why at packaging, not in
rootfs/.litelinks againstrootfs/, and the QEMU assets and the Docker image copy it. This change touches only the native package, which is what amdl installs into its guest. The other two keep the whole set until they are checked the same way.How the set differs from the fpkeyd minimal runtime. It adds
libCoreADI.soand dropslibc++.so. Nothing imports from libCoreADI, butlibCoreFP.soandlibstoreservicescore.sofind its exports (cvu8io98wun,vdfut768ig) with dlsym. Without it every request fails to build its anisette headers (ADISetProvisioningPath failed: -45075) and/m3u8and the token refresh fail. No kept library listslibc++.so, and it is never loaded.Tested on rog against a copy of a logged-in cn account, the old and the slim payload side by side:
/status,/tokenand its background refresh work./m3u8and/webplaybackreturn the same URLs,/lyricsthe same bytes,/licensethe same error./keyworks for the ALAC, Atmos, AAC-LC and HE-AAC variants of a song.--loginruns the same AuthenticateFlow round trip on both.