diff --git a/CHANGELOG.md b/CHANGELOG.md index 821bb45..1fdec75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,13 @@ GitHub are taken from the matching section here. `MOCKTAIL_LOCAL_STORAGE_CURRENT_USER_ID` is now ignored instead of being partly read. +### Changed + +- `make flatpak` and `scripts/build_flatpak.sh` now build with 2 jobs by + default instead of 4, so a local Flatpak build is less likely to run out + of memory. Set `FLATPAK_JOBS` or `MOCKTAIL_FLATPAK_JOBS` to use more. + Thanks to @glook9001. + ## [0.3.1] - 2026-09-20 ### Added diff --git a/Makefile b/Makefile index e544668..f56c744 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ ANYLINUX_APPIMAGETOOL ?= appimagetool PREFIX ?= /usr FLATPAK_BUILD_DIR ?= build-flatpak FLATPAK_MANIFEST ?= packaging/flatpak/io.github.CoderDayton.nightcap.json -FLATPAK_JOBS ?= 4 +FLATPAK_JOBS ?= 2 define build_native_runtime @git submodule update --init --recursive diff --git a/scripts/build_flatpak.sh b/scripts/build_flatpak.sh index 4173b34..228324c 100755 --- a/scripts/build_flatpak.sh +++ b/scripts/build_flatpak.sh @@ -10,7 +10,7 @@ readonly PROJECT_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd -P)" BUILD_DIR="${PROJECT_ROOT}/build-flatpak" MANIFEST="${PROJECT_ROOT}/packaging/flatpak/io.github.CoderDayton.nightcap.json" -JOBS="${MOCKTAIL_FLATPAK_JOBS:-4}" +JOBS="${MOCKTAIL_FLATPAK_JOBS:-2}" Usage() { cat <<'EOF' @@ -21,7 +21,7 @@ Build and install Mocktail as a per-user Flatpak for the host architecture. Options: --build-dir DIR Builder output directory (default: build-flatpak). --manifest FILE Flatpak manifest path. - --jobs N Maximum parallel build jobs (default: 4). + --jobs N Maximum parallel build jobs (default: 2). -h, --help Show this help. EOF } diff --git a/tests/flatpak_packaging_test.sh b/tests/flatpak_packaging_test.sh index 5c12e76..9c60296 100755 --- a/tests/flatpak_packaging_test.sh +++ b/tests/flatpak_packaging_test.sh @@ -176,8 +176,10 @@ grep -Fq './scripts/build_flatpak.sh' <<<"${dry_run}" || Fail 'make flatpak does not invoke the guarded Flatpak builder' grep -Fq -- '--manifest packaging/flatpak/io.github.CoderDayton.nightcap.json' \ <<<"${dry_run}" || Fail 'make flatpak lost the canonical manifest' -grep -Fq -- '--jobs 4' <<<"${dry_run}" || +grep -Fq -- '--jobs 2' <<<"${dry_run}" || Fail 'make flatpak does not cap local build parallelism' +grep -Fq 'JOBS="${MOCKTAIL_FLATPAK_JOBS:-2}"' "${BUILD_HELPER}" || + Fail 'Flatpak helper does not cap local build parallelism' mkdir -p -- "${TEMP_DIR}/bin" cat >"${TEMP_DIR}/bin/uname" <<'EOF'