From ec814346842baf57975ba83784f6902cc376aef8 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Mon, 21 Sep 2026 02:16:27 -0400 Subject: [PATCH] strata, flea: compile the test harness in parallel Both upstreams set fat LTO in their release profile (strata also codegen-units = 1), which compiles the final crate on one thread. That is a reasonable trade for the binary users run, and build() keeps it. check() then compiled the same crate a second time under the same profile for the test harness, and threw it away. On the aarch64 builds, which run under QEMU, those two serial compiles were 106 of strata's 118 minutes. check() now builds the harness with thin LTO and 16 codegen units in its own target directory. The shipped binary is unchanged. Measured on the x86_64 builder for strata's test binary: 708 s serial, 223 s with this profile. Local run: shipped strata still 7m30s from target/, tests 3m43s from target-check/, 1998 passed. ttfx has the same upstream profile but no check(), so nothing to do. --- pkgbuilds/flea/PKGBUILD | 10 ++++++++-- pkgbuilds/strata/PKGBUILD | 13 +++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgbuilds/flea/PKGBUILD b/pkgbuilds/flea/PKGBUILD index 2808c60..a8cd3fd 100644 --- a/pkgbuilds/flea/PKGBUILD +++ b/pkgbuilds/flea/PKGBUILD @@ -2,7 +2,7 @@ pkgname=flea pkgver=0.3.1 -pkgrel=1 +pkgrel=2 pkgdesc='Fast, keyboard-first file manager for Omarchy' arch=('x86_64' 'aarch64') url='https://github.com/thisisgm/flea' @@ -64,7 +64,13 @@ build() { check() { cd "$pkgname-$pkgver" - export CARGO_TARGET_DIR=target + # Upstream's release profile uses fat LTO, whose final link runs on one + # thread. build() keeps it for the shipped binary; the test harness is a + # throwaway second compile, so build it in parallel in its own target + # directory. + export CARGO_TARGET_DIR=target-check + export CARGO_PROFILE_RELEASE_LTO=thin + export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16 local -a test_args=() if ! /usr/bin/prlimit --cpu=30 --as=1073741824 \ diff --git a/pkgbuilds/strata/PKGBUILD b/pkgbuilds/strata/PKGBUILD index 11cbbd1..4b6a14b 100644 --- a/pkgbuilds/strata/PKGBUILD +++ b/pkgbuilds/strata/PKGBUILD @@ -1,6 +1,6 @@ pkgname=strata pkgver=0.19.0 -pkgrel=1 +pkgrel=2 pkgdesc='Fast, keyboard-first file manager for modern Linux desktops' arch=('x86_64' 'aarch64') url='https://github.com/lgse/strata' @@ -69,7 +69,16 @@ build() { check() { cd "$pkgname-$pkgver" - export CARGO_TARGET_DIR=target + # Upstream's release profile is fat LTO with one codegen unit, which + # compiles the final crate on a single thread. That is the right trade + # for the binary users run, and build() keeps it. The test harness is a + # second compile of the same crate under the same profile, thrown away + # afterwards; build it in parallel, in its own target directory so the + # shipped binary is untouched. Measured on the x86_64 builder: 708 s + # serial, 223 s with thin LTO and 16 units. + export CARGO_TARGET_DIR=target-check + export CARGO_PROFILE_RELEASE_LTO=thin + export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16 export STRATA_BUILD_COMMIT STRATA_BUILD_COMMIT=$(<.build-commit) export STRATA_RELEASE_TAG="v$pkgver"