From 8881bfead1415815479cff01131f65511e9abc65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 26 Sep 2026 14:29:56 -0400 Subject: [PATCH] dev.sh run: home folder, render nodes, build first Issue #1: run mounts the home folder at its own path with HOME there, so the app reads the user's files and theme. Issue #2: each render node passes with its group, which Mesa's EGL needs. run builds before it starts the app. Co-Authored-By: Claude --- AGENTS.md | 2 +- README.md | 4 +++- TASKS.md | 4 +++- scripts/dev.sh | 12 +++++++----- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index af923d9..f7d13cf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -142,7 +142,7 @@ No sudo is needed. Docker does the work. - `scripts/dev.sh build` — configure and build in the Ubuntu 24.04 container, warnings as errors. With no `CMAKE_BUILD_TYPE` the build is `RelWithDebInfo`: pixel code must stay optimized. Every target is compiled with `_GLIBCXX_ASSERTIONS`: an empty `std::optional` or a bad index aborts, in the tests and in the app, where it would otherwise pass by luck. - `scripts/dev.sh test` — build, then run every test headless (`QT_QPA_PLATFORM=offscreen`). `HOME` and `/tmp` sit on a tmpfs, as in the distro checks: the store's syncs on the container's disk wait on a busy host. -- `scripts/dev.sh run` — run the app on the host Wayland display. +- `scripts/dev.sh run` — build, then run the app on the host Wayland display (issues #1 and #2, 11.4e): the home folder is mounted at its own path with `HOME` pointing there, so files, settings and the Omarchy theme resolve as in a native run, and each `/dev/dri/renderD*` passes with its group, since Mesa's EGL fails without one (Zink's Vulkan and the dri2 screen). On NVIDIA's own driver the container's Mesa cannot drive the node and EGL still warns; the app paints on the CPU either way. The reporter's black and stale areas cleared with the node; this host never showed them. - `scripts/mutate.py FILE [--targets T1,T2]` — mutation runner, run from the repository root. Reads `old ==> new` blocks separated by `@@` lines on stdin, or with `--delete [--from N --to M]` removes each statement line in turn. A mutant counts as caught only when it builds and a test fails. Run it on every item before review. - `scripts/heic-fixtures.sh` — rewrites the HEIC test fixtures in a throwaway container that has `heif-enc` and x265. Its parts are real files under `scripts/heic-fixtures/` (`Dockerfile`, `sources.cpp`, `generate.sh`), so lint reads each in its own language. - `scripts/lint.py` — the house rules, from the repository root: every file under 500 lines, every comment one line and at most ten words. Each file is read by a scanner for its own language: C++ (`//` and `/* */` outside literals), Python (its own tokenizer), CMake (`#` outside quotes, escapes and bracket arguments, which open only where an argument begins, tracked as state through escapes; bracket comments too), Docker (any line that begins with `#`) and shell. The shell scanner reads the subset the scripts keep to (quotes, escapes, `$( )` and `${ }` to any depth, here-strings, `#` where a word begins) and refuses the rest by name and line, so nothing passes unread: `<<` (a heredoc or a shift), backticks, `$'…'`, arithmetic, `((`, `case` inside `$( )`, and a continued line anywhere but between words (it could split `$(`, `<<` or a keyword). Write scripts inside that subset. A file of any other kind under `scripts` fails lint. It reads `src`, `tests`, everything under `scripts`, `CMakeLists.txt` and `Dockerfile.dev`. `--self-test` checks the checker. Run both before every review. diff --git a/README.md b/README.md index 132d854..925df0f 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,11 @@ The build runs in Docker, so the host needs only Docker: ```sh scripts/dev.sh build # configure and build in Ubuntu 24.04 scripts/dev.sh test # every test, headless -scripts/dev.sh run # the app on your Wayland display +scripts/dev.sh run # build, then the app on your Wayland display ``` +`run` gives the container your home folder at its own path, so the app opens and saves your files and reads your Omarchy theme, and the GPU's render nodes (`/dev/dri/renderD*`), which Mesa's EGL wants. Files outside your home folder stay out of reach. + By hand: C++20, Qt 6.4 or later (Widgets, Concurrent, image formats), CMake, Ninja, libheif, fontconfig and ONNX Runtime. `-DOMAPHOTO_MODEL=path/to/u2net.onnx` installs Remove Background's model. `scripts/distro-check.sh arch|fedora|nixos|resolute` builds and tests on those systems (`resolute` is Ubuntu 26.04). ## Licence diff --git a/TASKS.md b/TASKS.md index e4d752a..85c7dee 100644 --- a/TASKS.md +++ b/TASKS.md @@ -288,7 +288,9 @@ The panel of 4.6 shows and edits what the session holds so far. Each item adds i - 11.4d work: the Fedora image is 43 and, like the Arch image, carries Microsoft's ONNX Runtime 1.21.0 (the dev image's block, pinned) in place of the system's; `Dockerfile.dev` takes `BASE`, and `distro-check.sh resolute` runs it on Ubuntu 26.04. The RPM and the Arch package bundle the runtime (`OMAPHOTO_BUNDLE_ORT`): the RPM keeps it out of what it provides and requires, the PKGBUILD fetches the tarball by checksum, lays it out for its CMake config in `prepare()` and drops `onnxruntime`. The release builds `omaphoto-noble_amd64.deb` and `omaphoto-resolute_amd64.deb` (a matrix), and `ubuntu.sh` takes the one its `UBUNTU_CODENAME` names. Evidence: 205 of 205 on Ubuntu 24.04, Arch, Fedora 43 and Ubuntu 26.04; the workflow's package commands build all four; each installs and starts in fresh containers (24.04, 26.04, Fedora 43, 44 and 44 beside `onnxruntime`, Arch and Arch beside `onnxruntime-cpu`), `ldd` finding the bundled runtime; 24.04's DEB is refused on 26.04; the RPM names no `onnxruntime` among its requires or provides; `ubuntu.sh` against a stand-in `curl` installs the right DEB on 24.04 and 26.04 and refuses Debian 13. - 11.4d round 1: FAIL, three findings, all words: `arch.sh` still said pacman asks which runtime provides `onnxruntime` (the line went), the README's distro checks left out `resolute`, the workflow's heading said three packages (four). - 11.4d round 2: PASS, no findings. Committed; pushed with 1.0.1's tag, since `ubuntu.sh` asks for its asset names. -- [ ] 11.4e Issues #1 and #2: `dev.sh run` reaches the host's files (the home folder) and the GPU's render nodes, and builds before it runs. +- [x] 11.4e Issues #1 and #2: `dev.sh run` reaches the host's files (the home folder) and the GPU's render nodes, and builds before it runs. +- 11.4e work: `dev.sh run` builds first, mounts the home folder at its own path with `HOME` there (the theme's separate mount went: it now reads from its real path), and passes each render node with its group. Evidence: before, the same EGL and Zink warnings as issue #2 (`run-nodev.log`), the window whole on this Hyprland host (`run-nodev.png`), so the black areas did not reproduce here; after, `dev.sh run ~/Pictures/Wallpapers/kafka-5k2k.jpg` built, imported the wallpaper from the home folder (`run-dev.log`, `run-dev.png`), read the theme from its real path, and `docker inspect` showed both render nodes, group 987 and `HOME=/home/zacharyzhang`; the Zink error went, and this host's NVIDIA driver leaves Mesa's dri2 warning. +- 11.4e round 1: PASS, no findings. - [ ] 11.4f Release 1.0.1: the fixes above, the Node 24 actions, the install scripts rerun against the new release; the issues answered and closed. - [ ] 12.0 Port Compositor 1.3: survey the upstream changes from 1.1 to 1.3.x and split them into ordered items here before any code. - [ ] 11.5 End-to-end acceptance run with screenshots, README Linux section, `AGENTS.md` sync, MVP acceptance table. diff --git a/scripts/dev.sh b/scripts/dev.sh index e53652d..31662ba 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -26,12 +26,14 @@ run) socket=$WAYLAND_DISPLAY [[ $socket = /* ]] || socket=$XDG_RUNTIME_DIR/$socket socket=$(readlink -f "$socket") - # The desktop's theme, where Omarchy keeps it, read-only. - theme=$HOME/.local/state/omarchy - mounts=() - [[ -d $theme ]] && mounts=(-v "$theme:/tmp/.local/state/omarchy:ro") + # The home folder at its own path: files, settings, theme. + mounts=(-v "$HOME:$HOME" -e HOME="$HOME") + # The GPU's render nodes, which Mesa's EGL needs. + for node in /dev/dri/renderD*; do + [[ -e $node ]] && mounts+=(--device "$node" --group-add "$(stat -c %g "$node")") + done in_container "${mounts[@]}" -v "$socket:$runtime/wayland-0" -e WAYLAND_DISPLAY=wayland-0 \ - -e QT_QPA_PLATFORM=wayland "$image" build/omaphoto "${@:2}" + -e QT_QPA_PLATFORM=wayland "$image" sh -c "$configure_and_build && exec build/omaphoto \"\$@\"" sh "${@:2}" ;; *) echo "usage: dev.sh build|test|run [args]" >&2