Finished porting (experimentally) core Node Js to Haiku

Aye aye sir. Just didnt want to find some surprises further in time, when/if v8 is used for other software on Haiku (hint hint: chromium).

@Pahefu Thanks for publishing your work on the Node.JS port! :slight_smile:

I’ve had a look at the deps folder in NodeJS, and it seems that they include their own version of several dependencies including V8. Are they using a forked version of V8 with their changes or are they pulling from upstream?

We could do with an update with our current V8 port (which is still very ancient).

My pleasure.

I have seen that they are close to the upstream version for libuv that extrowerk had in WIP for Haiku, so i guess that the node coders just took a copy to have the deps code frozen in time. Cannot really tell.

I think i did most of the changes on the libuv code (faking a linux version), and left v8 mostly untouched. In any case, you can go inside the v8 dep folder, copy to a place you like and do make/cmake operations to test a haiku version.

Includes the tests that we are trying to pass, with a 94 not-ok last time i checked on Haiku :thinking: You need to include a configure directive to enable them tho.

It is not my libuv port, the platform-specific patches are from @CodeforEvolution if i remember correctly, i just tried to maintain his patchset.

Good to see my patches are helping! I always meant to try to finish my port of libuv, but never had the time to finish it. Continue to feel free to use the patches as needed! :+1:

Yeah, i wanted to point at your issue,where @CodeforEvolution was also thanked :+1: , not changing ownership of the changes hehe.

Imust insert the mandatory warning about downloading untrusted binaries from the forums and running them.

People, use at your own risk!

Obviously right with the advice, that’s why the source code was up first.

Wish it could take less time in the compilation, so users can do themselves. Or having a recipe to get an official hpkg, but at experimental phase… :man_shrugging:

Edit @PulkoMandy . after thinking about it, the right advice would be warning against untrusted binaries from github repos (i pointed to the repo releases and not the file itself, i mean) :stuck_out_tongue:

What is the status of the Node.js port?

Having access to the thousands of Node.js tools would be great for Haiku. It would also pave the way to Electron (which is another beast since it means porting Chromium).

@paefu do you have a repo which contains the Haiku specific changes (commits) you made to have node working? The GitHub link you posted only contains the code but no history at all.

It is already done, see nodejs: add recipe for v12.3.1 by return · Pull Request #3879 · haikuports/haikuports · GitHub for the patches. You might have to wait until Haiku R1/beta2 releases to install it where that is just around the corner. But If you are running a Haiku nightly, you can build and install it yourself using haikuporter.

Node and V8 just part of the smaller fundamental components required, there are many more libraries need to port all of Chromium’s other dependencies to get Electron, which is a multi-person and multi-year effort for usable functionality. We already have a WebKit2 port to maintain which powers WebPositive, so unless a team of developers is paid to port Chromium to Haiku, Electron won’t be available any time soon.

3 Likes

I tried installing Haiku nighty in a VM but I am getting an error when attempting to compile it:

fatal error: execinfo.h: No such file or directory
#include <execinfo.h>

Do I need to install additional packages/libs in order to build it? I simply checked out the repository and ran ./configure --without-intl --without-snapshot as suggested in the repository then typed make.

devel:libexecinfo missing, install it.

Ok. Should I install it using HaikuDepot or is there a way to install it from the command line (a la apt-get)?

Edit: looks like it’s already installed. HaikuDepot only shows an “Uninstall” button for this package.

pkgman install libexecinfo_devel

I installed the dev package: compilation is going on now. Thanks!

I now get another error:

39

That version of Node.js that you are trying to build is outdated and it is targeted for Linux. So it will not compile here.

The easiest way to build Node.js right now is to use haikuporter.

  1. pkgman install haikuporter
  2. git clone https://github.com/haikuports/haikuports.git --depth=10
  3. Edit the configuration file in ~/config/settings/haikuports.conf
    3.1 Change the TREE_PATH to the location of the haikuports folder.
    3.2 Change TARGET_ARCHITECTURE to x86_64
  4. Run haikuporter nodejs -G --no-source-packages --get-dependencies -j4
2 Likes

Thanks. I tried following your instructions but I don’t have an haikuports.conf file in ~/config/settings/.

There is one in /boot/system/settings and /boot/system/packages/adminstration…/haikuporter-1.2.2-2/settings/ but I guess I should not touch those.

Right, You might need to copy the sample config in the haikuporter repository [0] and place it in ~/config/settings/haikuports.conf and continue from 3.1.

[0] See: https://github.com/haikuports/haikuporter/blob/master/haikuports-sample.conf

Thanks: this did the trick. How do I compile it then? I’m not sure what running step 4 did.