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

R-V8 doesn't build against Node.js 16.x #123

Closed
sgallagher opened this issue Jun 24, 2021 · 33 comments
Closed

R-V8 doesn't build against Node.js 16.x #123

sgallagher opened this issue Jun 24, 2021 · 33 comments

Comments

@sgallagher
Copy link

Node.js 16.x no longer ships /usr/include/libplatform which is imported by bindings.cpp.

@jeroen
Copy link
Owner

jeroen commented Jun 25, 2021

This is unfortunate. I don't think it is possible to build the R bindings without the libplatform API, as we need an API call from libplatform.h to initiate the V8 engine. I have asked advice on the v8 mailing list: https://groups.google.com/g/v8-users/c/GeIwDMWCq9I

Could the nodejs rpm be patched to include the libplatform headers anyway?

@sgallagher
Copy link
Author

I have a build of Node.js 16.4.1 going right now that reverts the header patch. That should keep us going until you get an answer from the v8 upstream.

@jeroen
Copy link
Owner

jeroen commented Jul 2, 2021

OK awesome. Technically we really only need the libplatform header, that is also used in the V8 hello-world example. It's weird that nodejs considers this header as unstable.

@jeroen
Copy link
Owner

jeroen commented Jul 11, 2021

Fixed in upstream nodejs: nodejs/node#39288

@jeroen jeroen closed this as completed Jul 11, 2021
@sgallagher
Copy link
Author

Excellent; when 16.5.0 is out, I can drop my patch then. Thanks for letting me know.

@jeroen
Copy link
Owner

jeroen commented Jul 17, 2021

@sgallagher
Copy link
Author

@sgallagher 16.5.0 was released last week: https://github.com/nodejs/node/releases/tag/v16.5.0

I'm aware, but I've been swamped with other stuff this past week; I'll try to get this updated soon.

@jeroen
Copy link
Owner

jeroen commented Jul 20, 2021

No worries, thanks for your work on this.

@sgallagher
Copy link
Author

This should be fixed on Rawhide as of nodejs-16.5.0-1.fc35

@jeroen
Copy link
Owner

jeroen commented Nov 5, 2021

@sgallagher is there any way we can get this in EPEL-8?

Alternatively would it be possible to provide this as a module in CentOS, similar to your nodejs:13 repo ?

@sgallagher
Copy link
Author

@jeroen RHEL 8.5 Beta provides a Node.js 16.x module stream. That should suffice, yes?

@jeroen
Copy link
Owner

jeroen commented Nov 5, 2021

Do these streams include v8-devel? Previously I would use on CentOS 8 something like this:

yum module enable nodejs:13
yum install v8-devel

How do I install the v8 headers from nodejs:14 or nodejs:16 ?

@sgallagher
Copy link
Author

They are included in the nodejs-devel subpackage on nodejs:16 (but are missing from nodejs:14). They're part of /usr/include/node, though. So you'll need to make sure your build can look there.

@jeroen
Copy link
Owner

jeroen commented Nov 5, 2021

Ah okay, I haven't been able to test that yet because I can't find a docker container that runs centos 8.5 beta, and I don't have a RHEL machine.

They're part of /usr/include/node, though. So you'll need to make sure your build can look there.

OK we can add that. Are the libs still called libv8.so or should it link to libnode.so? Is there a reason there is no libv8-devel package anymore (like in Fedora) that provides symlinks with /usr/include/v8 and libv8.so etc ?

@sgallagher
Copy link
Author

sgallagher commented Nov 5, 2021

Ah okay, I haven't been able to test that yet because I can't find a docker container that runs centos 8.5 beta, and I don't have a RHEL machine.

quay.io/centos/centos:stream8 is roughly equivalent to 8.5 Beta and has the nodejs:16 stream.

They're part of /usr/include/node, though. So you'll need to make sure your build can look there.

