debugflags: Ensure we have unique source paths

In some cases packages are built outside of a directory which contains
pkgname-pkgver, this results in source listing in debug packages having
a conflicting path like `/usr/src/debug/build/` which is not ideal.

This patch ensures we always include the pkgbase to ensure the paths are
unique.

Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Morten Linderud 2022-05-27 18:44:52 +02:00 committed by Allan McRae
parent 0031cd1e46
commit 776b7c1e75
2 changed files with 4 additions and 4 deletions

View file

@ -30,9 +30,9 @@ buildenv_functions+=('buildenv_debugflags')
buildenv_debugflags() { buildenv_debugflags() {
if check_option "debug" "y" && ! check_option "buildflags" "n"; then if check_option "debug" "y" && ! check_option "buildflags" "n"; then
DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" DEBUG_CFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}" DEBUG_CXXFLAGS+=" -ffile-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}" DEBUG_RUSTFLAGS+=" --remap-path-prefix=$srcdir=${DBGSRCDIR:-/usr/src/debug}/${pkgbase}"
CFLAGS+=" $DEBUG_CFLAGS" CFLAGS+=" $DEBUG_CFLAGS"
CXXFLAGS+=" $DEBUG_CXXFLAGS" CXXFLAGS+=" $DEBUG_CXXFLAGS"
RUSTFLAGS+=" $DEBUG_RUSTFLAGS" RUSTFLAGS+=" $DEBUG_RUSTFLAGS"

View file

@ -47,7 +47,7 @@ source_files() {
LANG=C debugedit --no-recompute-build-id \ LANG=C debugedit --no-recompute-build-id \
--base-dir "${srcdir}" \ --base-dir "${srcdir}" \
--dest-dir "${dbgsrcdir}" \ --dest-dir "${dbgsrcdir}/${pkgbase}" \
--list-file /dev/stdout "$1" \ --list-file /dev/stdout "$1" \
| sort -zu | tr '\0' '\n' | sort -zu | tr '\0' '\n'
} }