Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nacholibre opened this issue Sep 8, 2015 · 2 comments
Closed

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

nacholibre opened this issue Sep 8, 2015 · 2 comments
Labels
build Issues and PRs related to build files or the CI.

Comments

@nacholibre
Copy link

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.

@ChALkeR ChALkeR added the build Issues and PRs related to build files or the CI. label Sep 8, 2015
@rvagg
Copy link
Member

rvagg commented Sep 8, 2015

Our hands are a little tied here because although we do support $PYTHON for some of the tooling, it's gyp itself that's stuck with python2 and calls it directly as python. Our workaround for build machines with this problem goes something like this:

mkdir -p ~/bin/
ln -s $(which python2) ~/bin/python
export PATH=~/bin/:$PATH
./configure
make
etc.

@ChALkeR
Copy link
Member

ChALkeR commented Sep 8, 2015

See also #418

buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Mar 6, 2016
Remove the patches to use a python variable and instead force python2
into the PATH.

Upstream the python variable was recently removed
(see nodejs/node@c3e50ca) and due to dependencies
directly calling python there is a reluctance to change this.  Instead it
is recommended to add python2 into PATH as the nodejs build machines do
(see nodejs/node#418 and
nodejs/node#2735).

Signed-off-by: Martin Bark <martin@barkynet.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
derosier pushed a commit to LairdCP/wb-buildroot that referenced this issue Feb 24, 2017
Remove the patches to use a python variable and instead force python2
into the PATH.

Upstream the python variable was recently removed
(see nodejs/node@c3e50ca) and due to dependencies
directly calling python there is a reluctance to change this.  Instead it
is recommended to add python2 into PATH as the nodejs build machines do
(see nodejs/node#418 and
nodejs/node#2735).

Signed-off-by: Martin Bark <martin@barkynet.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
BWhitten pushed a commit to LairdCP/wb-buildroot that referenced this issue Dec 14, 2017
Remove the patches to use a python variable and instead force python2
into the PATH.

Upstream the python variable was recently removed
(see nodejs/node@c3e50ca) and due to dependencies
directly calling python there is a reluctance to change this.  Instead it
is recommended to add python2 into PATH as the nodejs build machines do
(see nodejs/node#418 and
nodejs/node#2735).

Signed-off-by: Martin Bark <martin@barkynet.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

3 participants