Repeated builds were getting SIGTERM'd or thrashing into swap when competing with other heavy concurrent builds on the same machine. Wraps the build in `systemd-run --user --scope` with a low CPU/IO weight and a soft memory cap (throttles rather than kills), and caps GOMAXPROCS so cgo doesn't spawn as many parallel cc1plus processes compiling the vendored Qt6 binding layer. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
66 lines
2.9 KiB
YAML
66 lines
2.9 KiB
YAML
version: "3"
|
|
|
|
tasks:
|
|
build:
|
|
desc: Compile mozsync (via a flatpak-builder sandbox, for Qt6WebEngine headers only)
|
|
sources:
|
|
- main.go
|
|
- go.mod
|
|
- go.sum
|
|
- org.mozsync.App.yml
|
|
generates:
|
|
- mozsync
|
|
cmds:
|
|
# Deliberately NOT wiping .flatpak-builder here: it holds flatpak-builder's
|
|
# own build-stage cache (under .flatpak-builder/build/mozsync-1) plus our
|
|
# persistent GOCACHE (see org.mozsync.App.yml), so unchanged files in the
|
|
# ~260-file vendored Qt6 binding layer don't get recompiled on every run.
|
|
# --force-clean only empties build-dir (the final app output), which is cheap.
|
|
# (Not using --ccache: its lock file went stale after an interrupted build
|
|
# and hung a subsequent one indefinitely; GOCACHE alone already caches the
|
|
# compiled cgo/C++ objects, so it's redundant anyway.)
|
|
#
|
|
# Wrapped in a low-priority, memory-capped systemd scope so this doesn't
|
|
# fight other heavy builds (e.g. a concurrent Ladybird/WebKit build) for
|
|
# RAM and get OOM-killed or thrash into swap. CPUWeight/IOWeight=10 is a
|
|
# low *share* (yields under contention, still gets full speed if idle);
|
|
# MemoryHigh=3G is a soft cap Go/cgo get throttled against rather than
|
|
# killed for. GOMAXPROCS=2 (below) also caps how many parallel cc1plus
|
|
# processes cgo spawns compiling the vendored Qt6 binding layer, which is
|
|
# the main memory hog.
|
|
- systemd-run --user --scope --collect -p CPUWeight=10 -p IOWeight=10 -p MemoryHigh=3G -- flatpak run --command=flatpak-builder org.flatpak.Builder --force-clean build-dir org.mozsync.App.yml
|
|
- cp build-dir/files/bin/mozsync ./mozsync
|
|
- echo "Built ./mozsync - runs directly against the host's Qt6 runtime libs, no flatpak needed."
|
|
|
|
login:
|
|
desc: One-time Mozilla account sign-in, saves credentials to ~/.config/mozsync/credentials.json
|
|
deps: [build]
|
|
cmds:
|
|
- ./mozsync login
|
|
|
|
dump:
|
|
desc: Fetch and print your Firefox Sync bookmarks as JSON
|
|
deps: [build]
|
|
cmds:
|
|
- ./mozsync dump
|
|
|
|
chrome-import:
|
|
desc: Import your Firefox Sync bookmarks into the Chromium flatpak's bookmark store
|
|
vars:
|
|
CHROME_BOOKMARKS: '{{.CHROME_BOOKMARKS | default (printf "%s/.var/app/org.chromium.Chromium/config/chromium/Default/Bookmarks" (env "HOME"))}}'
|
|
deps: [build]
|
|
cmds:
|
|
- ./mozsync dump | ./mozsync chrome-import "{{.CHROME_BOOKMARKS}}"
|
|
|
|
falkon-import:
|
|
desc: Import your Firefox Sync bookmarks into the Falkon flatpak's bookmark store
|
|
vars:
|
|
FALKON_BOOKMARKS: '{{.FALKON_BOOKMARKS | default (printf "%s/.var/app/org.kde.falkon/config/falkon/profiles/default/bookmarks.json" (env "HOME"))}}'
|
|
deps: [build]
|
|
cmds:
|
|
- ./mozsync dump | ./mozsync falkon-import "{{.FALKON_BOOKMARKS}}"
|
|
|
|
clean:
|
|
desc: Remove build artifacts
|
|
cmds:
|
|
- rm -rf build-dir .flatpak-builder mozsync
|