<p>Sigh.</p>
<pre><code>## ------------------------ ##
## Summary of the failures. ##
## ------------------------ ##
Failed tests:
rpm 4.13.0.1 test suite test groups:
 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
      KEYWORDS
  90: rpmbuild.at:708    rpmbuild debuginfo unique debug src dir
      build debuginfo
  91: rpmbuild.at:749    rpmbuild debuginfo no unique debug src dir
      build debuginfo
  93: rpmbuildid.at:59   rpmbuild buildid alldebug
      build debuginfo buildid
  94: rpmbuildid.at:153  rpmbuild buildid alldebug unique debug names
      build debuginfo buildid
  95: rpmbuildid.at:246  rpmbuild buildid separate
      build debuginfo buildid
  96: rpmbuildid.at:339  rpmbuild buildid separate unique debug names
      build debuginfo buildid
  97: rpmbuildid.at:431  rpmbuild buildid compat
      build debuginfo buildid
  98: rpmbuildid.at:537  rpmbuild buildid compat unique debug names
      build debuginfo buildid
 106: rpmbuildid.at:1187 rpmbuild buildid unique r1 r2
      build debuginfo buildid
 107: rpmbuildid.at:1239 rpmbuild buildid non-unique r1 r2
      build debuginfo buildid
## ---------------------- ##
## Detailed failed tests. ##
## ---------------------- ##
#                             -*- compilation -*-
90. rpmbuild.at:708: testing rpmbuild debuginfo unique debug src dir ...
./rpmbuild.at:710:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Build a package that has some debuginfo
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Note that the spec defines hello2 as name, but the source is hello-1.0.
# Disable dwz to make debuginfo path rewrite checking easier.
run rpmbuild --quiet \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --undefine "_find_debuginfo_dwz_opts" \
  --define "_unique_debug_srcs 1" \
  -ba "${abs_srcdir}"/data/SPECS/hello2.spec
# Unpack the debuginfo rpms so we can check the .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
  | cpio -diu --quiet
# Check that the source path is "unique"
# Drop the final arch prefix to make the test arch-independent.
ls ./usr/src/debug/ | cut -f1,2 -d\.
# Check that the source path has been rewritten in the .debug file.
# Drop the final arch prefix to make the test arch-independent.
readelf --debug-dump=info ./usr/lib/debug/usr/local/bin/hello2*.debug \
  | grep comp_dir | cut -f5- -d/ | cut -f1,2 -d\.
stderr:
1 block
ls: cannot access './usr/src/debug/': No such file or directory
--- -   2017-07-25 19:40:45.784331536 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/90/stdout   2017-07-25 19:40:45.782417050 +0000
@@ -1,3 +1,2 @@
 hello2-1.0-1
-hello2-1.0-1
 
90. rpmbuild.at:708: 90. rpmbuild debuginfo unique debug src dir (rpmbuild.at:708): FAILED (rpmbuild.at:710)
#                             -*- compilation -*-
91. rpmbuild.at:749: testing rpmbuild debuginfo no unique debug src dir ...
./rpmbuild.at:751:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Build a package that has some debuginfo
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Note that the spec defines hello2 as name, but the source is hello-1.0.
# Disable dwz to make debuginfo path rewrite checking easier.
run rpmbuild --quiet \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --undefine "_find_debuginfo_dwz_opts" \
  --undefine "_unique_debug_srcs" \
  -ba "${abs_srcdir}"/data/SPECS/hello2.spec
# Unpack the debuginfo rpms so we can check the .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
  | cpio -diu --quiet
# Check that the source path is "unique"
ls ./usr/src/debug/
# Check that the source path has been rewritten in the .debug file.
readelf --debug-dump=info ./usr/lib/debug/usr/local/bin/hello2*.debug \
  | grep comp_dir | cut -f5- -d/
stderr:
1 block
ls: cannot access './usr/src/debug/': No such file or directory
--- -   2017-07-25 19:40:46.256215530 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/91/stdout   2017-07-25 19:40:46.254416689 +0000
@@ -1,3 +1,2 @@
 hello-1.0
-hello-1.0
 
91. rpmbuild.at:749: 91. rpmbuild debuginfo no unique debug src dir (rpmbuild.at:749): FAILED (rpmbuild.at:751)
#                             -*- compilation -*-
93. rpmbuildid.at:59: testing rpmbuild buildid alldebug ...
./rpmbuildid.at:61:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Setup sources
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Build, contains one ELF which should have a buildid.
run rpmbuild \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_build_id_links alldebug" \
  --undefine "_unique_debug_names" \
  --undefine "_unique_debug_srcs" \
  --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be zero build-id files in the main package
# Main and debug should be in the debuginfo package,
# plus the .build-id/xx subdir, 3 in total.
echo -n "hello build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
echo -n "hello debuginfo build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
# Extract the both packages to check the build-id files link to the
# main and .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | cpio -diu
# Check there is a build-id symlink for the main file.
main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
id_main=$(file $main_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
id_main_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
canon_main_file=$(readlink -f ${main_file})
test -f "$canon_main_file" \
  || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
canon_main_id_file=$(readlink -f ${id_main_file})
test -f "$canon_main_id_file" \
  || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
test "$canon_main_file" = "$canon_main_id_file" \
  || echo "main and build-id file not linked"
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
canon_debug_file=$(readlink -f ${debug_file})
test -f "$canon_debug_file" \
  || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
canon_debug_id_file=$(readlink -f ${id_debug_file})
test -f "$canon_debug_id_file" \
  || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
test "$canon_debug_file" = "$canon_debug_id_file" \
  || echo "debug and build-id not linked"
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/93/test-source: line 157: test: too many arguments
--- -   2017-07-25 19:40:46.799197720 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/93/stdout   2017-07-25 19:40:46.797416274 +0000
@@ -1,3 +1,26 @@
 hello build-id files: 0
-hello debuginfo build-id files: 3
+hello debuginfo build-id files: 0
+No main file ./usr/local/bin/hello
+No build-id file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve main file ./usr/local/bin/hello -> 
+Cannot resolve main build-id file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/directory)
+main and build-id file not linked
+No debug file ./usr/lib/debug/usr/local/bin/hello.debug
+unequal main and debug id
+No build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello.debug: cannot open `./usr/lib/debug/usr/local/bin/hello.debug' (No such file or directory).debug
+Cannot resolve debug file ./usr/lib/debug/usr/local/bin/hello.debug -> 
+Cannot resolve debug build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello.debug: cannot open `./usr/lib/debug/usr/local/bin/hello.debug' (No such file or directory).debug -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/093/directory).debug
+debug and build-id not linked
 
93. rpmbuildid.at:59: 93. rpmbuild buildid alldebug (rpmbuildid.at:59): FAILED (rpmbuildid.at:61)
#                             -*- compilation -*-
94. rpmbuildid.at:153: testing rpmbuild buildid alldebug unique debug names ...
./rpmbuildid.at:155:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Setup sources
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Build, contains one ELF which should have a buildid.
run rpmbuild \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_build_id_links alldebug" \
  --define="_unique_debug_names 1" \
  --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be zero build-id files in the main package
# Main and debug should be in the debuginfo package,
# plus the .build-id/xx subdir, 3 in total.
echo -n "hello build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
echo -n "hello debuginfo build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
# Extract the both packages to check the build-id files link to the
# main and .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | cpio -diu
# Check there is a build-id symlink for the main file.
main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
id_main=$(file $main_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
id_main_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
canon_main_file=$(readlink -f ${main_file})
test -f "$canon_main_file" \
  || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
canon_main_id_file=$(readlink -f ${id_main_file})
test -f "$canon_main_id_file" \
  || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
test "$canon_main_file" = "$canon_main_id_file" \
  || echo "main and build-id file not linked"
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello-*.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
canon_debug_file=$(readlink -f ${debug_file})
test -f "$canon_debug_file" \
  || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
canon_debug_id_file=$(readlink -f ${id_debug_file})
test -f "$canon_debug_id_file" \
  || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
test "$canon_debug_file" = "$canon_debug_id_file" \
  || echo "debug and build-id not linked"
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/94/test-source: line 155: test: too many arguments
--- -   2017-07-25 19:40:47.077234413 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/94/stdout   2017-07-25 19:40:47.075416061 +0000
@@ -1,3 +1,26 @@
 hello build-id files: 0
-hello debuginfo build-id files: 3
+hello debuginfo build-id files: 0
+No main file ./usr/local/bin/hello
+No build-id file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve main file ./usr/local/bin/hello -> 
+Cannot resolve main build-id file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/directory)
+main and build-id file not linked
+No debug file ./usr/lib/debug/usr/local/bin/hello-*.debug
+unequal main and debug id
+No build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello-*.debug: cannot open `./usr/lib/debug/usr/local/bin/hello-*.debug' (No such file or directory).debug
+Cannot resolve debug file ./usr/lib/debug/usr/local/bin/hello-*.debug -> 
+Cannot resolve debug build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello-*.debug: cannot open `./usr/lib/debug/usr/local/bin/hello-*.debug' (No such file or directory).debug -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/094/directory).debug
+debug and build-id not linked
 
