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

* [PATCH qemu.vzspecs hci-8.1 2/2] coverage: pack sources of the static build too
  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 ` Andrey Drobyshev
  0 siblings, 0 replies; 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

The qemu-ga we ship is built in qemu_kvm_static, so its coverage data
comes from there.  But we only packed the sources of qemu_kvm_build.
The files which only the static build compiles were missing from the
archive, e.g. crypto/hash-glib.c and qga/libdl-wrapper.c.

Let's pack the sources of both builds.

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 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/qemu-kvm.spec b/qemu-kvm.spec
index 55287fc3..1f17cc5f 100644
--- a/qemu-kvm.spec
+++ b/qemu-kvm.spec
@@ -2240,11 +2240,14 @@ install -m 0644 %{SOURCE2} ./sonar-project.properties
 
 # 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.
+# to the source tree and skip files outside it, like system headers.  The
+# static build is included too, since the qemu-ga we ship comes from it.
 set -o pipefail
-ninja -C %{qemu_kvm_build} -t deps |
-    sed -En 's/^[[:space:]]+//p' |
-    (cd %{qemu_kvm_build} && xargs realpath -ms --relative-to=..) |
+for b in %{qemu_kvm_build} %{?with_qga_static:%{qemu_kvm_static}}; do
+    ninja -C "$b" -t deps |
+        sed -En 's/^[[:space:]]+//p' |
+        (cd "$b" && xargs realpath -ms --relative-to=..)
+done |
     grep -v '^\.\./' |
     grep -E '\.([chS]|inc)$' |
     LC_ALL=C sort -u |
-- 
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.