[PATCH] waf upgrade broke flex and bison detection and flex build

Ralph Böhme slow at samba.org
Wed Sep 5 11:57:17 UTC 2018


Hi!

Looks like the recent waf update broke flex and bison detection and flex build.

Attached patches fix the detection, but the build error is more difficult: seems 
as if flex is invoked from a the toplevel git checkout directory, not from bin, 
so the path to the flex source which is relative to bin, is wrong:

[slow at kazak scratch]$ pwd                        
/home/slow/git/samba/scratch

[slow at kazak scratch]$ make
WAF_MAKE=1 python ./buildtools/bin/waf build
...
[1998/3795] Compiling source3/rpc_server/mdssvc/sparql_lexer.l
...

/home/slow/git/samba/scratch
flex: can't open ../source3/rpc_server/mdssvc/sparql_lexer.l

Traceback (most recent call last):
  File "/home/slow/git/samba/scratch/third_party/waf/waflib/Task.py", line 320, in process
    ret = self.run()
  File "/home/slow/git/samba/scratch/third_party/waf/waflib/Tools/flex.py", line 36, in flexfun
    txt = bld.cmd_and_log(lst, env=env.env or None, quiet=0)
  File "/home/slow/git/samba/scratch/third_party/waf/waflib/Context.py", line 464, in cmd_and_log
    raise e
WafError: Command ['/usr/bin/flex', '-t', '../source3/rpc_server/mdssvc/sparql_lexer.l'] returned 1

make: *** [Makefile:8: all] Error 1

I've patched cmd_and_log to print the cwd and error, that's where the lines

/home/slow/git/samba/scratch
flex: can't open ../source3/rpc_server/mdssvc/sparql_lexer.l

are coming from.

Note, you need --enable-spotlight to trigger this.

Any help appreciated.

Thanks!
-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG Key Fingerprint:           FAE2 C608 8A24 2520 51C5
                               59E4 AA1E 9B71 2639 9E46
-------------- next part --------------
From 9410572c6cc3a486e24c0cad1a50b3ef208c0efb Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Wed, 5 Sep 2018 13:46:37 +0200
Subject: [PATCH 1/2] s3/wscript: fix bison detection

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/wscript | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/wscript b/source3/wscript
index 9037b6488c4..4ecc3770329 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1618,7 +1618,7 @@ main() {
     if Options.options.with_spotlight:
 
         Logs.info("Requested Spotlight support, checking for bison")
-        bison.detect(conf)
+        bison.configure(conf)
         if not conf.env['BISON']:
             conf.fatal("Spotlight support requested but bison missing")
         conf.CHECK_COMMAND('%s --version | head -n1' % conf.env['BISON'], msg='Using bison version', define=None, on_target=False)
-- 
2.13.6


From 282e53d2e42e8f40645160e654bcd3cd2a905683 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Wed, 5 Sep 2018 13:47:17 +0200
Subject: [PATCH 2/2] s3/wscript: fix flex detection

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/wscript | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/wscript b/source3/wscript
index 4ecc3770329..cf7beb7dc46 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1623,7 +1623,7 @@ main() {
             conf.fatal("Spotlight support requested but bison missing")
         conf.CHECK_COMMAND('%s --version | head -n1' % conf.env['BISON'], msg='Using bison version', define=None, on_target=False)
         Logs.info("Requested Spotlight support, checking for flex")
-        flex.detect(conf)
+        flex.configure(conf)
         if not conf.env['FLEX']:
             conf.fatal("Spotlight support requested but flex missing")
         conf.CHECK_COMMAND('%s --version' % conf.env['FLEX'], msg='Using flex version', define=None, on_target=False)
-- 
2.13.6



More information about the samba-technical mailing list