[Gluster-devel] [PATCH v7] vfs_glusterfs: Samba VFS module for glusterfs

Anand Avati anand.avati at gmail.com
Wed May 29 01:33:29 UTC 2013


On Tue, May 28, 2013 at 4:47 PM, Anand Avati <avati at redhat.com> wrote:

> On 05/28/2013 03:42 PM, Anand Avati wrote:
>
>>
>>
>>
>> On Tue, May 28, 2013 at 2:46 PM, Andrew Bartlett <abartlet at samba.org
>> <mailto:abartlet at samba.org>> wrote:
>>
>>     On Tue, 2013-05-28 at 17:36 -0400, Anand Avati wrote:
>>      > Implement a Samba VFS plugin for glusterfs based on gluster's
>> gfapi.
>>      > This is a "bottom" vfs plugin (not something to be stacked on top
>> of
>>      > another module), and translates (most) calls into closest actions
>>      > on gfapi.
>>
>>     Thank you for your patience here.
>>
>>      > Signed-off-by: Anand Avati <avati at redhat.com
>>     <mailto:avati at redhat.com>>
>>
>>      > ---
>>      >
>>      > Hi,
>>      >
>>      > I hope the waf changes are fine. I could not test them because
>>     builds were failing generally on samba.git master HEAD.
>>
>>     You need to resolve whatever is causing your problems here, as it is
>> not
>>     a general issue. Our autobuild system ensures that git master and
>>     v4-0-test always compile and test in at least Ubuntu 10.04, and it is
>>     incredibly rare that it not work on at least Linux without it being a
>>     specifically local issue.
>>
>>     +
>>     +bld.SAMBA3_MODULE('vfs_**glusterfs',
>>     +                  subsystem='vfs',
>>     +                  source=VFS_GLUSTERFS_SRC,
>>     +                  deps='samba-util',
>>     +                  init_function='',
>>     +
>>       internal_module=bld.SAMBA3_IS_**STATIC_MODULE('vfs_glusterfs')**,
>>     +
>>       enabled=bld.SAMBA3_IS_ENABLED_**MODULE('vfs_glusterfs'))
>>
>>     You should ensure your module depends on glusterfs, by changing that
>> to
>>     adding deps='glusterfs samba-util' (and making that match what the
>>     conf.check_cfg finds and stores).
>>
>>
>> I tried that. I added uselib_store='glusterfs' and included 'glusterfs'
>> in deps= line. However while building I get this error:
>>
>> [avati at blackbox samba]$ make
>> WAF_MAKE=1 python ./buildtools/bin/waf build
>> ./buildtools/wafsamba/samba_**utils.py:397: DeprecationWarning: the md5
>> module is deprecated; use hashlib instead
>>    import md5
>> Waf: Entering directory `/home/avati/work/samba/bin'
>> Selected embedded Heimdal build
>> Checking project rules ...
>> Unknown dependency 'glusterfs' in 'vfs_glusterfs'
>> make: *** [all] Error 1
>>
>>
>> I am not familiar with waf, and trying to figure out how it works. I
>> don't understand how the check_cfg() in wscript and
>> source3/wscript_build's bld.SAMBA3_MODULE() actually integrate internally.
>>
>>      > diff --git a/source3/wscript b/source3/wscript
>>      > index dba6cdc..0d07692 100644
>>      > --- a/source3/wscript
>>      > +++ b/source3/wscript
>>      > @@ -59,6 +59,11 @@ def set_options(opt):
>>      >                     help=("Directory under which libcephfs is
>>     installed"),
>>      >                     action="store", dest='libcephfs_dir',
>>     default=None)
>>      >
>>      > +    opt.add_option('--enable-**glusterfs',
>>      > +                   help=("Enable building vfs_glusterfs module"),
>>      > +                   action="store_true", dest='enable_glusterfs',
>>     default=True)
>>      > +    opt.add_option('--disable-**glusterfs', help=SUPPRESS_HELP,
>>      > +                   action="store_false", dest='enable_glusterfs')
>>
>>     In general we would prefer not to have options for every possible
>>     module.  Instead, please just make it automatic based on finding
>>     glusterfs.
>>
>>
>> OK, I will just leave things to check_cfg() detection then?
>>
>>      >  def configure(conf):
>>      > @@ -1709,6 +1714,13 @@ main() {
>>      >      if conf.CHECK_HEADERS('cephfs/**libcephfs.h', False, False,
>>     'cephfs') and conf.CHECK_LIB('cephfs'):
>>      >          conf.DEFINE('HAVE_CEPH', '1')
>>      >
>>      > +    conf.env.enable_glusterfs = Options.options.enable_**
>> glusterfs
>>      > +
>>      > +    if Options.options.enable_**glusterfs:
>>      > +        conf.check_cfg(package='**glusterfs-api',
>>     args='"glusterfs-api >= 4" --cflags --libs',
>>      > +                       uselib_store='GLUSTERFS', msg='Checking
>>     for glusterfs-api >= 4',
>>      > +                       mandatory=False)
>>      > +
>>      >      conf.env.build_regedit = False
>>      >      if not Options.options.with_regedit == False:
>>      >          conf.PROCESS_SEPARATE_RULE('**system_ncurses')
>>      > @@ -1797,6 +1809,9 @@ main() {
>>      >      if conf.CONFIG_SET("HAVE_CEPH"):
>>      >          default_shared_modules.extend(**TO_LIST('vfs_ceph'))
>>      >
>>      > +    if conf.CONFIG_SET('HAVE_**GLUSTERFS'):
>>      > +        default_shared_modules.extend(**TO_LIST('vfs_glusterfs'))
>>      > +
>>      >      explicit_shared_modules =
>>     TO_LIST(Options.options.**shared_modules, delimiter=',')
>>      >      explicit_static_modules =
>>     TO_LIST(Options.options.**static_modules, delimiter=',')
>>
>>     This much looks good, assuming it is tested and works.   You might
>> need
>>     to make uselib_store='glusterfs' (not sure).
>>
>>
>> As mentioned above, I tried this but still get the dependency error. Not
>> sure what I am missing..
>>
>>
> I tried to look up documentation on the web, but I couldn't find anything
> specific. My understanding so far is:
>
> conf.check_cfg(...) does the 'detection' and stores the result in
> variables. You can specify a variable name prefix with uselib_store=NAME
> parameter.
>
> You can then use the test results while building, with a construct like:
>
> bld.new_task_gen(..., uselib=NAME, ...)
>
> However, samba is using bld.SAMBA3_MODULE(...) for building, and that does
> not seem to be accepting uselib= parameter.
>
> What I am trying to achieve is:
>
> - detect for presence of glusterfs headers/libs in the buildsystem. This
> is detected with the presence of glusterfs-api.pc
>
> - use the --libs and --cflags from pkg-config on glusterfs-api.pc to build
> vfs_glusterfs.c
>
> I know how to do this in autotools. I am not familiar with waf, and it
> doesn't seem to be intuitive enough to be self understood. There seems to
> be quite a lot of macro hackery around it which makes the techniques you
> get from a google search "not applicable".
>
> Any help from the waf experts will be most appreciated!


Looks like the issue was that there had to be atleast one call to
conf.CHECK_HEADER in context of the package (unlike autotools where this
doesn't seem to be necessary). After adding a line to CHECK_HEADERS (in v8
patch) everything else just worked.

Avati
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20130528/d5d283a5/attachment-0001.html>


More information about the Gluster-devel mailing list