[libvirt] [PATCH] build: avoid build failure without polkit

rpmbuild of mingw-libvirt.spec failed with: GEN libvirt.syms GEN libvirt_qemu.def cat: libvirt_access.syms: No such file or directory cat: libvirt_access_qemu.syms: No such file or directory cat: libvirt_access_lxc.syms: No such file or directory I traced this to unconditionally trying to use the ACL .syms files, even when polkit isn't in use. build: avoid build failure without polkit * src/Makefile.am (USED_SYM_FILES): Mark access driver symbols according to use. --- Even though this fixes a build-breaker (./autobuild.sh), I'm reluctant to push this without review. In particular, I'm worried that I may need a v2 that further conditionalizes whether libvirt_access_qemu.syms is sometimes omitted based on rpm arguments, even if libvirt_access.syms is present. src/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 4cf999d..042bcba 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1469,12 +1469,13 @@ $(ACCESS_DRIVER_POLKIT_POLICY): $(srcdir)/access/viraccessperm.h \ CLEANFILES += $(ACCESS_DRIVER_POLKIT_POLICY) BUILT_SOURCES += $(ACCESS_DRIVER_POLKIT_POLICY) +USED_SYM_FILES += $(ACCESS_DRIVER_SYMFILES) else EXTRA_DIST += $(ACCESS_DRIVER_POLKIT_SOURCES) +SYM_FILES += $(ACCESS_DRIVER_SYMFILES) endif -USED_SYM_FILES += $(ACCESS_DRIVER_SYMFILES) BUILT_SOURCES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_SYMFILES) CLEANFILES += $(ACCESS_DRIVER_GENERATED) $(ACCESS_DRIVER_SYMFILES) -- 1.8.1.4

