x86_64-pc-linux-gnu-gcc -Isrc/util/libvirt_util.a.p -Isrc/util -I../libvirt-9.9.0/src/util -Iinclude -I../libvirt-9.9.0/include -Isrc -I ../libvirt-9.9.0/src -I. -I../libvirt-9.9.0 -I/usr/include/p11-kit-1 -I/usr/include/libnl3 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0 /include -I/usr/lib64/libffi/include -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libxml2 -I/ usr/include/yajl -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -fasynchronous-unwind-tables - fexceptions -fipa-pure-const -fno-common -Wabsolute-value -Waddress -Waddress-of-packed-member -Waggressive-loop-optimizations -Walloc-s ize-larger-than=9223372036854775807 -Walloca -Warray-bounds=2 -Wattribute-alias=2 -Wattribute-warning -Wattributes -Wbool-compare -Wbool -operation -Wbuiltin-declaration-mismatch -Wbuiltin-macro-redefined -Wcannot-profile -Wcast-align -Wcast-align=strict -Wno-cast-function -type -Wchar-subscripts -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdangling-else -Wdate-time -Wdeclaration-after-state ment -Wdeprecated-declarations -Wdesignated-init -Wdiscarded-array-qualifiers -Wdiscarded-qualifiers -Wdiv-by-zero -Wduplicated-cond -Wd uplicate-decl-specifier -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-contains-nul -Wformat-extra-args -Wno-format-nonlite ral -Wformat-overflow=2 -Wformat-security -Wno-format-truncation -Wformat-y2k -Wformat-zero-length -Wframe-address -Wframe-larger-than=2 048 -Wfree-nonheap-object -Whsa -Wif-not-aligned -Wignored-attributes -Wignored-qualifiers -Wimplicit -Wimplicit-fallthrough=5 -Wimplici t-function-declaration -Wimplicit-int -Wincompatible-pointer-types -Winit-self -Winline -Wint-conversion -Wint-in-bool-context -Wint-to- pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wlogical-not-parentheses -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args -Wmisleading-indentation -Wmissing-attributes -Wmissing-braces -Wmissing-declarations -Wmiss ing-field-initializers -Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-profile -Wmissing-prototypes -Wmultichar -Wmultistateme nt-macros -Wnarrowing -Wnested-externs -Wnonnull -Wnonnull-compare -Wnormalized=nfc -Wnull-dereference -Wodr -Wold-style-declaration -Wo ld-style-definition -Wopenmp-simd -Woverflow -Woverride-init -Wpacked-bitfield-compat -Wpacked-not-aligned -Wparentheses -Wpointer-arith -Wpointer-compare -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wpsabi -Wrestrict -Wreturn-local-addr -Wreturn-type -Wscalar-storage- order -Wsequence-point -Wshadow -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value -Wshift-overflow=2 -Wno-sign-compar e -Wsizeof-array-argument -Wsizeof-pointer-div -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes -Wstringop-overflow=2 -W stringop-truncation -Wsuggest-attribute=cold -Wno-suggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wno-s uggest-attribute=pure -Wsuggest-final-methods -Wsuggest-final-types -Wswitch -Wswitch-bool -Wswitch-enum -Wswitch-unreachable -Wsync-nan d -Wtautological-compare -Wtrampolines -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter - Wunused-but-set-variable -Wunused-const-variable=2 -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused- result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvla -Wvolatile-register-var -Wwrite -strings -fstack-protector-strong -Wdouble-promotion -O2 -pipe -ggdb -fdiagnostics-color=always -frecord-gcc-switches -fPIC -pthread -DI N_LIBVIRT '-Dabs_top_builddir="/tmp/portage/app-emulation/libvirt-9.9.0/work/libvirt-9.9.0-build"' '-Dabs_top_srcdir="/tmp/portage/app-e mulation/libvirt-9.9.0/work/libvirt-9.9.0"' -MD -MQ src/util/libvirt_util.a.p/virxml.c.o -MF src/util/libvirt_util.a.p/virxml.c.o.d -o s rc/util/libvirt_util.a.p/virxml.c.o -c ../libvirt-9.9.0/src/util/virxml.c ../libvirt-9.9.0/src/util/virxml.c: In function ‘virXMLFormatMetadata’: ../libvirt-9.9.0/src/util/virxml.c:1800:31: error: ‘xmlIndentTreeOutput’ undeclared (first use in this function); did you mean ‘oldInden tTreeOutput’? 1800 | int oldIndentTreeOutput = xmlIndentTreeOutput; | ^~~~~~~~~~~~~~~~~~~ | oldIndentTreeOutput Reproducible: Always
Created attachment 874979 [details] build.log
Created attachment 874980 [details] emerge --info
Caused by dev-libs/libxml2-2.12.0 i believe.
Yeah, there is something broken with new libxml2-2.12.0. And this is definitely something that the upstream needs to address. I'll investigate further next week when I'm back from my vacation. Feel free to reassign to me.
(In reply to Michal Prívozník from comment #4) > Yeah, there is something broken with new libxml2-2.12.0. And this is > definitely something that the upstream needs to address. I'll investigate > further next week when I'm back from my vacation. Feel free to reassign to > me. Thank you! It's always a pain when C applications start trying to do the right thing wrt const because you end up with this cascade. In this case, it might just be a missing include though (iirc upstream have rejigged it). There's a mix of failures with new libxml2 in other packages too.
Indeed. Libvirt's missing the following include: diff --git i/src/util/virxml.c w/src/util/virxml.c index 0c1eae8c3c..4f215a0e59 100644 --- i/src/util/virxml.c +++ w/src/util/virxml.c @@ -24,6 +24,7 @@ #include <math.h> /* for isnan() */ #include <sys/stat.h> +#include <libxml/xmlsave.h> #include <libxml/xpathInternals.h> #include "virerror.h" This allows libvirt to build, but it still uses now deprecated API (xmlKeepBlanksDefault), so I'll need to address that as well.
I've just merged patches that fix this issue into libvirt's upstream: 1fdca3083b lib: Replace xmlKeepBlanksDefault() with virXMLParseWithIndent() 69958ba310 virxml: Introduce parsing APIs that keep indentation 1beb69df87 virXMLParseHelper: Store XML parsing flags in a variable 7a5f232be2 virxml: include <libxml/xmlsave.h> for xmlIndentTreeOutput declaration Now, the most important commit is the last one (7a5f232be2) because it fixes the build error. The rest is to deal with the use of now deprecated function. I can backport it and the rest will be picked up by a rebase.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4de0e953c65c43911a883715c0c236f63d8aa0db commit 4de0e953c65c43911a883715c0c236f63d8aa0db Author: Michal Privoznik <michal.privoznik@gmail.com> AuthorDate: 2023-11-21 15:03:22 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-11-22 11:32:19 +0000 app-emulation/libvirt: Fix build with dev-libs/libxml2-2.12.0 As of its 2.12.0 release, libxml2 cleaned up header files which rendered libvirt unable to compile. Backport the fix from upstream repo. After this, there are still some warnings about use of a deprecated function, but those are harmless and we'll get fix with new release. Bug: https://bugs.gentoo.org/917516 Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/33929 Signed-off-by: Sam James <sam@gentoo.org> ...ude-libxml-xmlsave.h-for-xmlIndentTreeOut.patch | 36 ++++++++++++++++++++++ app-emulation/libvirt/libvirt-9.3.0-r1.ebuild | 1 + app-emulation/libvirt/libvirt-9.4.0-r4.ebuild | 1 + app-emulation/libvirt/libvirt-9.5.0-r1.ebuild | 1 + app-emulation/libvirt/libvirt-9.6.0.ebuild | 1 + app-emulation/libvirt/libvirt-9.8.0.ebuild | 1 + app-emulation/libvirt/libvirt-9.9.0.ebuild | 1 + 7 files changed, 42 insertions(+)