From 55c1516e12463d529420eeb21cbf9deafcda210a Mon Sep 17 00:00:00 2001 From: Wildan M Date: Fri, 20 Feb 2026 06:22:19 +0700 Subject: [PATCH] Fix nodejs crash assertion, update opts, add to CI --- config/x86_64/ci.toml | 1 + recipes/wip/dev/lang/nodejs-21/recipe.toml | 7 ++----- recipes/wip/dev/lang/nodejs-21/redox.patch | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index d0d5115b1..169ad967d 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -127,6 +127,7 @@ netutils = {} neverball = {} nghttp2 = {} nginx = {} +nodejs-21 = {} nushell = {} onefetch = {} openjazz = {} diff --git a/recipes/wip/dev/lang/nodejs-21/recipe.toml b/recipes/wip/dev/lang/nodejs-21/recipe.toml index e7cbeaff6..1d08638e2 100644 --- a/recipes/wip/dev/lang/nodejs-21/recipe.toml +++ b/recipes/wip/dev/lang/nodejs-21/recipe.toml @@ -1,4 +1,4 @@ -#TODO page fault +#TODO node is working but ld.so crashing with npm [source] tar = "https://nodejs.org/dist/v21.7.3/node-v21.7.3.tar.xz" blake3 = "95a56db4f9729b2f8384ab58ccb2ec0c41da05991f7400ef97bd76748d77870b" @@ -58,10 +58,7 @@ COOKBOOK_CONFIGURE_FLAGS=( --shared-nghttp3 --shared-openssl --shared-zlib - --disable-shared-readonly-heap - --without-node-snapshot - --without-node-code-cache - --v8-lite-mode + --without-inspector # TODO: Find a way to separate host and target flags instead? # --shared-zlib-includes="${COOKBOOK_TOOLCHAIN}/include" --shared-openssl-includes="${COOKBOOK_SYSROOT}/include" diff --git a/recipes/wip/dev/lang/nodejs-21/redox.patch b/recipes/wip/dev/lang/nodejs-21/redox.patch index 82f99e0ae..f5acaaa43 100644 --- a/recipes/wip/dev/lang/nodejs-21/redox.patch +++ b/recipes/wip/dev/lang/nodejs-21/redox.patch @@ -203,6 +203,23 @@ diff -ruwN source/deps/v8/src/base/platform/platform-posix.cc source-new/deps/v8 flags |= MAP_NORESERVE; #endif // !V8_OS_AIX && !V8_OS_FREEBSD && !V8_OS_QNX #if V8_OS_QNX +@@ -565,14 +569,8 @@ + // MADV_FREE_REUSABLE sometimes fails, so fall back to MADV_DONTNEED. + ret = madvise(address, size, MADV_DONTNEED); + } +-#elif defined(_AIX) || defined(V8_OS_SOLARIS) +- int ret = madvise(reinterpret_cast(address), size, MADV_FREE); +- if (ret != 0 && errno == ENOSYS) { +- return true; // madvise is not available on all systems. +- } +- if (ret != 0 && errno == EINVAL) { +- ret = madvise(reinterpret_cast(address), size, MADV_DONTNEED); +- } ++#elif defined(_AIX) || defined(V8_OS_SOLARIS) || defined(V8_OS_REDOX) ++ int ret = 0; // madvise is not available on all systems. + #else + int ret = madvise(address, size, MADV_DONTNEED); + #endif diff -ruwN source/deps/v8/src/base/platform/platform-redox.cc source-new/deps/v8/src/base/platform/platform-redox.cc --- source/deps/v8/src/base/platform/platform-redox.cc 1970-01-01 07:00:00.000000000 +0700 +++ source-new/deps/v8/src/base/platform/platform-redox.cc 2025-10-10 15:23:18.233737033 +0700