metacall / core

MetaCall: The ultimate polyglot programming experience.
https://metacall.io
Apache License 2.0
1.55k stars 160 forks source link

build failure with node loader: icu4c v72.x is too old, v73.x or later is required #486

Closed hulxv closed 6 months ago

hulxv commented 6 months ago

🐛 Bug Report

Current Behavior

When I try to build the core manually with -DOPTION_BUILD_LOADERS_NODE=on (like what it was mentioned here). I face this build error:

ERROR: icu4c v72.x is too old, v73.x or later is required.
-- Build NodeJS shared library
make: Entering directory '/home/mohamed/dev/contributions/metacall/core/build/source/loaders/node_loader/sources/node-v21.6.1'
make: Leaving directory '/home/mohamed/dev/contributions/metacall/core/build/source/loaders/node_loader/sources/node-v21.6.1'
make: *** out: No such file or directory.  Stop.
CMake Error at cmake/FindNodeJS.cmake:574 (message):
  NodeJS library not found and it could not be built from source
Call Stack (most recent call first):
  source/loaders/node_loader/CMakeLists.txt:10 (find_package)

Possible Solution

That happens because node version above 20.x needs to icu4 v73.x and above but if we go to FindNodeJS.cmake, we will find it install icu-72.1v for the 18th nodejs version and above. So to solve this issue, we just need to make it installs icu-73.1v for nodejs 20.x and above. I will create a PR with that simple solution :D

Context (Environment)

$ node --version # I think this info is enough for our issue
v21.6.1