On Mon, Jul 01, 2013 at 02:10:29PM -0600, Eric Blake wrote:
rpmbuild of mingw-libvirt.spec failed with:
GEN libvirt.syms GEN libvirt_qemu.def cat: libvirt_access.syms: No such file or directory cat: libvirt_access_qemu.syms: No such file or directory cat: libvirt_access_lxc.syms: No such file or directory
I traced this to unconditionally trying to use the ACL .syms files, even when polkit isn't in use.
Hmm, really ? The methods in these .syms files are actually methods that are inserted into all the driver method impls unconditionally. So we shouldn't make this conditional on polkit, rather we should fix the bug that causes them to be unused when polkit is missing. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 07/02/2013 03:43 AM, Daniel P. Berrange wrote:
On Mon, Jul 01, 2013 at 02:10:29PM -0600, Eric Blake wrote:
rpmbuild of mingw-libvirt.spec failed with:
GEN libvirt.syms GEN libvirt_qemu.def cat: libvirt_access.syms: No such file or directory cat: libvirt_access_qemu.syms: No such file or directory cat: libvirt_access_lxc.syms: No such file or directory
I traced this to unconditionally trying to use the ACL .syms files, even when polkit isn't in use.
Hmm, really ? The methods in these .syms files are actually methods that are inserted into all the driver method impls unconditionally. So we shouldn't make this conditional on polkit, rather we should fix the bug that causes them to be unused when polkit is missing.
I'll keep investigating, then. My next step will be to see if I can reproduce it on a --without-libvirtd local build, instead of being stuck with debugging mingw cross-compiling. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, Jul 02, 2013 at 07:49:50AM -0600, Eric Blake wrote:
On 07/02/2013 03:43 AM, Daniel P. Berrange wrote:
On Mon, Jul 01, 2013 at 02:10:29PM -0600, Eric Blake wrote:
rpmbuild of mingw-libvirt.spec failed with:
GEN libvirt.syms GEN libvirt_qemu.def cat: libvirt_access.syms: No such file or directory cat: libvirt_access_qemu.syms: No such file or directory cat: libvirt_access_lxc.syms: No such file or directory
I traced this to unconditionally trying to use the ACL .syms files, even when polkit isn't in use.
Hmm, really ? The methods in these .syms files are actually methods that are inserted into all the driver method impls unconditionally. So we shouldn't make this conditional on polkit, rather we should fix the bug that causes them to be unused when polkit is missing.
I'll keep investigating, then. My next step will be to see if I can reproduce it on a --without-libvirtd local build, instead of being stuck with debugging mingw cross-compiling.
Oh, is it a race condition in generating the .def file. The libvirt_access*.sym files are all auto-generated files. The .def file is also auto-generated, and there is no dep from the .def file onto the libvirt_acces*sym files to control execution order. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 07/02/2013 08:01 AM, Daniel P. Berrange wrote:
On Tue, Jul 02, 2013 at 07:49:50AM -0600, Eric Blake wrote:
On 07/02/2013 03:43 AM, Daniel P. Berrange wrote:
On Mon, Jul 01, 2013 at 02:10:29PM -0600, Eric Blake wrote:
rpmbuild of mingw-libvirt.spec failed with:
GEN libvirt.syms GEN libvirt_qemu.def cat: libvirt_access.syms: No such file or directory cat: libvirt_access_qemu.syms: No such file or directory cat: libvirt_access_lxc.syms: No such file or directory
Oh, is it a race condition in generating the .def file. The libvirt_access*.sym files are all auto-generated files. The .def file is also auto-generated, and there is no dep from the .def file onto the libvirt_acces*sym files to control execution order.
The problem is not the def file, but the libvirt.syms file. But the Makefile dependency is: libvirt.syms: libvirt_public.syms $(USED_SYM_FILES) \ $(top_builddir)/config.status which includes libvirt_access.syms, yet a verbose make shows that the failure is: ... printf 'global:\n\n' >>libvirt.syms-tmp && \ cat ../../src/libvirt_private.syms libvirt_access.syms libvirt_access_qemu.syms libvirt_access_lxc.syms ../../src/libvirt_esx.syms ../../src/libvirt_vmx.syms ../../src/libvirt_libssh2.syms >>libvirt.syms-tmp && \ printf '\n\nlocal:\n*;\n\n};' >>libvirt.syms-tmp && \ chmod a-w libvirt.syms-tmp && \ mv libvirt.syms-tmp libvirt.syms cat: libvirt_access.syms: No such file or directory cat: libvirt_access_qemu.syms: No such file or directory cat: libvirt_access_lxc.syms: No such file or directory so it may be a VPATH problem. In fact, looking at that line, look at how libvirt_access.syms is listed locally, while ../../src/libvirt_esx.syms is listed in another directory. I'm still playing with it... -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 07/02/2013 10:16 AM, Eric Blake wrote:
which includes libvirt_access.syms, yet a verbose make shows that the failure is:
... printf 'global:\n\n' >>libvirt.syms-tmp && \ cat ../../src/libvirt_private.syms libvirt_access.syms libvirt_access_qemu.syms libvirt_access_lxc.syms ../../src/libvirt_esx.syms ../../src/libvirt_vmx.syms ../../src/libvirt_libssh2.syms >>libvirt.syms-tmp && \ printf '\n\nlocal:\n*;\n\n};' >>libvirt.syms-tmp && \ chmod a-w libvirt.syms-tmp && \ mv libvirt.syms-tmp libvirt.syms cat: libvirt_access.syms: No such file or directory cat: libvirt_access_qemu.syms: No such file or directory cat: libvirt_access_lxc.syms: No such file or directory
so it may be a VPATH problem. In fact, looking at that line, look at how libvirt_access.syms is listed locally, while ../../src/libvirt_esx.syms is listed in another directory. I'm still playing with it...
Aha - light bulb moment. We have EXTRA_DIST += $(USED_SYM_FILES), which means tarballs are including something that should be generated. We have _other_ generated sym files that are intentionally not part of the tarball; looks like I need to do the same here. Now testing my theory. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake