diff --git a/var/spack/repos/builtin/packages/node-js/fix-old-glibc-random-headers.patch b/var/spack/repos/builtin/packages/node-js/fix-old-glibc-random-headers.patch new file mode 100644 index 00000000000000..9629a6bb0c5342 --- /dev/null +++ b/var/spack/repos/builtin/packages/node-js/fix-old-glibc-random-headers.patch @@ -0,0 +1,22 @@ +diff --git a/deps/cares/config/linux/ares_config.h b/deps/cares/config/linux/ares_config.h +index 3cb135a..88934ad 100644 +--- a/deps/cares/config/linux/ares_config.h ++++ b/deps/cares/config/linux/ares_config.h +@@ -116,7 +116,7 @@ + #define HAVE_GETNAMEINFO 1 + + /* Define to 1 if you have `getrandom` */ +-#define HAVE_GETRANDOM 1 ++#undef HAVE_GETRANDOM + + /* Define to 1 if you have `getservbyport_r` */ + #define HAVE_GETSERVBYPORT_R 1 +@@ -329,7 +329,7 @@ + #define HAVE_SYS_PARAM_H 1 + + /* Define to 1 if you have the header file. */ +-#define HAVE_SYS_RANDOM_H 1 ++#undef HAVE_SYS_RANDOM_H + + /* Define to 1 if you have the header file. */ + #define HAVE_SYS_SELECT_H 1 diff --git a/var/spack/repos/builtin/packages/node-js/package.py b/var/spack/repos/builtin/packages/node-js/package.py index f624f59b2fc61d..b76d72ae91bdb9 100644 --- a/var/spack/repos/builtin/packages/node-js/package.py +++ b/var/spack/repos/builtin/packages/node-js/package.py @@ -22,17 +22,22 @@ class NodeJs(Package): license("Unicode-TOU") # Current (latest features) - odd major number + version("21.7.3", sha256="ce1f61347671ef219d9c2925313d629d3fef98fc8d7f5ef38dd4656f7d0f58e7") version("19.2.0", sha256="aac9d1a366fb57d68f4639f9204d1de5d6387656959a97ed929a5ba9e62c033a") + version("17.9.1", sha256="1102f5e0aafaab8014d19c6c57142caf2ba3ef69d88d7a7f0f82798051796027") version("15.3.0", sha256="cadfa384a5f14591b84ce07a1afe529f28deb0d43366fb0ae4e78afba96bfaf2") version("13.8.0", sha256="815b5e1b18114f35da89e4d98febeaba97555d51ef593bd5175db2b05f2e8be6") version("13.5.0", sha256="4b8078d896a7550d7ed399c1b4ac9043e9f883be404d9b337185c8d8479f2db8") # LTS (recommended for most users) - even major number version( - "18.12.1", - sha256="ba8174dda00d5b90943f37c6a180a1d37c861d91e04a4cb38dc1c0c74981c186", + "22.4.0", + sha256="b62cd83c9a57a11349883f89b1727a16e66c02eb6255a4bf32714ff5d93165f5", preferred=True, ) + version("22.3.0", sha256="6326484853093ab6b8f361a267445f4a5bff469042cda11a3585497b13136b55") + version("20.15.0", sha256="01e2c034467a324a33e778c81f2808dff13d289eaa9307d3e9b06c171e4d932d") + version("18.12.1", sha256="ba8174dda00d5b90943f37c6a180a1d37c861d91e04a4cb38dc1c0c74981c186") version("16.18.1", sha256="3d24c9c3a953afee43edc44569045eda56cd45cd58b0539922d17da62736189c") version("14.21.1", sha256="76ba961536dc11e4dfd9b198c61ff3399e655eca959ae4b66d926f29bfcce9d3") version("14.16.1", sha256="5f5080427abddde7f22fd2ba77cd2b8a1f86253277a1eec54bc98a202728ce80") @@ -79,9 +84,16 @@ class NodeJs(Package): # https://github.com/spack/spack/issues/19310 conflicts( "%gcc@:4.8", - msg="fails to build with gcc 4.8 (see https://github.com/spack/spack/issues/19310", + msg="fails to build with gcc 4.8 (see https://github.com/spack/spack/issues/19310)", ) + conflicts( + "%gcc@14:", when="@:19", msg="fails to build with gcc 14+ due to implicit conversions" + ) + + # See https://github.com/nodejs/node/issues/52223 + patch("fix-old-glibc-random-headers.patch", when="^glibc@:2.24") + def setup_build_environment(self, env): # Force use of experimental Python 3 support env.set("PYTHON", self.spec["python"].command.path)