Task #1302

waf and python <2.6 and >=3.0

Added by Alex Afanasyev about 7 years ago. Updated over 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


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.


Updated by Junxiao Shi about 7 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.


Updated by Alex Afanasyev about 7 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.


Updated by Alex Afanasyev almost 7 years ago

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

Updated by Alex Afanasyev almost 7 years ago

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

Updated by Alex Afanasyev almost 7 years ago

  • Target version changed from v0.2 to Unsupported

Updated by Alex Afanasyev almost 7 years ago

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


Updated by Alex Afanasyev almost 7 years ago

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

Updated by Junxiao Shi almost 7 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


Updated by Alex Afanasyev almost 7 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)


Updated by Junxiao Shi almost 7 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.


Updated by Alex Afanasyev almost 7 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.


Updated by Davide Pesavento over 6 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/", line 98, in waf_entry_point
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/", line 155, in run_commands
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/", line 128, in parse_options
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/", line 136, in execute
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/", line 92, in execute
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/", line 133, in recurse
  File "/home/davide/repos/NFD/wscript", line 38, in options
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/", line 86, in load
  File "/home/davide/repos/NFD/.waf3-1.8.0-094bcb3e7079041614f60222067e94d3/waflib/", line 342, in load_tool
  File ".waf-tools/", 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.


Updated by Junxiao Shi over 6 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.


Updated by Davide Pesavento about 5 years ago

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


Updated by Alex Afanasyev over 3 years ago

  • Status changed from New to Rejected

Also available in: Atom PDF