[PATCH] snapper: add configure option to control build (default: auto)

Matt Taylor liverbugg at rinux.org
Fri May 8 22:25:41 UTC 2020


As long as the option to disable is there that works for my scenario.
I figured since it was automatically including snapper if dbus was
found previously I would keep that automatic behavior.

Updated patch attached.  Snapper is enabled by default and configure
will error out if dbus is not found and --disable-snapper was not
passed.

I'm contributing as an individual with no corporate
involvement/restrictions, so does that mean no Signed-Off-by tag is
needed?  I have another trivial spelling patch to send after this.

Thanks,

-Matt

On Fri, May 8, 2020 at 4:36 PM Andrew Bartlett <abartlet at samba.org> wrote:
>
> On Fri, 2020-05-08 at 22:24 +0200, David Disseldorp via samba-technical
> wrote:
> > On Fri, 8 May 2020 14:05:16 -0400, Matt Taylor via samba-technical
> > wrote:
> >
> > > Recently the samba packages on Gentoo Linux had a hard dependency
> > > on
> > > dbus added.  This is because the vfs_snapper module is enabled
> > > automagically on the existence of dbus headers with no option to
> > > disable it.  See: https://bugs.gentoo.org/721320 for the Gentoo bug
> > > where it was suggested this be reported upstream.
> > >
> > > This patch adds a configure option to control the build of snapper
> > > similar to other vfs modules.
> > >
> > > Signed-off-by: Matt Taylor <liverbugg at rinux.org>
> >
> > Thanks for the patch Matt!
> > The change looks reasonable, although I think I'd prefer to see the
> > default be True, so that existing packagers aren't affected.
> >
> > Also, if this work is contributed on behalf of your employer, you'll
> > need to sign the DCO as described at:
> > https://www.samba.org/samba/devel/copyright-policy.html
>
> I agree.  I do not like ./configure parameters that default to 'auto'
> (and the same goes for features), because of the inverse of this, that
> the absense of a header on a build machine would mean that a feature is
> unintentionally lost.
>
> The recent practice has been to have a configure option to allow a
> distribution to disable a feature (as is desired here) but to otherwise
> give an error if the header/library is not available and point to the
> flag.
>
> Andrew Bartlett
>
> --
> Andrew Bartlett                       https://samba.org/~abartlet/
> Authentication Developer, Samba Team  https://samba.org
> Samba Developer, Catalyst IT
> https://catalyst.net.nz/services/samba
>
>
>
-------------- next part --------------
diff -ur samba-master/source3/wscript samba-master-patch/source3/wscript
--- samba-master/source3/wscript	2020-05-08 07:16:18.000000000 -0400
+++ samba-master-patch/source3/wscript	2020-05-08 17:22:48.000000000 -0400
@@ -75,6 +75,8 @@
     opt.samba_add_onoff_option('glusterfs', with_name="enable", without_name="disable", default=True)
     opt.samba_add_onoff_option('cephfs', with_name="enable", without_name="disable", default=True)
 
+    opt.samba_add_onoff_option('snapper', with_name="enable", without_name="disable", default=True)
+    
     opt.add_option('--enable-vxfs',
                   help=("enable support for VxFS (default=no)"),
                   action="store_true", dest='enable_vxfs', default=False)
@@ -1752,11 +1754,16 @@
     if Options.options.enable_vxfs:
         conf.DEFINE('HAVE_VXFS', '1')
 
-    if conf.CHECK_CFG(package='dbus-1', args='--cflags --libs',
+    if Options.options.with_snapper:
+        if conf.CHECK_CFG(package='dbus-1', args='--cflags --libs',
                       msg='Checking for dbus', uselib_store="DBUS-1"):
-        if (conf.CHECK_HEADERS('dbus/dbus.h', lib='dbus-1')
+            if (conf.CHECK_HEADERS('dbus/dbus.h', lib='dbus-1')
                                       and conf.CHECK_LIB('dbus-1', shlib=True)):
-            conf.DEFINE('HAVE_DBUS', '1')
+                conf.DEFINE('HAVE_DBUS', '1')
+        else:
+            conf.fatal("vfs_snapper is enabled but prerequisite DBUS libraries "
+                       "or headers not found. Use --disable-snapper to disable "
+                       "vfs_snapper support.");
 
     if conf.CHECK_CFG(package='liburing', args='--cflags --libs',
                       msg='Checking for liburing package', uselib_store="URING"):


More information about the samba-technical mailing list