From 3ff0945866f13fac3c9e90b43b64d353360f66dc Mon Sep 17 00:00:00 2001 From: Mollusk Date: Sun, 28 Jun 2026 06:19:59 -0400 Subject: [PATCH] packaging: remap build paths out of the binary (fix $srcdir reference warning) makepkg warned that usr/bin/peerspeak referenced $srcdir: Rust bakes source paths into panic/backtrace metadata that survives stripping. Add --remap-path-prefix=$srcdir=/ in build() so neither our sources nor the vendored deps under CARGO_HOME leave the build dir embedded in the package. Co-Authored-By: Claude Opus 4.8 --- packaging/PKGBUILD | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packaging/PKGBUILD b/packaging/PKGBUILD index f13b583..cdd61e8 100644 --- a/packaging/PKGBUILD +++ b/packaging/PKGBUILD @@ -38,6 +38,11 @@ build() { export CARGO_HOME="$srcdir/cargo-home" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target + # Strip the build directory out of paths embedded in the binary (Rust bakes + # source paths into panic/backtrace metadata that survives stripping), so the + # package doesn't reference $srcdir. One remap covers our sources and the + # vendored deps, since CARGO_HOME lives under $srcdir too. + export RUSTFLAGS="${RUSTFLAGS:-} --remap-path-prefix=$srcdir=/" cargo build --frozen --release --bin "$_pkgname" }