Skip to contentSkip to conversation

Fixes for the --without-default-features configure switch

PATCH Applied Thomas Huth 5 participants 12 messages Jul 13, 2021 – Jul 14, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover Fixes for the --without-default-features configure switch

Many features do not get properly disabled when the user runs the configure script with --without-default-features. Let's fix that now.

Thomas Huth (4):
configure: Fix --without-default-features propagation to meson
configure: Allow vnc to get disabled with --without-default-features
configure: Fix the default setting of the "xen" feature
configure: Let --without-default-features disable vhost-kernel and
vhost-vdpa

 configure   | 8 +++++---
 meson.build | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/4 configure: Fix --without-default-features propagation to meson

A typo prevents that many features get disabled when the user runs "configure" with the --without-default-features switch.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 85db248ac1..229ea52516 100755
@@ -5205,7 +5205,7 @@ if test "$skip_meson" = no; then
         -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
         -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \
         -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\
-        $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
+        $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \
 	-Dtcg_interpreter=$tcg_interpreter \
         $cross_arg \
         "$PWD" "$source_path"
Signature · 1 line
2.27.0
#2 lore raw

Re: [PATCH 1/4] configure: Fix --without-default-features propagation to meson

+Alex

Quoted 14 lines · Thomas Huth

A typo prevents that many features get disabled when the user runs "configure" with the --without-default-features switch.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +0 -0
index 85db248ac1..229ea52516 100755

configure if test "$skip_meson" = no; then · line 5208

Quoted 5 lines
configure +1 -1
@@ -5205,7 +5205,7 @@ if test "$skip_meson" = no; then
         -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
         -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \
         -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\
-        $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
+        $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \

The option should be name plural (default_features)...

What is 'auto_features' used for?

Quoted 4 lines
configure +0 -0
 	-Dtcg_interpreter=$tcg_interpreter \
         $cross_arg \
         "$PWD" "$source_path"
#3 lore raw

Re: [PATCH 1/4] configure: Fix --without-default-features propagation to meson

Quoted 12 lines · Philippe Mathieu-Daudé

+Alex

Quoted 9 lines · Thomas Huth

A typo prevents that many features get disabled when the user runs "configure" with the --without-default-features switch.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

configure if test "$skip_meson" = no; then · line 5208

Quoted 10 lines
configure +1 -1
index 85db248ac1..229ea52516 100755
@@ -5205,7 +5205,7 @@ if test "$skip_meson" = no; then
         -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
         -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \
         -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\
-        $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
+        $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \

The option should be name plural (default_features)...

Actually, no. The variable holds the initial value for the feature variables that are to be controlled by --with-default-features. Example:

vde="$default_feature"

Perhaps $feature_default would be a better name.

Quoted 6 lines

What is 'auto_features' used for?

Quoted 4 lines
configure +0 -0
 	-Dtcg_interpreter=$tcg_interpreter \
         $cross_arg \
         "$PWD" "$source_path"
#4 lore raw

Re: [PATCH 1/4] configure: Fix --without-default-features propagation to meson

In reply to Philippe Mathieu-Daudé
Quoted 12 lines · Philippe Mathieu-Daudé

+Alex

Quoted 9 lines · Thomas Huth

A typo prevents that many features get disabled when the user runs "configure" with the --without-default-features switch.

---
  configure | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

configure if test "$skip_meson" = no; then · line 5208

Quoted 10 lines
configure +1 -1
index 85db248ac1..229ea52516 100755
@@ -5205,7 +5205,7 @@ if test "$skip_meson" = no; then
          -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
          -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \
          -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\
-        $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
+        $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \

The option should be name plural (default_features)...

I agree with Markus - the way it is used in the configure script, it's rather meant as singular.

Quoted 1 line

What is 'auto_features' used for?

https://mesonbuild.com/Build-options.html#features

HTH,
Thomas

#5 lore raw

Re: [PATCH 1/4] configure: Fix --without-default-features propagation to meson

Quoted 31 lines · Thomas Huth
Quoted 21 lines · Philippe Mathieu-Daudé

+Alex

Quoted 18 lines · Thomas Huth

A typo prevents that many features get disabled when the user runs "configure" with the --without-default-features switch.

---
  configure | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
configure +0 -0
index 85db248ac1..229ea52516 100755
@@ -5205,7 +5205,7 @@ if test "$skip_meson" = no; then

          -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
          -Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \

Quoted 8 lines
Quoted 6 lines

          -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\
-        $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
+        $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \

The option should be name plural (default_features)...

Quoted 2 lines

I agree with Markus - the way it is used in the configure script, it's rather meant as singular.

OK.

Quoted 3 lines
Quoted 1 line

What is 'auto_features' used for?

https://mesonbuild.com/Build-options.html#features

I see, thank you.

#6 lore raw

PATCH 2/4 configure: Allow vnc to get disabled with --without-default-features

In reply to Thomas Huth

There's no reason why we should keep VNC enabled when the user specified --without-default-features.

---
 configure   | 2 +-
 meson.build | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
configure +1 -1
index 229ea52516..1974c46f6e 100755
@@ -304,7 +304,7 @@ virtiofsd="auto"
 virtfs="auto"
 libudev="auto"
 mpath="auto"
