rubyjs / libv8-node

Package libv8 from Node
MIT License
14 stars 27 forks source link

libv8-node 17.3.1 doesn't build because of Python 3.10, 3.9 #45

Open abartov opened 1 year ago

abartov commented 1 year ago

The gem doesn't build, despite having the Python versions it asks for (3.10, 3.9, as well as 2.7).

==== running /usr/share/rvm/gems/ruby-3.2.0/gems/libv8-node-17.3.1.0/libexec/build-libv8
parallel job count: 4
configure: --openssl-no-asm --without-npm --shared --with-intl=full-icu
compilers: CC='gcc' CXX='g++' CC_host='' CXX_host=''
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/11/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/11/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
Please use python3.10 or python3.9 or python3.8 or python3.7 or python3.6.
        /usr/bin/python3.9 configure
Node.js configure: Found Python 2.7.18...
/usr/share/rvm/gems/ruby-3.2.0/gems/libv8-node-17.3.1.0/ext/libv8-node/builder.rb:14:in `build_libv8!': failed to build libv8 17.3.1 (Libv8::Node::BuilderError)
        from /usr/share/rvm/gems/ruby-3.2.0/gems/libv8-node-17.3.1.0/ext/libv8-node/location.rb:30:in `install!'
        from extconf.rb:9:in `<main>'

extconf failed, exit code 1
seanmakesgames commented 1 year ago

Hey @abartov - thanks for posting your issue. Did you figure out a workaround already? I don't think @lloeki has posted the new binaries that we've been working on, yet.

This might be fixed with our recent changes.

abartov commented 1 year ago

@seanmakesgames - no, I haven't found a workaround. I've paused my upgrade and will wait for this to be resolved before resuming.

lloeki commented 1 year ago

Hey, I've been swamped lately (big deadline at work), sorry for the delays. I'll build+push the updated builds later this week.

despite having the Python versions it asks for (3.10, 3.9, as well as 2.7). Node.js configure: Found Python 2.7.18.

Usually this is because the NodeJS detection here is a bit lousy and there's a python2 lying around as python in the path, or something to that effect. I tried to work around that here

You could fix that by:

seanmakesgames commented 1 year ago

Let us know if you try it and how it goes!

Fayti1703 commented 1 year ago

Usually this is because the NodeJS detection here is a bit lousy and there's a python2 lying around as python in the path, or something to that effect. I tried to work around that here

I want to add that the linked code snippet here was removed by me in the current node-17-HEAD (4411451acfc893f01fa8cab761a91476bf5f046b) since it caused issues building on darwin CI.

However, Node.JS's configure script looks like it tries to find an appropriate python version if it is present in the PATH, see its header:

#!/bin/sh

# Locate an acceptable Python interpreter and then re-execute the script.
# Note that the mix of single and double quotes is intentional,
# as is the fact that the ] goes on a new line.
_=[ 'exec' '/bin/sh' '-c' '''
command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
command -v python3.7 >/dev/null && exec python3.7 "$0" "$@"
command -v python3.6 >/dev/null && exec python3.6 "$0" "$@"
command -v python3 >/dev/null && exec python3 "$0" "$@"
exec python "$0" "$@"
''' "$0" "$@"
]
del _
seanmakesgames commented 1 year ago

Note to people watching these issues & PRs-- We are trying to release new versions of libv8-node and mini_racer and would love your help testing for stability in your products. Here's the main issue thread where we are tracking this: https://github.com/rubyjs/mini_racer/issues/277

Please let us know the results of your tests in our branches so we can do the actual releases on those branches with confidence.