Skip to content

Compile error on ArchLinux - node-4.0.0-rc.5 #2735

@nacholibre

Description

@nacholibre

Hello,

I wanted to try the new RC version but I can't compile it, here is the error.

➜  node-4.0.0-rc.5  python2 ./configure                                                                                                                                                                                                             ~/junkStuff/node-4.0.0-rc.5
creating  ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'gas_version': '2.25',
                 'host_arch': 'x64',
                 'icu_small': 'false',
                 'node_byteorder': 'little',
                 'node_install_npm': 'true',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'python': '/usr/bin/python2',
                 'target_arch': 'x64',
                 'uv_parent_path': '/deps/uv/',
                 'uv_use_dtrace': 'false',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 1,
                 'want_separate_host_toolset': 0}}
creating  ./config.gypi
creating  ./config.mk
  File "<string>", line 1
    import sys; print sys.byteorder
                        ^
SyntaxError: invalid syntax
gyp: Call to 'python -c "import sys; print sys.byteorder"' returned exit status 1. while loading dependencies of /home/nacholibre/junkStuff/node-4.0.0-rc.5/node.gyp while trying to load /home/nacholibre/junkStuff/node-4.0.0-rc.5/node.gyp
Error running GYP

using

$ export PYTHON=/usr/bin/python2
$ $PYTHON ./configure

doesn't work either.

The problem is that there is underlying call python -c "import sys; print sys.byteorder" which is python2 valid code, not python3, and my default python binary is python v3. Why export PYTHON=.. is not considered in node.gyp?

Here is where the call is made

./deps/v8/build/toolchain.gypi:    'v8_host_byteorder%': '<!(python -c "import sys; print sys.byteorder")',

I think the best solution is the configure program itself to search for valid python2 binary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions