Skip to content

--source fails without python2 on Python 3 #419

Description

@ekalinin

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions