Repository navigation
One runner that loads an app's libapp.so - #8
Open
colemancda wants to merge 36 commits into
Open
colemancda wants to merge 36 commits into
colemancda wants to merge 36 commits into
Conversation
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.
linux-app-hostbecomes the one program every app runs in. It loads the app'slibapp.sofrom its bundle (AppRuntime'sDynamicRuntime.md§7.5, §7.6) and links no app. Installing an app now copies files: no SwiftPM, compiler or linker on the device. The runner and the OS can update on their own while the app's ABI stays put.The runner (
LinuxHostApp,LinuxHost'sAppLibraryandInstalledApps)linux-app-host [--bundle] App.app | IDENTIFIER [[--open] URL]. An identifier is found at<prefix>/lib/linux-app/<id>.appin~/.local, the runner's own prefix,/usr/localand/usr(LINUXAPPRUNTIME_PREFIXESreplaces the list). With no argument it usesApp.appnext to the executable, as a PortMaster port has it.rt.hthrough a dynamic list (Sources/LinuxAppHost/exports.list), which keeps the functions though nothing in the runner calls them.nm -Dshows all 13 functions RuntimeNative defines, plusrt_gl_context_generation.lib/<target>/libapp.soagainst_CodeSignature/CodeResources. The file is opened once, hashed, and loaded through/proc/self/fd, so the bytes checked are the bytes loaded.libGLESv2.so.2into the global scope first for an app whose contracts includeSurface.dlopenbinds every symbol as the library loads, so a symbol the runner lacks refuses the app, by name.PR_SET_NAME,CFBundleExecutable), sopsshowsExampleModeland notlinux-app-host.CLinuxHostdefines and exportsarc4random_bufwhere libc lacks it: musl, and glibc before 2.36.The packager
installandpackagevalidate, then thin the bundle toInfo.plist,resources/, the icon,_CodeSignature/and the target'slibapp.so, atlib/linux-app/<id>.app. They write a desktop entry withExec=<runner> <id> %u. Nothing is built; the generated per-app host package is gone.runchecks a bundle and runs it in the runner as it is.--runner,LINUXAPPRUNTIME_RUNNER, besidelinux-app, orPATH.libapp.a.PortMaster ports carry the runner, built once per architecture and named after the app, beside
App.appthinned tolib/linux-arm64/libapp.soandlib/linux-armv7/libapp.so. Nothing in this repository linkslibapp.anow.Tests, all passing on Debian 13 in Docker:
AppLibraryTestscompiles libraries with the toolchain's clang into signed bundles. It checks that they load and their exports are called, and that they're refused when unsigned, changed, or unlisted. It checks that a missing symbol is named, and that a missing preload fails.libapp.so, and ports carrying each architecture's library.End to end on Debian 13 (arm64), with bundles from AppRuntime master's
guest.py:ExampleUIandExampleGLran from their bundles.ExampleGLdrew its triangle with GLES preloaded.ExampleModelwas installed withlinux-app install, launched by its identifier, and refused once its library was changed after install.Not verified:
arc4random_bufcondition changed;