OK we can add that. Are the libs still called libv8.so or should it link to libnode.so? Is there a reason there is no libv8-devel package anymore (like in Fedora) that provides symlinks with /usr/include/v8 and libv8.so etc ?

So, I just took a closer look and while they are shipping the headers... they are not shipping libnode.so. So that's going to be a problem. I'll look into creating an EPEL module for it, but it'll have to be nodejs:16-epel to avoid conflicting with the official RHEL release.

Edit: In case it was unclear, I don't maintain the RHEL module and I don't really have any input into how they are delivering it.

@jeroen
Copy link
Owner

jeroen commented Nov 15, 2021

So, I just took a closer look and while they are shipping the headers... they are not shipping libnode.so. So that's going to be a problem. I'll look into creating an EPEL module for it, but it'll have to be nodejs:16-epel to avoid conflicting with the official RHEL release. Edit: In case it was unclear, I don't maintain the RHEL module and I don't really have any input into how they are delivering it.

Ah that is too bad! I was hoping they had just taken the Fedora config and rebuilt for RHEL.

We would be super grateful if you can provide a nodejs:16-epel with the shared libarry, similar to the Fedora build, or the nodejs:13 module

@sgallagher
Copy link
Author

I'm working on it, but it's slow going. The state of Python in RHEL 8 is... complicated. Essentially, I need to dig through the Node.js source code and find every instance where it's using python, /usr/bin/python, /usr/bin/env python or similar and replace them with /usr/bin/python3.

@sgallagher
Copy link
Author

I finally found the magic incantation. It should be appearing in epel8-modular-updates-testing within 24 hours.

https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-MODULAR-2021-6a8d177796

@jeroen
Copy link
Owner

jeroen commented Dec 3, 2021

Thanks! How do I enable `epel8-modular-updates-testing? I tried this in centos 8.5:

yum module enable epel8-modular-updates-testing
## Last metadata expiration check: 0:04:04 ago on Fri 03 Dec 2021 10:56:46 AM UTC.
## Error: Problems in request:
## missing groups or modules: epel8-modular-updates-testing

@sgallagher
Copy link
Author

yum --refresh --enablerepo=epel-testing-modular install @nodejs:16-epel/minimal v8-devel should do what you want.

jeroen added a commit that referenced this issue Dec 3, 2021
@jeroen
Copy link
Owner

jeroen commented Dec 3, 2021

Thanks! That works!! I'll add that to the readme.

@sgallagher
Copy link
Author

You can drop the --enablerepo=epel-testing-modular part once it lands in the stable EPEL 8 repos.

You can help do that by providing positive karma on https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-MODULAR-2021-6a8d177796

@jeroen
Copy link
Owner

jeroen commented Dec 3, 2021

OK I am sending my all my juju and karma!

@jeroen
Copy link
Owner

jeroen commented Feb 15, 2024

Hi Stephen,

Thanks again for creating this repo, we still use it today on RHEL 8. It works great, but when we install it it shows RETIRED:

yum --refresh --enablerepo=epel-testing-modular install @nodejs:16-epel/minimal v8-devel
....
## Extra Packages for Enterprise Linux 8 - x86_64                                                                                                70 kB/s |  23 kB     00:00
## Extra Packages for Enterprise Linux 8 - Testing - x86_64                                                                                     190 kB/s |  15 kB     00:00
## Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - RETIRED                                                                    58 kB/s |  19 kB     00:00
## Dependencies resolved.

It seems like nodejs16 is available in EPEL-7 and EPEL-9 but never landed in official EPEL-8? Do you think the @nodejs:16-epel/minimal will remain available?

@sgallagher
Copy link
Author

I don't think it's going to disappear, but it's never going to see an update again. EPEL decided to drop modularity.

Given that Node.js 16 is EOL upstream, I'm not really sure what to do here. And since Node.js is shipped in RHEL 8, I can't update it to a non-modular version in EPEL without at minimum changing all of the install locations, which likely doesn't help you.

@jeroen
Copy link
Owner

jeroen commented Feb 15, 2024

Ah okay. In that case we'll keep telling users to use the epel-testing-modular .

Btw one more related question: in EL9 (I am using rockylinux to test this) the nodejs-devel package seems uninstallable right now due a conflict between nodejs 16.20.2 (appstream) and 16.18.1 (epel):

 yum install v8-devel
# Last metadata expiration check: 0:00:13 ago on Thu Feb 15 15:14:28 2024.
# Error:
# Problem: package v8-devel-2:9.4.146.26-1.16.18.1.3.el9.x86_64 from epel requires nodejs-devel(x86-64) = 1:16.18.1-4.el9, # but none of the providers can be installed
#  - conflicting requests
#  - nothing provides nodejs(x86-64) = 1:16.18.1-3el9_1 needed by nodejs-devel-1:16.18.1-4.el9.x86_64 from epel

We see that nodejs has a different version than nodejs-devel

yum info nodejs
Last metadata expiration check: 0:01:30 ago on Thu Feb 15 15:14:28 2024.
Available Packages
Name         : nodejs
Epoch        : 1
Version      : 16.20.2

yum info nodejs-devel
Last metadata expiration check: 0:05:04 ago on Thu Feb 15 15:14:28 2024.
Available Packages
Name         : nodejs-devel
Epoch        : 1
Version      : 16.18.1

I guess this is the same problem with node16 in epel and appstream? Is there a way to install v8-devel on EL-9?

@sgallagher
Copy link
Author

I don't actually maintain that package: looks like someone else (Davide Cavalca) created that package. I'll ask him to see if he can get it updated to match the last upstream release.

@pat-s
Copy link

pat-s commented Apr 11, 2024

Just reporting that the version issues reported from Feb 2024 are still present and v8-devel is not installable on Alma9.3 due to this.

I am not fullysure which package is to blame here.
v8-devel requests specifically nodejs-devel-16.18.1-4.el9. This one is actually installable right now (from a standalone RPM) but fails as it requires nodejs-1:16.18.1-3el9 which in turn is not available (only 1:16.20).

I can see the following solutions:

  • v8-devel starts requesting nodejs-devel 16.20 instead of 16.18
  • nodejs 16.18 is made available somewhere (unlikely)

Maybe worth reporting as a bug to https://bugs.almalinux.org/ or the last packager himself (Honza Horak)?

@jeroen
Copy link
Owner

jeroen commented Apr 11, 2024

I think there is no easy solution. The problem is not so much the version numbers, but that the build of node included in the mainstream RHEL repository is built without a shared library, and therefore it cannot be used by the R package. And sadly that one conflicts with the version from epel-testing-modular, which does have the shared library, but it gets masked by the other one.

@pat-s
Copy link

pat-s commented Apr 11, 2024

Ah I didn't know that. Hmm that sounds quite bad. Also when thinking of moving forward with RHEL9 derivates in the near future.

Are you aware of any other workaround to get a working nodejs lib which is compatible with v8 baked into a RHEL9-like distro?

@jeroen
Copy link
Owner

jeroen commented Apr 11, 2024

No I don't know. The easiest solution is to build with DOWNLOAD_STATIC_LIBV8 such that you don't need system libs.

@pat-s
Copy link

pat-s commented Apr 11, 2024

Thanks, I'll check this. Though we have some environments which are air-gapped and no additional downloads can be done.

Will the configure script find a static lib if it's sitting in the right place? (sorry for the additional question, maybe it's better to open a new issue)

@jeroen
Copy link
Owner

jeroen commented Apr 11, 2024

Yes you can set V8_PKG_LIBS and V8_PKG_CFLAGS to set a local config: see the configure script.

If you are looking for which static lib to use, here are some links: https://github.com/jeroen/V8/blob/gh-pages/get-v8-linux.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants