Add a build task, sharing the ninja-cap/PKG_CONFIG_PATH setup

Hoist PKG_CONFIG_PATH and the ninja-jcap PATH prefix to shared/global
scope so `task build` (flutter build linux --release) gets the same
OOM protection as the run task, without duplicating the setup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Philip Peterson 2026-10-10 10:28:13 -08:00
parent a50e2d7b5e
commit 82c03c46ac

View file

@ -2,19 +2,26 @@ version: '3'
vars: vars:
FLUTTER: /var/home/ironmagma/Code/.flutter-sdk/bin/flutter FLUTTER: /var/home/ironmagma/Code/.flutter-sdk/bin/flutter
# flutter_tools shells out to bare `ninja -C <dir> install` with no -j
# flag, so ninja defaults to nproc+2 parallel compile/link jobs. That's
# enough to trip systemd-oomd on this machine (6 cores, 7.6GiB RAM).
# (Task's `env:` block can't override PATH itself -- the OS env wins --
# so the shim has to be prepended inline in each task's cmd instead.)
# See tools/ninja-jcap for the shim that caps it.
NINJA_JCAP_PATH: '{{.ROOT_DIR}}/tools/ninja-jcap:$PATH'
env:
# GTK/glib/etc. come from Homebrew (brew install gtk+3), not rpm-ostree,
# since they're only needed to build this one app, not the OS image.
PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/lib/pkgconfig:/home/linuxbrew/.linuxbrew/share/pkgconfig:/home/linuxbrew/.linuxbrew/opt/xorgproto/share/pkgconfig
tasks: tasks:
default: default:
desc: Launch Layer Wizard desc: Launch Layer Wizard
env:
# GTK/glib/etc. come from Homebrew (brew install gtk+3), not rpm-ostree,
# since they're only needed to build this one app, not the OS image.
PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/lib/pkgconfig:/home/linuxbrew/.linuxbrew/share/pkgconfig:/home/linuxbrew/.linuxbrew/opt/xorgproto/share/pkgconfig
cmds: cmds:
# flutter_tools shells out to bare `ninja -C <dir> install` with no -j - 'PATH="{{.NINJA_JCAP_PATH}}" {{.FLUTTER}} run -d linux'
# flag, so ninja defaults to nproc+2 parallel compile/link jobs. That's
# enough to trip systemd-oomd on this machine (6 cores, 7.6GiB RAM). build:
# (Task's `env:` block can't override PATH itself -- the OS env wins -- desc: Build the Linux release bundle
# so the shim has to be prepended inline here instead.) See cmds:
# tools/ninja-jcap for the shim that caps it. - 'PATH="{{.NINJA_JCAP_PATH}}" {{.FLUTTER}} build linux --release'
- 'PATH="{{.ROOT_DIR}}/tools/ninja-jcap:$PATH" {{.FLUTTER}} run -d linux'