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