diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed52189..f3c9749 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,12 @@ permissions: env: CARGO_TERM_COLOR: always RUST_BACKTRACE: "0" + # GitHub's runners have 16 GB: the generated UI library does not fit + # in that next to other crates, and the runner is killed. The Gitea + # workflow keeps Cargo's default job count. The Flatpak job sets it in + # the manifest too. + CARGO_BUILD_JOBS: "1" + CARGO_INCREMENTAL: "0" jobs: package-linux: @@ -108,6 +114,13 @@ jobs: python3 -m venv /tmp/venv /tmp/venv/bin/pip install --quiet "aiohttp>=3.9.5,<4" "tomlkit>=0.13.3,<1" "PyYAML>=6.0.2,<7" /tmp/venv/bin/python /tmp/flatpak-cargo-generator.py Cargo.lock -o packaging/flatpak/cargo-sources.json + # flatpak-builder does not pass the job's environment into its sandbox, + # and the manifest keeps Cargo's default job count for Gitea: one job + # here, as for the other packages. + - name: One Cargo job + run: | + sed -i 's/^ CARGO_NET_OFFLINE: "true"$/&\n CARGO_BUILD_JOBS: "1"/' packaging/flatpak/io.github.faumaray.Voelin.yml + grep -q '^ CARGO_BUILD_JOBS: "1"$' packaging/flatpak/io.github.faumaray.Voelin.yml - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: bundle: voelin.flatpak diff --git a/docs/ci.md b/docs/ci.md index 227f42c..44b844c 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -9,9 +9,12 @@ Both GitHub and Gitea provide release packaging; see [release.md](release.md) and [building.md](building.md). Cargo builds use one job in CI (`ci.yml`) so the generated UI library and -its test target do not compile concurrently. The release workflows, their -Docker images and the Flatpak build use Cargo's defaults (one job per CPU, -no incremental builds in release mode). The release profile uses ThinLTO and +its test target do not compile concurrently. GitHub's release workflow uses +one job too, also inside its Flatpak build: on its 16 GB runners the UI +library does not fit next to other crates, and the runner is killed. The +Gitea release workflow, its Docker images and the Flatpak manifest itself +use Cargo's defaults (one job per CPU, no incremental builds in release +mode). The release profile uses ThinLTO and 16 codegen units instead of fat LTO and one unit, reducing peak compiler memory while retaining optimised builds and panic unwinding. This trades some whole-program optimisation for lower build-memory requirements; release