build_node_from_src requires a python2 command whenever nodeenv runs under Python 3:
if getattr(sys.version_info, 'major', sys.version_info[0]) > 2:
# Currently, the node.js build scripts are using python2.*,
# therefore we need to temporarily point python exec to the
# python 2.* version in this case.
python2_path = shutil.which('python2')
if not python2_path:
raise OSError(
'Python >=3.0 virtualenv detected, but no python2 '
'command (required for building node.js) was found'
)
nodeenv is Python 3 only now, so this branch is always taken. Current node.js build scripts use Python 3, and python2 is usually absent on modern systems, so nodeenv --source fails before ./configure runs.
Reproduce
On master (e745358), on a machine without python2:
import types, nodeenv
args = types.SimpleNamespace(load_average=None, jobs='2', without_ssl=False,
debug=False, profile=False, make_path='make', verbose=False)
nodeenv.build_node_from_src('/tmp/x/env', '/tmp/x', '/tmp/x/node-src', args)
OSError: Python >=3.0 virtualenv detected, but no python2 command (required for building node.js) was found
build_node_from_srcrequires apython2command whenever nodeenv runs under Python 3:nodeenv is Python 3 only now, so this branch is always taken. Current node.js build scripts use Python 3, and
python2is usually absent on modern systems, sonodeenv --sourcefails before./configureruns.Reproduce
On master (e745358), on a machine without
python2: