fix(pkgbuild): honour CARGO_TARGET_DIR in install path
Some checks failed
Build and publish packages / build-and-publish (push) Failing after 14m14s

The act_runner exports CARGO_TARGET_DIR=/cache/target for cache
persistence, but the three Rust-app PKGBUILDs hardcoded
target/release/<bin>. Run 87 compiled 8 min then failed at
install stage. Use ${CARGO_TARGET_DIR:-target} so both CI and
local makepkg work.
This commit is contained in:
nevaforget 2026-04-23 13:04:31 +02:00
parent cc5cf1c1e1
commit 5fc1781262
4 changed files with 9 additions and 3 deletions

View File

@ -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/<bin>`. 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/<bin>"`.
## 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.

View File

@ -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"

View File

@ -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"

View File

@ -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"