-vnc="enabled"
+vnc="auto"
 sparse="auto"
 vde="$default_feature"
 vnc_sasl="auto"
meson.build +1 -1
index 6cd2dc582a..5dedaf73e3 100644
@@ -900,7 +900,7 @@ vnc = not_found
 png = not_found
 jpeg = not_found
 sasl = not_found
-if get_option('vnc').enabled()
+if not get_option('vnc').disabled()
   vnc = declare_dependency() # dummy dependency
   png = dependency('libpng', required: get_option('vnc_png'),
                    method: 'pkg-config', kwargs: static_kwargs)
Signature · 1 line
2.27.0
#7 lore raw

PATCH 3/4 configure: Fix the default setting of the "xen" feature

In reply to Thomas Huth

The "xen" variable should either contain "enabled", "disabled" or nothing (for auto detection). But when the user currently runs the configure script with --without-default-features, it gets set to "no" instead. This does not work as expected, the feature will still be enabled if the Xen headers are present. Thus set the variable to "disabled" instead if default_feature switch has been set.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
index 1974c46f6e..6c7336b763 100755
@@ -311,7 +311,7 @@ vnc_sasl="auto"
 vnc_jpeg="auto"
 vnc_png="auto"
 xkbcommon="auto"
-xen="$default_feature"
+xen=${default_feature:+disabled}
 xen_ctrl_version="$default_feature"
 xen_pci_passthrough="auto"
 linux_aio="$default_feature"
Signature · 1 line
2.27.0
#8 lore raw

PATCH 4/4 configure: Let --without-default-features disable vhost-kernel and vhost-vdpa

In reply to Thomas Huth

The vhost_kernel and vhost_vdpa variables should be pre-initialized with the $default_feature setting so that these features get disabled when the user runs the configure scripts with --without-default-features.

---
 configure | 2 ++
 1 file changed, 2 insertions(+)
configure +2 -0
index 6c7336b763..89cc9b24eb 100755
@@ -321,6 +321,7 @@ attr="auto"
 xfs="$default_feature"
 tcg="enabled"
 membarrier="$default_feature"
+vhost_kernel="$default_feature"
 vhost_net="$default_feature"
 vhost_crypto="$default_feature"
 vhost_scsi="$default_feature"
@@ -328,6 +329,7 @@ vhost_vsock="$default_feature"
 vhost_user="no"
 vhost_user_blk_server="auto"
 vhost_user_fs="$default_feature"
+vhost_vdpa="$default_feature"
 bpf="auto"
 kvm="auto"
 hax="auto"
Signature · 1 line
2.27.0
#9 lore raw
In reply to Thomas Huth
Quoted 10 lines · Thomas Huth

Many features do not get properly disabled when the user runs the configure script with --without-default-features. Let's fix that now.

Thomas Huth (4):
configure: Fix --without-default-features propagation to meson
configure: Allow vnc to get disabled with --without-default-features
configure: Fix the default setting of the "xen" feature
configure: Let --without-default-features disable vhost-kernel and
vhost-vdpa

Patches look fine and fix some issues but others persist (--disable-system isn't triggered). IMO this needs an audit, but more importantly 'configure' should be rearranged a bit to make this less likely to regress:

* move all the --enable/--disable variable init into one section with nothing else mixed in

* convert the values to all use $default_yes/no/auto/enabled/disabled/... variable syntax so visually it's consistent, and if a default is ever changed like $default_no -> $default_yes then we behave correctly (as opposed to 'no' -> 'yes').

Thanks,
Cole

#10 lore raw
Quoted 2 lines · Cole Robinson

Patches look fine and fix some issues but others persist (--disable-system isn't triggered).

I wouldn't say --disable-system counts as a feature, since it's really a shortcut for choosing a subset of the targets. Likewise for linux_user and bsd_user.

Quoted 11 lines

IMO this needs an audit, but more
importantly 'configure' should be rearranged a bit to make this less likely to regress:

* move all the --enable/--disable variable init into one section with nothing else mixed in

* convert the values to all use $default_yes/no/auto/enabled/disabled/... variable syntax so visually it's consistent, and if a default is ever changed like $default_no -> $default_yes then we behave correctly (as opposed to 'no' -> 'yes').

This is a nice idea. We should only have default_yes/no/auto, plus "auto" for Meson options.

Also there's the idea of parsing --enable/--disable options for Meson options automatically from the introspection data. This has the advantage that you get the default automatically from meson_options.txt and -Dauto_features, without any code in configure.

Paolo

#11 lore raw
In reply to Thomas Huth
Quoted 10 lines · Thomas Huth

Many features do not get properly disabled when the user runs the configure script with --without-default-features. Let's fix that now.

Thomas Huth (4):
configure: Fix --without-default-features propagation to meson
configure: Allow vnc to get disabled with --without-default-features
configure: Fix the default setting of the "xen" feature
configure: Let --without-default-features disable vhost-kernel and
vhost-vdpa

Quoted 4 lines
  configure   | 8 +++++---
  meson.build | 2 +-
  2 files changed, 6 insertions(+), 4 deletions(-)

Queued, thanks.

Paolo