[PATCH] meson: Only check for openwsman if hyperv is enabled

Jim Fehlig posted 1 patch 3 years, 8 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20200827215829.18727-1-jfehlig@suse.com
meson.build | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
[PATCH] meson: Only check for openwsman if hyperv is enabled
Posted by Jim Fehlig 3 years, 8 months ago
Running meson configure with '-Ddriver_hyperv=disabled' fails with

  meson.build:1252:0: ERROR: Dependency "openwsman" not found, tried
  pkgconfig and cmake

openwsman is only required if the hyperv driver is enabled. Don't
check for it if hyperv is disabled.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---

There are likely other ways to fix the problem, this being a meson
noobish one :-).

 meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index dabd4196e6..e3e768cab6 100644
--- a/meson.build
+++ b/meson.build
@@ -1249,7 +1249,11 @@ if numactl_dep.found()
 endif
 
 openwsman_version = '2.2.3'
-openwsman_dep = dependency('openwsman', version: '>=' + openwsman_version, required: get_option('openwsman'))
+if get_option('driver_hyperv').enabled()
+  openwsman_dep = dependency('openwsman', version: '>=' + openwsman_version, required: get_option('openwsman'))
+else
+  openwsman_dep = dependency('', required: false)
+endif
 
 parallels_sdk_version = '7.0.22'
 parallels_sdk_dep = dependency('parallels-sdk', version: '>=' + parallels_sdk_version, required: false)
-- 
2.28.0


Re: [PATCH] meson: Only check for openwsman if hyperv is enabled
Posted by Pavel Hrdina 3 years, 8 months ago
On Thu, Aug 27, 2020 at 03:58:29PM -0600, Jim Fehlig wrote:
> Running meson configure with '-Ddriver_hyperv=disabled' fails with
> 
>   meson.build:1252:0: ERROR: Dependency "openwsman" not found, tried
>   pkgconfig and cmake
> 
> openwsman is only required if the hyperv driver is enabled. Don't
> check for it if hyperv is disabled.
> 
> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> ---
> 
> There are likely other ways to fix the problem, this being a meson
> noobish one :-).

You are probably using some other options as well because running:

    meson build -Ddriver_hyperv=disabled

will not fail if openwsman is missing. The default for openwsman is
'auto'.

Pavel
Re: [PATCH] meson: Only check for openwsman if hyperv is enabled
Posted by Jim Fehlig 3 years, 8 months ago
On 8/28/20 2:00 AM, Pavel Hrdina wrote:
> On Thu, Aug 27, 2020 at 03:58:29PM -0600, Jim Fehlig wrote:
>> Running meson configure with '-Ddriver_hyperv=disabled' fails with
>>
>>    meson.build:1252:0: ERROR: Dependency "openwsman" not found, tried
>>    pkgconfig and cmake
>>
>> openwsman is only required if the hyperv driver is enabled. Don't
>> check for it if hyperv is disabled.
>>
>> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
>> ---
>>
>> There are likely other ways to fix the problem, this being a meson
>> noobish one :-).
> 
> You are probably using some other options as well because running:
> 
>      meson build -Ddriver_hyperv=disabled
> 
> will not fail if openwsman is missing. The default for openwsman is
> 'auto'.

I stumbled across it while doing downstream packaging work on 6.7.0. hyperv is 
the only thing that requires openwsman and I have it disabled. Here's the full 
meson invocation from the build log

/usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 
--libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin 
--includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man 
--infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc 
--localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload 
--auto-features=enabled . build --libexecdir=/usr/lib64/libvirt 
-Drunstatedir=/run -Ddriver_qemu=enabled -Ddriver_openvz=enabled 
-Ddriver_lxc=enabled -Ddriver_vbox=disabled -Ddriver_libxl=enabled 
-Dsasl=enabled -Dpolkit=enabled -Ddriver_libvirtd=enabled -Ddriver_esx=enabled 
-Ddriver_hyperv=disabled -Ddriver_vmware=enabled -Ddriver_vz=disabled 
-Ddriver_bhyve=disabled -Dremote_default_mode=legacy -Ddriver_interface=enabled 
-Ddriver_network=enabled -Dstorage_fs=enabled -Dstorage_lvm=enabled 
-Dstorage_iscsi=enabled -Dstorage_scsi=enabled -Dstorage_disk=enabled 
-Dstorage_mpath=enabled -Dstorage_rbd=enabled -Dstorage_sheepdog=disabled 
-Dstorage_gluster=enabled -Dstorage_iscsi_direct=enabled -Dstorage_zfs=disabled 
-Dstorage_vstorage=disabled -Dnumactl=enabled -Dnumad=enabled -Dcapng=enabled 
-Dfuse=enabled -Dnetcf=disabled -Dnetcontrol=enabled -Dselinux=enabled 
-Dselinux_mount=/selinux -Dapparmor=enabled -Dapparmor_profiles=true 
-Dhal=disabled -Dudev=enabled -Dyajl=enabled -Dsanlock=enabled -Dlibpcap=enabled 
-Dmacvtap=enabled -Daudit=enabled -Ddtrace=enabled -Dfirewalld=enabled 
-Dfirewalld_zone=enabled -Dwireshark_dissector=enabled -Dnss=enabled 
-Dqemu_user=qemu -Dqemu_group=qemu -Dlogin_shell=disabled -Dinit_script=systemd

