From c8517a41cf1cb97065b1c3d770de9cccc8e3c7ab Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sun, 1 Nov 2026 22:28:08 +0100 Subject: [PATCH] docs(readme): --die-with-parent in the install alias flatpak run becomes bubblewrap, and without --die-with-parent the sandbox outlives it. With crafter-build started through the alias in an interactive bash or zsh on a terminal, SIGKILL to its flatpak run process alone left a -r program running and a build writing into bin/ and build/. With the flag, both ended with it. bubblewrap kills the sandbox when flatpak run or its parent dies, and for crafter-build typed at the prompt, in the foreground or with &, that parent is the shell: with the flag, the sandbox also ended when the shell was SIGKILLed, or exited after a disown. In a (crafter-build -r &) subshell, flatpak run outlives the subshell and is adopted by another process, so its sandbox outlived the shell with the flag as well. Ctrl-C ended the program either way. The README's alias gets the flag, and the paragraph after it says what that changes: a program started through the alias, as crafter-build ... or crafter-build ... & at a bash or zsh prompt, ends with its shell, even after a disown. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11d4269..2f71543 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,11 @@ crafter-build ships as a Flatpak that carries its own clang, lld, libc++ and WAS ```bash flatpak remote-add --if-not-exists catcrafts https://flatpak.catcrafts.net/catcrafts.flatpakrepo flatpak install catcrafts net.catcrafts.CrafterBuild -alias crafter-build='flatpak run net.catcrafts.CrafterBuild' +alias crafter-build='flatpak run --die-with-parent net.catcrafts.CrafterBuild' ``` +`--die-with-parent` ends the sandbox with the `flatpak run` that started it. Without the flag, killing only the `flatpak run` process leaves the sandbox running: a build carries on writing into `bin/` and `build/`, and a program started with `-r` keeps running. With it, bubblewrap kills everything in the sandbox with SIGKILL when the `flatpak run` process dies or when that process's parent does. For `crafter-build …` or `crafter-build … &` typed at a bash or zsh prompt, that parent is the shell, so the sandbox ends with the shell, even after a `disown`. Ctrl-C reaches the program either way. + Pre-release builds of `master` are the `beta` branch (`flatpak install catcrafts net.catcrafts.CrafterBuild//beta`), and every release also attaches a single-file bundle on the Forgejo releases page (`flatpak install --user crafter-build-.flatpak`). The sandbox sees the whole host filesystem, so projects can live anywhere. Binaries built for the host link the bundled `libc++.so.1` through an rpath into the Flatpak: they run inside it (`-r`, the test runner), and are not meant to be copied out onto the host. ## Writing a project.cpp