[libvirt PATCH] meson: Improve network driver enablement logic

Andrea Bolognani posted 1 patch 2 years, 3 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20211203135552.20507-1-abologna@redhat.com
meson.build | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[libvirt PATCH] meson: Improve network driver enablement logic
Posted by Andrea Bolognani 2 years, 3 months ago
The Homebrew package explicitly enables this driver despite us
disabling it by default on macOS, so it must be functional to
at least some extent and certainly can't be causing any build
failures.

Additionally, if the user has explicitly asked for the network
driver to be enabled but libvirtd is disabled for whatever
reason, we should error out instead of silently disabling the
network driver.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
Homebrew formula showing that the network driver is
explicitly enabled in the package:
https://github.com/Homebrew/homebrew-core/blob/3aff61292a3ed16bc715ba23fc2fa74251d82aa4/Formula/libvirt.rb#L58

Test pipeline showing that enabling the network driver by
default on macOS doesn't result in build failures:
https://gitlab.com/abologna/libvirt/-/pipelines/421956249

 meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index ba2f0d21de..cea8bbfa0c 100644
--- a/meson.build
+++ b/meson.build
@@ -1645,10 +1645,10 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a
   endif
 endif
 
-# there's no use compiling the network driver without the libvirt
-# daemon, nor compiling it for macOS, where it breaks the compile
-if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD') and host_machine.system() != 'darwin'
+if not get_option('driver_network').disabled() and conf.has('WITH_LIBVIRTD')
   conf.set('WITH_NETWORK', 1)
+elif get_option('driver_network').enabled()
+  error('libvirtd must be enabled to build the network driver')
 endif
 
 if udev_dep.found() and conf.has('WITH_LIBVIRTD')
-- 
2.31.1

Re: [libvirt PATCH] meson: Improve network driver enablement logic
Posted by Ján Tomko 2 years, 3 months ago
On a Friday in 2021, Andrea Bolognani wrote:
>The Homebrew package explicitly enables this driver despite us
>disabling it by default on macOS, so it must be functional to
>at least some extent and certainly can't be causing any build
>failures.
>
>Additionally, if the user has explicitly asked for the network
>driver to be enabled but libvirtd is disabled for whatever
>reason, we should error out instead of silently disabling the
>network driver.
>
>Signed-off-by: Andrea Bolognani <abologna@redhat.com>
>---
>Homebrew formula showing that the network driver is
>explicitly enabled in the package:
>https://github.com/Homebrew/homebrew-core/blob/3aff61292a3ed16bc715ba23fc2fa74251d82aa4/Formula/libvirt.rb#L58
>
>Test pipeline showing that enabling the network driver by
>default on macOS doesn't result in build failures:
>https://gitlab.com/abologna/libvirt/-/pipelines/421956249
>
> meson.build | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano