iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
622 stars 211 forks source link

Official Node 18 support #4135

Closed calebmshafer closed 2 years ago

calebmshafer commented 2 years ago

Node 18 is now in "Current" status and will go Active LTS on October 25th. We need to add the needed testing infrastructure to officially support Node 18 in anticipation of the Active LTS release.

Supporting Node 18 will be in addition to the current Node versions we support as the NAPI version has not changed.

This support will be in addition to the current versions we support.

iTwin.js Supported Node versions: https://www.itwinjs.org/learning/supportedplatforms/#supported-nodejs-versions Node.js Releases page: https://nodejs.org/en/about/releases/

calebmshafer commented 2 years ago

https://github.com/iTwin/itwinjs-core/pull/4295

ben-polinsky commented 2 years ago

Update:

The primary issue which needs to be resolved here is a segfault on Linux (20.04 + 24.04 tested + whatever we run in CI). It's being thrown during database access (CloudContainer::Connect eventually calls curl_multi_perform which hits openssl's SSL_get_peer_certificate). From my investigation, this seems like an issue between the statically linked OpenSSL in node18 and linux OS versions of node.

I'll attempt to upgrade OpenSSL on the OS. If that doesn't work, I'll need some more assistance or to hand this off to someone more familiar with our build.

FYI: Windows and Mac OS are mostly smooth sailing - no segfaults - but another small issue I will come back to.

image image

kabentley commented 2 years ago

@khanaffan @nick4598

nick4598 commented 2 years ago

@ben-polinsky any luck with upgrading OpenSSL on the os?

ben-polinsky commented 2 years ago

@nick4598 Just getting around to that now, I'll let you know

ben-polinsky commented 2 years ago

@nick4598 Upgraded, but same seg fault. We can get into it tomorrow if you have some time.

nick4598 commented 2 years ago

@ben-polinsky Sure

khanaffan commented 2 years ago

@ben-polinsky Node.Js is statically linked to OpenSSL though its private to Node.js. We have two OpenSSL libraries, one part of node.js which is 3.0 in node 18, while there is another one part of imodeljs.node addon which is 1.1.1.

So, upgrading the system open ssl will have no effect. You need to update imodel02/OpenSourceFork version of OpenSSL to match with Node.Js.

This may create an issue where our addon with OpenSSL 3.0 might not be able to work with the old node.js version. But we need to test that.

I will have debug build for node.js and native addon to see why its crashing.