Entry 618

piney-apples: the launcher, the builder and the game in one portable program

Files35 in 13 directories
Cargo.lockREADME.mddeny.tomlcrates/piney-build/src/lib.rsmain.rsbuild.rsdisc.rsstamp.rscrates/piney-data/src/iso.rslib.rspack.rsstore.rsvolume.rshome.rscrates/piney-game/Cargo.tomlcrates/piney-game/src/launcher.rslib.rssettings.rsmain.rsdocs/README.mdplans/release.mdtools/docs.py.github/workflows/launcher.ymlrelease.ymlcrates/piney-launcher/Cargo.tomlcrates/piney-launcher/src/main.rsapp.rsjob.rslibrary.rslogs.rsoptions.rsreport.rstheme.rscrates/piney-launcher/assets/fonts/OFL.txtdocs/port/launcher.md

Mentioned inplans/release.md:99

After 617, players still met the port as a Rust project. They had to install a toolchain, run cargo build, then piney-build with their ISO paths, then piney-game. plans/release.md item 5 asked for a builder anyone can use. It is now piney-apples (crates/piney-launcher): one GPUI executable that holds the launcher, the builder and the game, and keeps everything it makes in piney-apples-data beside itself. The reference is docs/port/launcher.md.

The entry points. piney-game's main.rs became lib.rs. Its body is piney_game::run(args) -> ExitCode, and its eighteen process::exit calls became returns of the same codes. The new main.rs passes std::env::args().skip(1) to it, so every flag behaves as before. The library keeps doctest = false, since the docs were never doc tests. settings is public, because the Settings page edits settings.toml through it. piney-build's run, Pak, add_disc and verify_disc moved into piney_build::build. They report through a Report trait: say takes each line piney-build printed before, progress takes a disc, a step (files, port data, verify) and done/total, and cancelled is checked per chunk. The CLI's Report is println!. On Infection, the old and new piney-build gave byte-identical chunks.pak and infection.disc and the same account, apart from the timings. The new one also writes stamp.txt.

One path resolver. piney_data::home replaces pack::home, pack::default_build and pack::image_data_dir. It resolves the portable folder set by use_portable first, then $PINEY_HOME, then the platform's folder. Places names each place in it. piney-apples sets the portable folder before anything runs, in game mode too. piney-game and piney-build never set it, so their paths are unchanged.

Disc verdicts. piney_build::disc::identify checks five things in order: the ISO 9660 descriptor at sector 16; the image's length against volume space size times block size; SYSTEM.CNF's BOOT2; for the four NTSC-U boot files, GCMN.PRG through Volume::detect; and for other regions, DATA/DATA.BIN plus a DATA/GCMN*.PRG. The fragment disc's own SYSTEM.CNF gives BOOT2 = cdrom0:\SLPS_255.27;1, and its DATA/ holds GCMNF/GCMNO/GCMNT.PRG. The four discs under work/ name themselves. A sparse full-length copy of fragment's first 46 MB is "not supported yet"; the same 46 MB alone is "damaged or incomplete". Random bytes are "not a .hack disc". The PAL/Japanese message is tested on a synthetic image (the tests build small ISO 9660 images), since no such disc is here.

The stamp and rebuilds. Every build writes game/stamp.txt. Its first line is data = DATA_VERSION, then pack = pack::VERSION, then a disc = volume boot size gcmn-hash line per disc. A disc kept from the build keeps its earlier line. At start the launcher checks each image in discs.txt again. If any built volume's stamp is missing or of other formats, it rebuilds from those images. If a built volume's image is gone, it waits and its card asks for the image again.

The window. The Library shows four cards, with these states: no disc, disc moved, needs Infection's disc too, ready to build, building, needs rebuild, ready. Discs come from the file picker or a drop, and the verdict shows in a banner. Each disc being built gets a progress bar and step text, with Cancel. A failed build keeps its log and says why. Play runs current_exe() --play --game <data>/game --volume N with its output in logs/game-*.log; the last 10 logs of each kind are kept. Settings offers the file's 13 options with the values the Option menus give them, plus disc_speed. The page locks while the game runs and reloads after. Logs and help has Copy bug report (version and commit, OS, adapter, disc ids, the last 40 log lines, home folder and user name removed), Report on GitHub (the new-issue URL, prefilled) and Open logs/data folder. The look is the desktop's, recreated by hand: a deep blue field, faint tunnel rings, glass panels, an icon column and a back bar. The font is Fira Sans under OFL 1.1, whose licence is in assets/fonts/OFL.txt and the README's Third-party section. On Windows the executable is windows_subsystem = "windows".

End to end on this machine. The release piney-apples was copied into an empty scratch folder. --add-disc named Infection. --build built it into piney-apples-data/game in 14 s and wrote the stamp (data = 35, pack = 2, disc = 1 SLUS_202.67 2598567936 9349383e707e0cad). --start 1 -- --shot boot.png --frames 1500 re-ran the executable as --play --game ... --volume 1; the game booted on that build to the title's intro movie, and the log holds piney-game build b5508c5. A second start logged auto rebuild: not needed. With the stamp edited to data = 34, the next start logged auto rebuild: started from 1 disc(s), rebuilt, and the stamp read 35 again. The screenshots of the window are in /mnt/data/claude/scratch/launcher/e2e/ (shot-library.png, x11-*.png).

The session was locked through most of this, so GPUI drew no frames until input arrived. Its X11 refresh loop stops for a fully obscured window, and Wayland sends no frame callbacks then. The window was run under XWayland and nudged with xdotool, and import -window captured only it.

Licences and advisories. cargo deny check licenses passes with one permissive licence added: NCSA, for libfuzzer-sys under rav1e under the image crate GPUI uses. cargo deny check advisories fails with 11 "unmaintained" notices, all inside GPUI 0.2.2's tree: async-std, instant, paste, pin-utils, proc-macro-error2, rustls-pemfile, rustybuzz, ttf-parser, zbus_names, zvariant, zvariant_derive. None is vulnerable or unsound, and GPUI's tree offers no update or feature that drops them. The maintainer chose to scope the check: unmaintained = "workspace", so a crate the workspace names directly must be maintained, while vulnerable, unsound and yanked crates still fail anywhere in the tree. Both checks pass.

CI. release.yml builds on a v* tag or by hand with a tag, on windows-2022 (msvc) and ubuntu-22.04 (for glibc 2.35). It has LIBWEBP_SYS_STATIC=1, so the game's WebP recorder links in. It packages piney-apples-<ver>-windows-x86_64.zip and -linux-x86_64.tar.gz with the licences, and attaches them to a draft release. It refuses to touch a published one. launcher.yml checks the launcher on both systems for pushes that touch crates/, and runs its tests on Linux. Nothing was pushed or tagged.

Checks. Crate tests 811 passed, 0 failed (786 plus the launcher's 15, the builder's 7 and the resolver's 3). The piney-game suite is 352 / 0 / 153 (351 plus the settings test, now as library tests). The golden shots: 4,550 files against base, 0 differ (shots.sh now picks --lib when piney-game has one). piney-gen gen, syms and carry --check are current. Clippy (all targets and features) and fmt are clean, and tools/docs.py check passes. cargo check --target x86_64-pc-windows-gnu -p piney-launcher passes. The msvc check stops in ring's and zstd-sys's build scripts, because there is no MSVC SDK here, so CI is the msvc check. No engine code changed, so no sweep ran.

Still unknown

whether the Windows build runs. It has only been compiled locally for the GNU target; the MSVC release build and a run on Windows wait for CI and a Windows machine. GPUI's window has been run only on KDE Plasma (Wayland and XWayland).