generated spotlight files (via bison/flex) from waf rather than use snapshots of previous generated files

Ralph Böhme slow at samba.org
Thu Jan 19 10:12:04 UTC 2017


On Thu, Jan 19, 2017 at 09:42:56AM +0000, Noel Power wrote:
> Hi Ralf,
> 
> On 19/01/17 08:33, Noel Power wrote:
> > On 19/01/17 07:23, Ralph Böhme wrote:
> >> On Wed, Jan 18, 2017 at 07:51:58PM +0100, Ralph Böhme wrote:
> >>> Hi Noel,
> >>>
> >>> On Wed, Jan 18, 2017 at 02:11:19PM +0000, Noel Power wrote:
> >>>> I was trying to see in my WSP stuff how to get rid of a similar
> >>>> situation (I also use flex/bison) so this worked for me,. Attached is a
> >>>> patch for spotlight using the same technique I used, probably with more
> >>>> waf knowledge it could be improved (e.g. I would liked to have figured
> >>>> out some way to pass some info to third_party/waf/wafadmin/Tools/flex.py
> >>>> so that the 'rule' there could be changed to add the 'sed' stuff
> >>>> dynamically) but this should do for the moment, hopefully of this is of
> >>>> some use
> >>> I was made aware of an issue building Samba with --nonshared-binary=smbd/smbd
> >>> which fails when build with --enable-spotlight in two places.
> >>>
> >>> I've posted a patch for one place yesterday [1], the other place is:
> >>>
> >>> <https://bugzilla.samba.org/show_bug.cgi?id=12528>
> >>>
> >>> So as we have to fix the mdssvc lexer and parser files anyway, I'd like to base
> >>> the fix on your patch to integrate the generation into waf.
> >>>
> >>> Combined patch attached.
> >>>
> >>> I've slightly modified your patch and renamed the subsystem to "MDS_LEXER". What
> >>> do you think?
> >> another update: I always found it ugly running sed on the generated lexer to
> >> replace malloc and realloc with SMB_MALLOC and SMB_REALLOC respectively.
> [...]
> > ok this sounds better, will have a look this morning
> 
> so, we can even go better, with the sed requirement gone there is no
> longer a need for the  MDS_LEXER subsystem, I attach a patch here to
> remove it, if happy probably best to squash it with the previous patch.

I'll take a look.

> Only thing I noticed was on my box the build fails with the final patch
> 's3/rpc_server/mdssvc: prefix public flex and bison global' probably
> it's a bison version issue. The error I get is below
> 
> [ 418/3005] bison: source3/rpc_server/mdssvc/sparql_parser.y ->
> bin/default/source3/rpc_server/mdssvc/sparql_parser.tab.c
> bin/default/source3/rpc_server/mdssvc/sparql_parser.tab.h
> 09:39:22 runner /usr/bin/bison -d
> /data/samba/source3/rpc_server/mdssvc/sparql_parser.y -o sparql_parser.tab.c
> /data/samba/source3/rpc_server/mdssvc/sparql_parser.y:68.20-26: error:
> syntax error, unexpected {...}
> 
> sparql_parser.y:68 is
> 
> 67
> 68 %define api.prefix {mdsyy}
> 69 %expect 5
> 
> 
> bison --version
> bison (GNU Bison) 2.7

ah, damn!

Looks like the api.prefix dance is to new, so we can't use it.

The older form seems to be

  %name-prefix="mds"

Can you test whether that works with bison 2.7? Thanks!

Cheerio!
-slow



More information about the samba-technical mailing list