94. rpmbuildid.at:153: 94. rpmbuild buildid alldebug unique debug names (rpmbuildid.at:153): FAILED (rpmbuildid.at:155)
#                             -*- compilation -*-
95. rpmbuildid.at:246: testing rpmbuild buildid separate ...
./rpmbuildid.at:248:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Setup sources
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Build, contains one ELF which should have a buildid.
run rpmbuild \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_build_id_links separate" \
  --undefine "_unique_debug_names" \
  --undefine "_unique_debug_srcs" \
  --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package
# plus the .build-id/xx subdir, 2 in total.
echo -n "hello build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
echo -n "hello debuginfo build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
# Extract the both packages to check the build-id files link to the
# main and .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | cpio -diu
# Check there is a build-id symlink for the main file.
main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
id_main=$(file $main_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
canon_main_file=$(readlink -f ${main_file})
test -f "$canon_main_file" \
  || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
canon_main_id_file=$(readlink -f ${id_main_file})
test -f "$canon_main_id_file" \
  || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
test "$canon_main_file" = "$canon_main_id_file" \
  || echo "main and build-id file not linked"
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
canon_debug_file=$(readlink -f ${debug_file})
test -f "$canon_debug_file" \
  || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
canon_debug_id_file=$(readlink -f ${id_debug_file})
test -f "$canon_debug_id_file" \
  || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
test "$canon_debug_file" = "$canon_debug_id_file" \
  || echo "debug and build-id not linked"
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/95/test-source: line 155: test: too many arguments
--- -   2017-07-25 19:40:47.361677883 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/95/stdout   2017-07-25 19:40:47.359415844 +0000
@@ -1,3 +1,26 @@
-hello build-id files: 2
-hello debuginfo build-id files: 2
+hello build-id files: 0
+hello debuginfo build-id files: 0
+No main file ./usr/local/bin/hello
+No build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve main file ./usr/local/bin/hello -> 
+Cannot resolve main build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/directory)
+main and build-id file not linked
+No debug file ./usr/lib/debug/usr/local/bin/hello.debug
+unequal main and debug id
+No build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello.debug: cannot open `./usr/lib/debug/usr/local/bin/hello.debug' (No such file or directory).debug
+Cannot resolve debug file ./usr/lib/debug/usr/local/bin/hello.debug -> 
+Cannot resolve debug build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello.debug: cannot open `./usr/lib/debug/usr/local/bin/hello.debug' (No such file or directory).debug -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/095/directory).debug
+debug and build-id not linked
 
95. rpmbuildid.at:246: 95. rpmbuild buildid separate (rpmbuildid.at:246): FAILED (rpmbuildid.at:248)
#                             -*- compilation -*-
96. rpmbuildid.at:339: testing rpmbuild buildid separate unique debug names ...
./rpmbuildid.at:341:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Setup sources
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Build, contains one ELF which should have a buildid.
run rpmbuild \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_build_id_links separate" \
  --define="_unique_debug_names 1" \
  --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package
