Skip to content

cannot build from source on Arch Linux w/ python v3.5.1 #6249

@faddah

Description

@faddah
  • Version: node v4.4.3 (but have also seem this with v4.4.2, 4.4.1, etc.)
  • Platform: 64-bit Pine64 A64+ board with 2 GB of RAM & Arch Linux OS w/ python 3.5.1 (but would be true of any machine running Arch Linux)
  • Subsystem: N/A

this is happening in Arch Linux OS, because they only load python 3.5,1 for that OS.

if you download node.js' latest LTS version (v4.4.x) to compile from source and attempt this starting with using the command line ./configure command, it will fail, as that script uses python, and Arch Linux OS only comes with python v3.5.1 currently. python 3.x now requires certain statements like print now require the quoted string statement to now be in parantheses. so a python v2.7.x print statement would be: print "this string" must now be print ("this string") in python v3.x or you will get a compile error. there are still several print statements without these parantheses in the node.js configure file for compiling from source that will cause it to fail without much real explanation.

there are possible fixes —

  • preferred — rewrite the configure and other script files to test first what version of python they are using: if < python 2.7, tell them to update to 2.7 as current stable vers.; if python 2.7, run the current script; if python >= 3.x, point at another script that has proper python 3.x syntax (print ("this string..."), etc.)
  • include in instructions for compiling node.js from source and BUILDING.md and REQDME.md that you have to run on python v.2.7, make sure they have python v2.7 installed, and give them the option to change the language heading in the script files from —

#/usr/bin/env python

to change it to —

#/usr/bin/env python2

...but really, python 3.x has been out for a while now and it would be a much better UX if the scripts tested and ran on both python v2.7 and python v3.x, and/or did much better error reporting to tell users what version of python to use.

best,

— faddah
portland, oregon, u.s.a.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions