RedHatter / diodon-plugins

A set of plugins for the gnome clipboard manager Diodon.
19 stars 10 forks source link

Python 3.7.1 #12

Open TessaI159 opened 5 years ago

TessaI159 commented 5 years ago

Attempting to run

./waf configure --libdir /usr/lib/x86_64-linux-gnu/ 

with Python 3.7.1 results in an error.

Traceback (most recent call last):
  File "/home/tess/Clones/diodon-plugins/waflib/Node.py", line 490, in ant_iter
    raise StopIteration
StopIteration

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

Traceback (most recent call last):
  File "/home/tess/Clones/diodon-plugins/waflib/Scripting.py", line 138, in waf_entry_point
    run_commands()
  File "/home/tess/Clones/diodon-plugins/waflib/Scripting.py", line 225, in run_commands
    parse_options()
  File "/home/tess/Clones/diodon-plugins/waflib/Scripting.py", line 186, in parse_options
    Context.create_context('options').execute()
  File "/home/tess/Clones/diodon-plugins/waflib/Options.py", line 250, in execute
    super(OptionsContext, self).execute()
  File "/home/tess/Clones/diodon-plugins/waflib/Context.py", line 216, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/tess/Clones/diodon-plugins/waflib/Context.py", line 294, in recurse
    user_function(self)
  File "/home/tess/Clones/diodon-plugins/wscript", line 12, in options
    opt.tool_options('compiler_c')
  File "/home/tess/Clones/diodon-plugins/waflib/Context.py", line 209, in load
    fun(self)
  File "/home/tess/Clones/diodon-plugins/waflib/Tools/compiler_c.py", line 87, in options
    opt.load_special_tools('c_*.py', ban=['c_dumbpreproc.py'])
  File "/home/tess/Clones/diodon-plugins/waflib/Context.py", line 515, in load_special_tools
    lst = self.root.find_node(waf_dir).find_node('waflib/extras').ant_glob(var)
  File "/home/tess/Clones/diodon-plugins/waflib/Node.py", line 578, in ant_glob
    ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=25, dir=dir, src=src, remove=kw.get('remove', True))]
  File "/home/tess/Clones/diodon-plugins/waflib/Node.py", line 578, in <listcomp>
    ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=25, dir=dir, src=src, remove=kw.get('remove', True))]
RuntimeError: generator raised StopIteration

Switching to 3.6.7 using pyenv and installing diodon-dev and valac allowed me to build successfully. The following commands fixed the issue for me:

sudo apt install -y valac diodon-dev
pyenv local 3.6.7
./waf configure --libdir /usr/lib/x86_64-linux-gnu/
T313C0mun1s7 commented 3 years ago

This issue appears to persist with Python 3.8.5

❯ ./waf configure --libdir /usr/lib/x86_64-linux-gnu/
Traceback (most recent call last):
  File "/home/john/git/diodon-plugins/waflib/Node.py", line 490, in ant_iter
    raise StopIteration
StopIteration

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

Traceback (most recent call last):
  File "/home/john/git/diodon-plugins/waflib/Scripting.py", line 138, in waf_entry_point
    run_commands()
  File "/home/john/git/diodon-plugins/waflib/Scripting.py", line 225, in run_commands
    parse_options()
  File "/home/john/git/diodon-plugins/waflib/Scripting.py", line 186, in parse_options
    Context.create_context('options').execute()
  File "/home/john/git/diodon-plugins/waflib/Options.py", line 250, in execute
    super(OptionsContext, self).execute()
  File "/home/john/git/diodon-plugins/waflib/Context.py", line 216, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/john/git/diodon-plugins/waflib/Context.py", line 294, in recurse
    user_function(self)
  File "/home/john/git/diodon-plugins/wscript", line 12, in options
    opt.tool_options('compiler_c')
  File "/home/john/git/diodon-plugins/waflib/Context.py", line 209, in load
    fun(self)
  File "/home/john/git/diodon-plugins/waflib/Tools/compiler_c.py", line 87, in options
    opt.load_special_tools('c_*.py', ban=['c_dumbpreproc.py'])
  File "/home/john/git/diodon-plugins/waflib/Context.py", line 515, in load_special_tools
    lst = self.root.find_node(waf_dir).find_node('waflib/extras').ant_glob(var)
  File "/home/john/git/diodon-plugins/waflib/Node.py", line 578, in ant_glob
    ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=25, dir=dir, src=src, remove=kw.get('remove', True))]
  File "/home/john/git/diodon-plugins/waflib/Node.py", line 578, in <listcomp>
    ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=25, dir=dir, src=src, remove=kw.get('remove', True))]
RuntimeError: generator raised StopIteration

❯ python --version
Python 3.8.5
1nVitr0 commented 3 years ago

This is due to PEP 0497 that has been enabled since Python 3.7

gogowitsch commented 3 years ago

We could check the Python version during runime - or say to run Python 2 instead. See #15