DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd January 2021
mbauhardt mbauhardt is offline
New User
 
Join Date: Dec 2020
Posts: 7
Default NodeJS

Hi all,
i'm trying openbsd 6.8 on my laptop for the last couple of days and want to use "in production", which means as my daily driver for work.

I need nodejs in different versions, 12/10/8.

version 12 is available via pkg_add.
Do you see any chance to get/compile older versions of node?

This is a kind of show stopper for me, because the project I'm working on need all these lower versions of node.

Can I jump back i the history of the ports tree and compile the port node in the particular version I need? Or would you start a VM in an openbsd version which contains the node version I need, installit there and copy the binaries over to my host system which is openbsd 6.8?
Or do you see any other solution?

Thx
Marko
Reply With Quote
  #2   (View Single Post)  
Old 3rd January 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 305
Default

Copying binaries from an older OBSD version probably won't work as they will be linked against libraries that may not be present on the newer installation of OBSD.

Your best bet is probably to get the old version of the port out of CVS. You may need to update the port for any changes to the ports infrastructure. Then build it yourself.

I've had to maintain older versions of PostgreSQL for work this way for a number of years.

Even if you get node compiled, node modules are particularly troublesome, though, as they often hard code linuxisms and won't compile on OpenBSD.
Reply With Quote
  #3   (View Single Post)  
Old 3rd January 2021
mbauhardt mbauhardt is offline
New User
 
Join Date: Dec 2020
Posts: 7
Default

You mean
* checking out the latest ports tree
* copy over the content of node in the version i want to have
* build it

I'm getting errors when compiling node in revision https://github.com/openbsd/ports/com...85dda79401de15
The errors are about SSL. I tried to use shared-ssl or without-ssl option.

without success. :/

Last edited by mbauhardt; 3rd January 2021 at 12:11 PM.
Reply With Quote
  #4   (View Single Post)  
Old 3rd January 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 305
Default

Can you build the current port?
Reply With Quote
  #5   (View Single Post)  
Old 5th January 2021
mbauhardt mbauhardt is offline
New User
 
Join Date: Dec 2020
Posts: 7
Default

yes, I'm able to build the current port.
I thought building node with pkgsrc would be a good option.
But, It it failed as well with with missing headers... (ext/stdio_filebuf.h)

Anyway...
Reply With Quote
  #6   (View Single Post)  
Old 5th January 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 305
Default

I'm going to give you a bit of a hard time on this because you basically have to become the maintainer of the node port for yourself and learn all that there is to doing that if you want to keep older versions running.

Your post was sparce on info so I'm only assuming what you saw and did...

You didn't post the error message, but I assume I got the same one. What you listed as having tried is not what the error message told you to try. You have to pay attention to the errors. But even that ends up being a workaround and not the solution.

You know that the build used to work. You have to figure out what's changed between then and now. In the port and in OpenBSD. Save the current node port, check out the old one. Diff them. Look at the history in CVS between the two and read the commit messages. And understand what the node build is doing.

As I said, you have to bring any port changes made for the infrastructure back into the old port. It takes some time, but it's not hard.

You have to put in the work. This is for your job, not mine. If you don't want to or can't put in the work, then I suggest you just use Linux and NVM. I am sure you have plenty of other problems to solve.
Reply With Quote
  #7   (View Single Post)  
Old 5th January 2021
mbauhardt mbauhardt is offline
New User
 
Join Date: Dec 2020
Posts: 7
Default

Yes, sorry for beeing quiete about the error messages. (I'm logged into the forum from another computer).

What I understand is exactly what you wrote. I have to backport commit by commit all the changes they are made into the current. The thing is I need at the end of the week a "working" machine for work. So as you suggest, I go back to linux work with that. But this time I will create a separate partition of BSD. Maybe I will try NetBsd which have the different node versions. Or I will invest the time and energy to backport the previous node versions I need.

Thanks for your time. I learned something about OpenBSD, it feels awesome but I have to accept some workarounds or extra steps to get my env running. Which is fair.

Thx
Marko
Reply With Quote
  #8   (View Single Post)  
Old 5th January 2021
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

It is an unfortunate situation that your workflow requires something -- multiple versions of a third party package -- not delivered by the OpenBSD Project. Without some pre-existing OpenBSD Ports Tree skills, this will be technically daunting. As an example, from what you posted here about SSL errors it appears to me that -- at the very least -- there might be an API mismatch with LibreSSL versions. If so, this need to be addressed as local patches to lang/node source as the library calls in the older node source would need to be adapted to the API changes in the newer version of LibreSSL. But that's just a guess from your comment about SSL errors.

You might consider what it would take to host operating multiple versions of OpenBSD to meet your workflow needs -- e.g.: three workstations, or three disk drives, or three virtual machines -- might all be easier than undertaking a complex retrofit of NodeJS software.
Reply With Quote
  #9   (View Single Post)  
Old 6th January 2021
mbauhardt mbauhardt is offline
New User
 
Join Date: Dec 2020
Posts: 7
Default

Yes,
i have to tackle the learning curve about working with ports tree in order to get the knowledge how to backport changes etc.

I'm working as sw dev where we are working on a commercial product and we have to maintain older versions of it incl e.g. working with older versions of node.
Switching between branches and enable node with 'n' or 'nvm' is more convinient than working on 3 different machines or VM's etc. But maybe I have to be openminded and try such a solution.

thx for your input.
Reply With Quote
Old 6th January 2021
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

The ports tree does have a few examples of managing multiple versions of an application at the same time: lang/python and lang/erlang come to mind, as well as the special case toolchains devel/autoconf and devel/automake. So it is not an impossibility.
Reply With Quote
Reply

Tags
node, nodejs

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:48 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick