Repository navigation
Files - #3
Merged
Merged
Files#3
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.
Implements AppRuntime's
Filescontract (Files.md) on Linux: the app's own directories, and the files in its bundle.How
AppRuntime's
RuntimeHostalready hasHostFiles, the whole contract over POSIX calls.LinuxFiles, inLinuxHost, decides where the app's directories are, configuresHostFilesto answer on the host's main loop (MainLoop.post, from its queue), and registers it.LINUXAPPRUNTIME_CONTAINERsetdocuments<container>/Documents$XDG_DATA_HOME/<id>/Documentsdata<container>/Data$XDG_DATA_HOME/<id>/Datacaches<container>/Caches$XDG_CACHE_HOME/<id>temporary<container>/tmp$XDG_RUNTIME_DIR/<id>, or/tmp/<id>-<uid>bundleresources/<id>is the bundle identifier. It must name a single directory.XDG_DATA_HOMEandXDG_CACHE_HOMEfall back to~/.local/shareand~/.cachewhen unset or relative, as the spec says.temporaryis always the app's own, sinceHostFilesempties it at every start.HOME, a bad identifier, a relative container), the host logs why, and every operation fails through its callback.LINUXAPPRUNTIME_CONTAINER="$GAMEDIR/conf", where ports keep what's theirs.Tested
On Debian 13 in Docker, all suites pass.
LinuxFilesTests, 5 tests:MainLoop.shared: a bundle read, a replace and an append, list, attributes, a copy out of the bundle, a write to the bundle refused (readOnly), and a path that escapes refused (invalidPath).End to end: AppRuntime's
ExampleFileswas built as alinux-arm64slice with awelcome.txtresource. It ran inlinux-app-hostwith a container holding two notes, and the screenshot above is the result: the welcome text from the bundle, and the notes listed fromdocuments/notes.Not in this PR
Defaults, which AppRuntime added next to it (HostDefaults,FileDefaultsStorage). It can go in the sameDatadirectory./data(AppRuntime's §7.8). Such a launcher would pass that path as the container.