commonsmachinery / blockhash

blockhash.io
MIT License
86 stars 28 forks source link

waf raise StopIteration with python 3.7 #28

Closed patatetom closed 6 years ago

patatetom commented 6 years ago

hello,

since python3 update (3.6.6-1 -> 3.7.0-3), blockhash no longer build :

python3.7 waf configure

Traceback (most recent call last):
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Node.py", line 282, in ant_iter
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 149, in run_commands
    parse_options()
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Scripting.py", line 127, in parse_options
    Context.create_context('options').execute()
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Options.py", line 134, in execute
    super(OptionsContext,self).execute()
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 84, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 125, in recurse
    user_function(self)
  File "/tmp/blockhash-0.3.1/wscript", line 8, in options
    opt.load('compiler_c')
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 81, in load
    fun(self)
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Tools/compiler_c.py", line 31, in options
    opt.load_special_tools('c_*.py',ban=['c_dumbpreproc.py'])
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Context.py", line 261, in load_special_tools
    lst=self.root.find_node(waf_dir).find_node('waflib/extras').ant_glob(var)
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Node.py", line 331, in ant_glob
    ret=[x for x in self.ant_iter(accept=accept,pats=[to_pat(incl),to_pat(excl)],maxdepth=kw.get('maxdepth',25),dir=dir,src=src,remove=kw.get('remove',True))]
  File "/tmp/blockhash-0.3.1/.waf3-1.7.16-9ca17eb492c97b689870b4ff9db75880/waflib/Node.py", line 331, in <listcomp>
    ret=[x for x in self.ant_iter(accept=accept,pats=[to_pat(incl),to_pat(excl)],maxdepth=kw.get('maxdepth',25),dir=dir,src=src,remove=kw.get('remove',True))]
RuntimeError: generator raised StopIteration

no issue with pyhon2.7

python2.7 waf configure

Setting top to                           : /tmp/blockhash-0.3.1 
Setting out to                           : /tmp/blockhash-0.3.1/build 
Checking for 'gcc' (c compiler)          : /bin/gcc 
Checking for library m                   : yes 
Checking for program pkg-config          : /bin/pkg-config 
Checking for 'MagickWand'                : yes 
Checking for 'MagickWand' version        : yes 
'configure' finished successfully (1.043s)

python2 waf

Waf: Entering directory `/tmp/blockhash-0.3.1/build'
[1/2] c: blockhash.c -> build/blockhash.c.1.o
[2/2] cprogram: build/blockhash.c.1.o -> build/blockhash
Waf: Leaving directory `/tmp/blockhash-0.3.1/build'
'build' finished successfully (0.583s)

regards.

artfwo commented 6 years ago

Hi, @patatetom thanks for the heads up. I've updated waf to version 2.0.10, could you verify that it works with python 3.7? Thx!

patatetom commented 6 years ago

:+1:

python3.7 waf configure
Setting top to                           : /tmp/blockhash-master 
Setting out to                           : /tmp/blockhash-master/build 
Checking for 'gcc' (C compiler)          : /bin/gcc 
Checking for library m                   : yes 
Checking for program 'pkg-config'        : /bin/pkg-config 
Checking for 'MagickWand'                : yes 
Checking for 'MagickWand' version        : 7.0.8 
'configure' finished successfully (1.074s)
python3.7 waf
Waf: Entering directory `/tmp/blockhash-master/build'
[1/2] Compiling blockhash.c
[2/2] Linking build/blockhash
Waf: Leaving directory `/tmp/blockhash-master/build'
'build' finished successfully (0.617s)
 ./build/blockhash 
Usage: blockhash [-h|--help] [--quick] [--bits BITS] [--debug] filenames...

Optional arguments:
-h, --help            Show this help message and exit
-q, --quick           Use quick hashing method.
-b, --bits BITS       Create hash of size N^2 bits. Default: 16
--debug               Print hashes as 2D maps (for debugging)