Project

General

Profile

Task #1302

waf and python <2.6 and >=3.0

Added by Alex Afanasyev over 5 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
Normal
Category:
Build
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Apparently, the current build system requires at least python2.6 (though I have tested only with 2.7). Is it a problem or should we just put this requirement?

Update: This task requires just updating README/INSTALL files with a note that we require python 2.6.

History

#1 Updated by Junxiao Shi over 5 years ago

  • Category set to Build
  • Target version set to v0.1

Ubuntu 12.04 has Python 2.7, CentOS 6.5 has Python 2.6.

This task shall be rejected.

#2 Updated by Alex Afanasyev over 5 years ago

This should not be rejected, we need to know our limits. But in any case, apparently this is not an issue in waf, but in the way we're using waf. According to waf developers, all external tools (the ones that are currently in .waf-tools) needs to be bundled in inside waf script. This way, waf will take care of proper conversion to work with different versions of python.

#3 Updated by Alex Afanasyev over 5 years ago

  • Description updated (diff)
  • Assignee set to Alex Afanasyev

#4 Updated by Alex Afanasyev over 5 years ago

  • Target version changed from v0.1 to v0.2

#5 Updated by Alex Afanasyev over 5 years ago

  • Target version changed from v0.2 to Unsupported

#6 Updated by Alex Afanasyev over 5 years ago

Just discovered that we actually don't support python3 too. It is possible to fix, but would take some time and tricks.

#7 Updated by Alex Afanasyev over 5 years ago

  • Subject changed from waf and python 2.5 to waf and python <2.6 and >=3.0

#8 Updated by Junxiao Shi over 5 years ago

Python 2.x is available on most platforms and is supported.

To avoid problems on systems that default to Python 3: change SHEBANG line to #!/usr/bin/python2

#9 Updated by Alex Afanasyev over 5 years ago

I wouldn't fix python, especially given the fix to support either 2.6+ or 3.0 is kind of trivial (I already submitted patches on gerrit)

#10 Updated by Junxiao Shi over 5 years ago

Python2 and Python3 are fundamentally different languages - they are different syntax and thus different semantics.

Python2 is available as a package on all supported platforms.

Being compatible with Python3 appears easy, but it's an unnecessary burden on future development of wscript.

Therefore, I'm against making this change.

#11 Updated by Alex Afanasyev over 5 years ago

they are not that fundamentally different, they both functional and similar syntax.

waf itself is designed to be portable on "any" (any recent) version of python. i'm against on making any changes to build system (e.g., in waf that we bundle).

wscript technically supposed to be a simple script calling waf's functions, so the primary burden should be on waf guys, not on wscript.

#12 Updated by Davide Pesavento about 5 years ago

NFD and ndn-cxx currently fail if the system python is version 3 or later (i.e. /usr/bin/python is python3)

$ python --version
Python 3.3.5

$ ./waf configure --help
Traceback (most recent call last):
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Scripting.py", line 98, in waf_entry_point
    run_commands()
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Scripting.py", line 155, in run_commands
    parse_options()
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Scripting.py", line 128, in parse_options
    Context.create_context('options').execute()
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Options.py", line 136, in execute
    super(OptionsContext,self).execute()
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Context.py", line 92, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/home/davide/repos/NFD/wscript", line 38, in options
    tooldir=['.waf-tools'])
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Context.py", line 86, in load
    module=load_tool(t,path)
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/Context.py", line 342, in load_tool
    __import__(tool)
  File ".waf-tools/pch.py", line 86
    if getattr(self, 'headers', None) is None:
                                             ^
TabError: inconsistent use of tabs and spaces in indentation

Note that most other open source project usually support python2 >= 2.6 and python3 >= 3.2, so I think we can ignore < 2.6 and 3.0 and 3.1

In any case, if you don't want to support python3, at least change the shebang to reflect this.

#13 Updated by Junxiao Shi about 5 years ago

If a supported platform can be configured to have /usr/bin/python as Python 3, and NFD build fails under such configuration, this shall be reported as a critical bug.

#14 Updated by Davide Pesavento over 3 years ago

Is this simply a documentation bug or do we want to change something in waf/wscript?

#15 Updated by Alex Afanasyev over 2 years ago

  • Status changed from New to Rejected

Also available in: Atom PDF