From 5fc17812629c95bbc8142d7cbe364e260b47f7c7 Mon Sep 17 00:00:00 2001 From: nevaforget Date: Thu, 23 Apr 2026 13:04:31 +0200 Subject: [PATCH] fix(pkgbuild): honour CARGO_TARGET_DIR in install path The act_runner exports CARGO_TARGET_DIR=/cache/target for cache persistence, but the three Rust-app PKGBUILDs hardcoded target/release/. Run 87 compiled 8 min then failed at install stage. Use ${CARGO_TARGET_DIR:-target} so both CI and local makepkg work. --- DECISIONS.md | 6 ++++++ moongreet-git/PKGBUILD | 2 +- moonlock-git/PKGBUILD | 2 +- moonset-git/PKGBUILD | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DECISIONS.md b/DECISIONS.md index 75dc990..7ccefbb 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -1,5 +1,11 @@ # Decisions +## 2026-04-23 – Rust PKGBUILDs honour CARGO_TARGET_DIR +- **Who**: Dominik, ClaudeCode +- **Why**: The act_runner container sets `CARGO_TARGET_DIR=/cache/target` (for cross-build cache persistence), but `moongreet-git`/`moonlock-git`/`moonset-git` `package()` hardcoded `target/release/`. Run 87 compiled for 8 min and then failed at `install: cannot stat 'target/release/moongreet'` because the binary actually lived in `/cache/target/release/`. Silent until today because earlier builds pre-date the env var. +- **Tradeoffs**: None meaningful — the fallback `${CARGO_TARGET_DIR:-target}` preserves local `makepkg` builds (no env var → still reads from `./target/`). +- **How**: Patched `install -Dm755` in all three Rust-app PKGBUILDs to use `"${CARGO_TARGET_DIR:-target}/release/"`. + ## 2026-04-23 – Single-threaded, low-priority build in CI to keep the Gitea host alive - **Who**: Dominik, ClaudeCode - **Why**: The act_runner container shares CPU/RAM/I/O with the Gitea host (network-host mode, no resource limits). Parallel Rust builds OOM-kill or thrash the host: run 86 (2026-04-23, moongreet-git 0.8.3.r1) stopped mid-compile at `Compiling gio v0.22.2` with no error, and gitea HTTPS was unreachable for ~11 min. Same pattern on 2026-04-20. Runner-side resource limits would be better, but require host-side config changes; a pipeline-side fix is portable and low-risk. diff --git a/moongreet-git/PKGBUILD b/moongreet-git/PKGBUILD index 4c59ec4..1642bab 100644 --- a/moongreet-git/PKGBUILD +++ b/moongreet-git/PKGBUILD @@ -40,7 +40,7 @@ build() { package() { cd "$srcdir/greetd-moongreet" - install -Dm755 target/release/moongreet "$pkgdir/usr/bin/moongreet" + install -Dm755 "${CARGO_TARGET_DIR:-target}/release/moongreet" "$pkgdir/usr/bin/moongreet" # Greeter config install -Dm644 config/moongreet.toml "$pkgdir/etc/moongreet/moongreet.toml" diff --git a/moonlock-git/PKGBUILD b/moonlock-git/PKGBUILD index d3ad379..f938ed2 100644 --- a/moonlock-git/PKGBUILD +++ b/moonlock-git/PKGBUILD @@ -46,7 +46,7 @@ build() { package() { cd "$srcdir/moonlock" - install -Dm755 target/release/moonlock "$pkgdir/usr/bin/moonlock" + install -Dm755 "${CARGO_TARGET_DIR:-target}/release/moonlock" "$pkgdir/usr/bin/moonlock" # PAM configuration install -Dm644 config/moonlock-pam "$pkgdir/etc/pam.d/moonlock" diff --git a/moonset-git/PKGBUILD b/moonset-git/PKGBUILD index 56d0211..a559391 100644 --- a/moonset-git/PKGBUILD +++ b/moonset-git/PKGBUILD @@ -38,7 +38,7 @@ build() { package() { cd "$srcdir/moonset" - install -Dm755 target/release/moonset "$pkgdir/usr/bin/moonset" + install -Dm755 "${CARGO_TARGET_DIR:-target}/release/moonset" "$pkgdir/usr/bin/moonset" # Example config install -Dm644 config/moonset.toml "$pkgdir/etc/moonset/moonset.toml.example"