# plus the .build-id/xx subdir, 2 in total.
echo -n "hello build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
echo -n "hello debuginfo build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
# Extract the both packages to check the build-id files link to the
# main and .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | cpio -diu
# Check there is a build-id symlink for the main file.
main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
id_main=$(file $main_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
canon_main_file=$(readlink -f ${main_file})
test -f "$canon_main_file" \
  || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
canon_main_id_file=$(readlink -f ${id_main_file})
test -f "$canon_main_id_file" \
  || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
test "$canon_main_file" = "$canon_main_id_file" \
  || echo "main and build-id file not linked"
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello-*.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
canon_debug_file=$(readlink -f ${debug_file})
test -f "$canon_debug_file" \
  || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
canon_debug_id_file=$(readlink -f ${id_debug_file})
test -f "$canon_debug_id_file" \
  || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
test "$canon_debug_file" = "$canon_debug_id_file" \
  || echo "debug and build-id not linked"
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/96/test-source: line 153: test: too many arguments
--- -   2017-07-25 19:40:47.645871664 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/96/stdout   2017-07-25 19:40:47.643415627 +0000
@@ -1,3 +1,26 @@
-hello build-id files: 2
-hello debuginfo build-id files: 2
+hello build-id files: 0
+hello debuginfo build-id files: 0
+No main file ./usr/local/bin/hello
+No build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve main file ./usr/local/bin/hello -> 
+Cannot resolve main build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/directory)
+main and build-id file not linked
+No debug file ./usr/lib/debug/usr/local/bin/hello-*.debug
+unequal main and debug id
+No build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello-*.debug: cannot open `./usr/lib/debug/usr/local/bin/hello-*.debug' (No such file or directory).debug
+Cannot resolve debug file ./usr/lib/debug/usr/local/bin/hello-*.debug -> 
+Cannot resolve debug build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello-*.debug: cannot open `./usr/lib/debug/usr/local/bin/hello-*.debug' (No such file or directory).debug -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/096/directory).debug
+debug and build-id not linked
 
96. rpmbuildid.at:339: 96. rpmbuild buildid separate unique debug names (rpmbuildid.at:339): FAILED (rpmbuildid.at:341)
#                             -*- compilation -*-
97. rpmbuildid.at:431: testing rpmbuild buildid compat ...
./rpmbuildid.at:433:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Setup sources
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Build, contains one ELF which should have a buildid.
run rpmbuild \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_build_id_links compat" \
  --undefine "_unique_debug_names" \
  --undefine "_unique_debug_srcs" \
  --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package.
# the debuginfo package has one extra main build-id compat symlink
# plus the .build-id/xx subdir, 2 in total in main, 3 in total in debug
echo -n "hello build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
echo -n "hello debuginfo build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
# Extract the both packages to check the build-id files link to the
# main and .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | cpio -diu
# Check there is a build-id symlink for the main file.
main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
id_main=$(file $main_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
canon_main_file=$(readlink -f ${main_file})
test -f "$canon_main_file" \
  || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
canon_main_id_file=$(readlink -f ${id_main_file})
test -f "$canon_main_id_file" \
  || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
test "$canon_main_file" = "$canon_main_id_file" \
  || echo "main and build-id file not linked"
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello.debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
canon_debug_file=$(readlink -f ${debug_file})
test -f "$canon_debug_file" \
  || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
canon_debug_id_file=$(readlink -f ${id_debug_file})
test -f "$canon_debug_id_file" \
  || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
test "$canon_debug_file" = "$canon_debug_id_file" \
  || echo "debug and build-id not linked"
# The compat link should also point to the same (indirectly).
id_compat_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_compat_file" || echo "No build-id compat file $id_compat_file"
canon_compat_file=$(readlink -f ${id_compat_file})
test -f "$canon_compat_file" \
  || echo "Cannot resolve compat file ${id_compat_file} -> ${canon_compat_file}"
test "$canon_compat_file" = "$canon_main_file" \
  || echo "compat and build-id not linked"
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/97/test-source: line 169: test: too many arguments
--- -   2017-07-25 19:40:47.934014568 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/97/stdout   2017-07-25 19:40:47.931415407 +0000
@@ -1,3 +1,35 @@
-hello build-id files: 2
-hello debuginfo build-id files: 3
+hello build-id files: 0
+hello debuginfo build-id files: 0
+No main file ./usr/local/bin/hello
+No build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve main file ./usr/local/bin/hello -> 
+Cannot resolve main build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/directory)
+main and build-id file not linked
+No debug file ./usr/lib/debug/usr/local/bin/hello.debug
+unequal main and debug id
+No build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello.debug: cannot open `./usr/lib/debug/usr/local/bin/hello.debug' (No such file or directory).debug
+Cannot resolve debug file ./usr/lib/debug/usr/local/bin/hello.debug -> 
+Cannot resolve debug build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello.debug: cannot open `./usr/lib/debug/usr/local/bin/hello.debug' (No such file or directory).debug -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/directory).debug
+debug and build-id not linked
+No build-id compat file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve compat file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/097/directory)
+compat and build-id not linked
 
97. rpmbuildid.at:431: 97. rpmbuild buildid compat (rpmbuildid.at:431): FAILED (rpmbuildid.at:433)
#                             -*- compilation -*-
98. rpmbuildid.at:537: testing rpmbuild buildid compat unique debug names ...
./rpmbuildid.at:539:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
# Setup sources
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# Build, contains one ELF which should have a buildid.
run rpmbuild \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_build_id_links compat" \
  --define="_unique_debug_names 1" \
  --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package.
# the debuginfo package has one extra main build-id compat symlink
# plus the .build-id/xx subdir, 2 in total in main, 3 in total in debug
echo -n "hello build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
echo -n "hello debuginfo build-id files: "
run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | grep /.build-id/ | wc --lines
# Extract the both packages to check the build-id files link to the
# main and .debug files.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
  | cpio -diu
# Check there is a build-id symlink for the main file.
main_file=./usr/local/bin/hello
test -f "${main_file}" || echo "No main file ${main_file}"
# Extract the build-id from the main file
id_main=$(file $main_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_main_file" || echo "No build-id file $id_main_file"
canon_main_file=$(readlink -f ${main_file})
test -f "$canon_main_file" \
  || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
canon_main_id_file=$(readlink -f ${id_main_file})
test -f "$canon_main_id_file" \
  || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
test "$canon_main_file" = "$canon_main_id_file" \
  || echo "main and build-id file not linked"
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello-*debug
test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
test ${id_main} = ${id_debug} || echo "unequal main and debug id"
id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
canon_debug_file=$(readlink -f ${debug_file})
test -f "$canon_debug_file" \
  || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
canon_debug_id_file=$(readlink -f ${id_debug_file})
test -f "$canon_debug_id_file" \
  || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
test "$canon_debug_file" = "$canon_debug_id_file" \
  || echo "debug and build-id not linked"
# The compat link should also point to the same (indirectly).
id_compat_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
test -L "$id_compat_file" || echo "No build-id compat file $id_compat_file"
canon_compat_file=$(readlink -f ${id_compat_file})
test -f "$canon_compat_file" \
  || echo "Cannot resolve compat file ${id_compat_file} -> ${canon_compat_file}"
test "$canon_compat_file" = "$canon_main_file" \
  || echo "compat and build-id not linked"
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/98/test-source: line 167: test: too many arguments
--- -   2017-07-25 19:40:48.218699346 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/98/stdout   2017-07-25 19:40:48.216415189 +0000
@@ -1,3 +1,35 @@
-hello build-id files: 2
-hello debuginfo build-id files: 3
+hello build-id files: 0
+hello debuginfo build-id files: 0
+No main file ./usr/local/bin/hello
+No build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve main file ./usr/local/bin/hello -> 
+Cannot resolve main build-id file ./usr/lib/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/directory)
+main and build-id file not linked
+No debug file ./usr/lib/debug/usr/local/bin/hello-*debug
+unequal main and debug id
+No build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello-*debug: cannot open `./usr/lib/debug/usr/local/bin/hello-*debug' (No such file or directory).debug
+Cannot resolve debug file ./usr/lib/debug/usr/local/bin/hello-*debug -> 
+Cannot resolve debug build-id file ./usr/lib/debug/.build-id/.//usr/lib/debug/usr/local/bin/hello-*debug: cannot open `./usr/lib/debug/usr/local/bin/hello-*debug' (No such file or directory).debug -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/directory).debug
+debug and build-id not linked
+No build-id compat file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
+Cannot resolve compat file ./usr/lib/debug/.build-id/.//usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory) -> /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/cannot
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/open
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/(No
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/such
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/file
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/or
+/builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/098/directory)
+compat and build-id not linked
 
98. rpmbuildid.at:537: 98. rpmbuild buildid compat unique debug names (rpmbuildid.at:537): FAILED (rpmbuildid.at:539)
#                             -*- compilation -*-
106. rpmbuildid.at:1187: testing rpmbuild buildid unique r1 r2 ...
./rpmbuildid.at:1189:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# No warnings for hard links
run rpmbuild --quiet \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_unique_build_ids 1" \
  -ba "${abs_srcdir}"/data/SPECS/hello.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu --quiet
hello_file=./usr/local/bin/hello
# Extract the build-id from the main file
test -f $hello_file || echo "No $hello_file"
id1=$(file $hello_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
# Make sure we generate a new one
rm $hello_file
# Build the "next" release, which has no changes except for the release update.
run rpmbuild --quiet \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --define="_unique_build_ids 1" \
  -ba "${abs_srcdir}"/data/SPECS/hello-r2.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-2.*.rpm \
  | cpio -diu --quiet
# Extract the build-id from the main file
test -f $hello_file || echo "No $hello_file"
id2=$(file $hello_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
if test "$id1" == "$id2"; then echo "equal $id1"; else echo "unequal"; fi
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rm: cannot remove './usr/local/bin/hello': No such file or directory
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-2.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-2.*.rpm: No such file or directory
cpio: premature end of archive
--- -   2017-07-25 19:40:52.208995929 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/106/stdout  2017-07-25 19:40:52.206412137 +0000
@@ -1,2 +1,4 @@
-unequal
+No ./usr/local/bin/hello
+No ./usr/local/bin/hello
+equal ./usr/local/bin/hello: cannot open `./usr/local/bin/hello' (No such file or directory)
 
106. rpmbuildid.at:1187: 106. rpmbuild buildid unique r1 r2 (rpmbuildid.at:1187): FAILED (rpmbuildid.at:1189)
#                             -*- compilation -*-
107. rpmbuildid.at:1239: testing rpmbuild buildid non-unique r1 r2 ...
./rpmbuildid.at:1241:
rm -rf ${TOPDIR}
as_dir=${TOPDIR}/SOURCES; as_fn_mkdir_p
cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
# No warnings for hard links
run rpmbuild --quiet \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --undefine="_unique_build_ids" \
  --undefine="_unique_debug_names" \
  --undefine="_unique_debug_srcs" \
  -ba "${abs_srcdir}"/data/SPECS/hello.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
  | cpio -diu --quiet
hello_file=./usr/local/bin/hello
# Extract the build-id from the main file
test -f $hello_file || echo "No $hello_file"
id1=$(file $hello_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
# Make sure we generate a new one
rm $hello_file
# Build the "next" release, which has no changes except for the release update.
run rpmbuild --quiet \
  --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
  --rcfile=${abs_top_builddir}/rpmrc \
  --undefine="_unique_build_ids" \
  --undefine="_unique_debug_names" \
  --undefine="_unique_debug_srcs" \
  -ba "${abs_srcdir}"/data/SPECS/hello-r2.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-2.*.rpm \
  | cpio -diu --quiet
# Extract the build-id from the main file
test -f $hello_file || echo "No $hello_file"
id2=$(file $hello_file | sed 's/.*, BuildID\[.*\]=\([0-9a-f]*\),.*/\1/')
if test "$id1" == "$id2"; then echo "equal"; else echo "unequal $id1 $id2"; fi
stderr:
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-1.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-1.*.rpm: No such file or directory
cpio: premature end of archive
rm: cannot remove './usr/local/bin/hello': No such file or directory
gdb-add-index: No index was created for /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILDROOT/hello-1.0-2.%{_arch}/usr/local/bin/hello
gdb-add-index: [Was there no debuginfo? Was there already an index?]
error: Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
    Empty %files file /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/BUILD/hello-1.0/debugsourcefiles.list
rpm2cpio: /builddir/build/BUILD/rpm-4.13.0.1/tests/testing/build/RPMS/*/hello-1.0-2.*.rpm: No such file or directory
cpio: premature end of archive
--- -   2017-07-25 19:40:52.707983039 +0000
+++ /builddir/build/BUILD/rpm-4.13.0.1/tests/rpmtests.dir/at-groups/107/stdout  2017-07-25 19:40:52.705411755 +0000
@@ -1,2 +1,4 @@
+No ./usr/local/bin/hello
+No ./usr/local/bin/hello
 equal
 
107. rpmbuildid.at:1239: 107. rpmbuild buildid non-unique r1 r2 (rpmbuildid.at:1239): FAILED (rpmbuildid.at:1241)
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/rpm-software-management/rpm/issues/277">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ANb804nwT_BoOZovcaHIuFBa5tyjlkyHks5sRkgggaJpZM4OjDC0">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ANb808n60pklMXHmlT5rJlXe0lY36tE1ks5sRkgggaJpZM4OjDC0.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/rpm-software-management/rpm/issues/277"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/rpm-software-management/rpm","title":"rpm-software-management/rpm","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/rpm-software-management/rpm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"_debugsource_packages break tests (#277)"}],"action":{"name":"View Issue","url":"https://github.com/rpm-software-management/rpm/issues/277"}}}</script>