All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [PATCH qemu.vzspecs hci-8.1 1/2] coverage: keep headers with absolute paths in sources archive #VSTOR-154473
@ 2026-11-13 16:37 Andrey Drobyshev
  2026-11-13 16:37 ` [PATCH qemu.vzspecs hci-8.1 2/2] coverage: pack sources of the static build too Andrey Drobyshev
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Drobyshev @ 2026-11-13 16:37 UTC (permalink / raw)
  To: svt-core; +Cc: ilia.solovykh, artem.vasiliev, den, andrey.drobyshev

QEMU adds its include dirs with absolute paths (-iquote <srcdir>/include).
So ninja records most of the headers, e.g. include/qemu/*.h, by absolute
path.  We dropped all absolute paths to skip system headers, and these
headers got dropped along with them.  As a result, the archive had no
include/ dir at all: 284 headers with coverage data were missing.

lcov then failed on the first missing one, and no qemu report was built:

  geninfo: ERROR: unable to open .../include/system/confidential-guest-support.h

Let's first make all paths relative to the source tree and only then
skip the ones outside of it.

Fixes: 78390c804b30 ("coverage: pack only compiled sources in a reproducible way #VSTOR-151318")
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
 qemu-kvm.spec | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/qemu-kvm.spec b/qemu-kvm.spec
index 21d7c58a..55287fc3 100644
--- a/qemu-kvm.spec
+++ b/qemu-kvm.spec
@@ -2238,15 +2238,14 @@ find %{qemu_kvm_build} -name '*.gcno' -printf '%%h\n' | sort -u | \
 
 install -m 0644 %{SOURCE2} ./sonar-project.properties
 
-# Only pack the sources which compiler read (including generated ones).
-#
-# Ninja records every input of every object relative to the build dir:
-# drop system headers, rebase onto the tree root, filter the sources.
+# Pack only the source files the compiler actually used, generated ones
+# included.  Ninja knows them for each build.  We make every path relative
+# to the source tree and skip files outside it, like system headers.
 set -o pipefail
 ninja -C %{qemu_kvm_build} -t deps |
     sed -En 's/^[[:space:]]+//p' |
-    grep -v '^/' |
     (cd %{qemu_kvm_build} && xargs realpath -ms --relative-to=..) |
+    grep -v '^\.\./' |
     grep -E '\.([chS]|inc)$' |
     LC_ALL=C sort -u |
     tar --mtime=@0 --owner=0 --group=0 --numeric-owner \
-- 
2.47.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-13 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 16:37 [PATCH qemu.vzspecs hci-8.1 1/2] coverage: keep headers with absolute paths in sources archive #VSTOR-154473 Andrey Drobyshev
2026-11-13 16:37 ` [PATCH qemu.vzspecs hci-8.1 2/2] coverage: pack sources of the static build too Andrey Drobyshev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.