...

meson.build:1258:0: ERROR: Dependency "openwsman" not found, tried pkgconfig and 
cmake

Regards,
Jim

Re: [PATCH] meson: Only check for openwsman if hyperv is enabled
Posted by Peter Krempa 3 years, 8 months ago
On Fri, Aug 28, 2020 at 07:52:23 -0600, Jim Fehlig wrote:
> On 8/28/20 2:00 AM, Pavel Hrdina wrote:
> > On Thu, Aug 27, 2020 at 03:58:29PM -0600, Jim Fehlig wrote:
> > > Running meson configure with '-Ddriver_hyperv=disabled' fails with
> > > 
> > >    meson.build:1252:0: ERROR: Dependency "openwsman" not found, tried
> > >    pkgconfig and cmake
> > > 
> > > openwsman is only required if the hyperv driver is enabled. Don't
> > > check for it if hyperv is disabled.
> > > 
> > > Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> > > ---
> > > 
> > > There are likely other ways to fix the problem, this being a meson
> > > noobish one :-).
> > 
> > You are probably using some other options as well because running:
> > 
> >      meson build -Ddriver_hyperv=disabled
> > 
> > will not fail if openwsman is missing. The default for openwsman is
> > 'auto'.
> 
> I stumbled across it while doing downstream packaging work on 6.7.0. hyperv
> is the only thing that requires openwsman and I have it disabled. Here's the
> full meson invocation from the build log
> 
> /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64
> --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin
> --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man
> --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc
> --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload
> --auto-features=enabled . build --libexecdir=/usr/lib64/libvirt

You've specified '--auto-features=enabled', so anything 'auto' is
considered enabled in your build situation.

Re: [PATCH] meson: Only check for openwsman if hyperv is enabled
Posted by Jim Fehlig 3 years, 8 months ago
On 8/28/20 8:02 AM, Peter Krempa wrote:
> On Fri, Aug 28, 2020 at 07:52:23 -0600, Jim Fehlig wrote:
>> On 8/28/20 2:00 AM, Pavel Hrdina wrote:
>>> On Thu, Aug 27, 2020 at 03:58:29PM -0600, Jim Fehlig wrote:
>>>> Running meson configure with '-Ddriver_hyperv=disabled' fails with
>>>>
>>>>     meson.build:1252:0: ERROR: Dependency "openwsman" not found, tried
>>>>     pkgconfig and cmake
>>>>
>>>> openwsman is only required if the hyperv driver is enabled. Don't
>>>> check for it if hyperv is disabled.
>>>>
>>>> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
>>>> ---
>>>>
>>>> There are likely other ways to fix the problem, this being a meson
>>>> noobish one :-).
>>>
>>> You are probably using some other options as well because running:
>>>
>>>       meson build -Ddriver_hyperv=disabled
>>>
>>> will not fail if openwsman is missing. The default for openwsman is
>>> 'auto'.
>>
>> I stumbled across it while doing downstream packaging work on 6.7.0. hyperv
>> is the only thing that requires openwsman and I have it disabled. Here's the
>> full meson invocation from the build log
>>
>> /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64
>> --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin
>> --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man
>> --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc
>> --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload
>> --auto-features=enabled . build --libexecdir=/usr/lib64/libvirt
> 
> You've specified '--auto-features=enabled', so anything 'auto' is
> considered enabled in your build situation.

Facepalm! Thanks for pointing out the obvious. I see that comes from %meson 
macro in /usr/lib/rpm/macros.d/macros.meson.

Regards,
Jim

Re: [PATCH] meson: Only check for openwsman if hyperv is enabled
Posted by Michal Privoznik 3 years, 8 months ago
On 8/28/20 4:19 PM, Jim Fehlig wrote:
> On 8/28/20 8:02 AM, Peter Krempa wrote:
>> On Fri, Aug 28, 2020 at 07:52:23 -0600, Jim Fehlig wrote:
>>> On 8/28/20 2:00 AM, Pavel Hrdina wrote:
>>>> On Thu, Aug 27, 2020 at 03:58:29PM -0600, Jim Fehlig wrote:
>>>>> Running meson configure with '-Ddriver_hyperv=disabled' fails with
>>>>>
>>>>>     meson.build:1252:0: ERROR: Dependency "openwsman" not found, tried
>>>>>     pkgconfig and cmake
>>>>>
>>>>> openwsman is only required if the hyperv driver is enabled. Don't
>>>>> check for it if hyperv is disabled.
>>>>>
>>>>> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
>>>>> ---
>>>>>
>>>>> There are likely other ways to fix the problem, this being a meson
>>>>> noobish one :-).
>>>>
>>>> You are probably using some other options as well because running:
>>>>
>>>>       meson build -Ddriver_hyperv=disabled
>>>>
>>>> will not fail if openwsman is missing. The default for openwsman is
>>>> 'auto'.
>>>
>>> I stumbled across it while doing downstream packaging work on 6.7.0. 
>>> hyperv
>>> is the only thing that requires openwsman and I have it disabled. 
>>> Here's the
>>> full meson invocation from the build log
>>>
>>> /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64
>>> --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin
>>> --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man
>>> --infodir=/usr/share/info --localedir=/usr/share/locale 
>>> --sysconfdir=/etc
>>> --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload
>>> --auto-features=enabled . build --libexecdir=/usr/lib64/libvirt
>>
>> You've specified '--auto-features=enabled', so anything 'auto' is
>> considered enabled in your build situation.
> 
> Facepalm! Thanks for pointing out the obvious. I see that comes from 
> %meson macro in /usr/lib/rpm/macros.d/macros.meson.

Also, meson warns that -Dnetcontrol=enabled doesn't exist.

Michal

Re: [PATCH] meson: Only check for openwsman if hyperv is enabled
Posted by Jim Fehlig 3 years, 8 months ago
On 8/28/20 8:48 AM, Michal Privoznik wrote:
> On 8/28/20 4:19 PM, Jim Fehlig wrote:
>> On 8/28/20 8:02 AM, Peter Krempa wrote:
>>> On Fri, Aug 28, 2020 at 07:52:23 -0600, Jim Fehlig wrote:
>>>> On 8/28/20 2:00 AM, Pavel Hrdina wrote:
>>>>> On Thu, Aug 27, 2020 at 03:58:29PM -0600, Jim Fehlig wrote:
>>>>>> Running meson configure with '-Ddriver_hyperv=disabled' fails with
>>>>>>
>>>>>>     meson.build:1252:0: ERROR: Dependency "openwsman" not found, tried
>>>>>>     pkgconfig and cmake
>>>>>>
>>>>>> openwsman is only required if the hyperv driver is enabled. Don't
>>>>>> check for it if hyperv is disabled.
>>>>>>
>>>>>> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
>>>>>> ---
>>>>>>
>>>>>> There are likely other ways to fix the problem, this being a meson
>>>>>> noobish one :-).
>>>>>
>>>>> You are probably using some other options as well because running:
>>>>>
>>>>>       meson build -Ddriver_hyperv=disabled
>>>>>
>>>>> will not fail if openwsman is missing. The default for openwsman is
>>>>> 'auto'.
>>>>
>>>> I stumbled across it while doing downstream packaging work on 6.7.0. hyperv
>>>> is the only thing that requires openwsman and I have it disabled. Here's the
>>>> full meson invocation from the build log
>>>>
>>>> /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64
>>>> --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin
>>>> --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man
>>>> --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc
>>>> --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload
>>>> --auto-features=enabled . build --libexecdir=/usr/lib64/libvirt
>>>
>>> You've specified '--auto-features=enabled', so anything 'auto' is
>>> considered enabled in your build situation.
>>
>> Facepalm! Thanks for pointing out the obvious. I see that comes from %meson 
>> macro in /usr/lib/rpm/macros.d/macros.meson.
> 
> Also, meson warns that -Dnetcontrol=enabled doesn't exist.

It's a message from an older log where I had the downstream netcontrol patch 
commented but not the meson define.

BTW, what is the value in having an option for something like openwsman? Isn't 
hyperv enough? If hyperv is enabled, then simply error if openwsman is not found.

Regards,
Jim