From 7cc9725b0b21b1495353b25750f20e362f3b4050 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sat, 9 Nov 2024 12:00:00 +0000 Subject: [PATCH 01/10] nodejs: fix build on 32 bit platforms this test is failing on both armv7 and i686 and is related to year 2038 issue so it probably affects all 32 bit platforms (cherry picked from commit 815ec0c6f29c01c209e731f599734dff28ca33e5) --- pkgs/development/web/nodejs/nodejs.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 8881d608c95b1..ab63e1e14a7a6 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -321,6 +321,9 @@ let "test-watch-mode-files_watcher" ] ++ lib.optionals (!lib.versionAtLeast version "22") [ "test-tls-multi-key" + ] ++ lib.optionals stdenv.hostPlatform.is32bit [ + # utime (actually utimensat) fails with EINVAL on 2038 timestamp + "test-fs-utimes-y2K38" ] ++ lib.optionals stdenv.buildPlatform.isDarwin [ # Disable tests that don’t work under macOS sandbox. "test-macos-app-sandbox" From 564103c78faf97de89ad65daa6a133082e29c2f5 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 29 Oct 2024 15:30:11 +0100 Subject: [PATCH 02/10] nodejs_22: 22.10.0 -> 22.11.0 (cherry picked from commit 1e99bcac6f2b2bb2caee862c34976474280ea924) --- pkgs/development/web/nodejs/v22.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/web/nodejs/v22.nix b/pkgs/development/web/nodejs/v22.nix index 6a71b0056bf76..03d23ba9983a1 100644 --- a/pkgs/development/web/nodejs/v22.nix +++ b/pkgs/development/web/nodejs/v22.nix @@ -8,8 +8,8 @@ let in buildNodejs { inherit enableNpm; - version = "22.10.0"; - sha256 = "3180710d3130ad9df01466abf010e408d41b374be54301d1480d10eca73558e0"; + version = "22.11.0"; + sha256 = "bbf0297761d53aefda9d7855c57c7d2c272b83a7b5bad4fea9cb29006d8e1d35"; patches = [ ./configure-emulator.patch ./configure-armv6-vfpv2.patch From 9056aaa27ac05aece0d0c8b529fa8cc933576c66 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 24 May 2024 01:41:01 -0400 Subject: [PATCH 03/10] nodejs_{18,20}: fix build with clang 18 on Darwin (cherry picked from commit 94d28175ff761adc44d6f680b0070d36ba89b628) --- pkgs/development/web/nodejs/v18.nix | 7 +++++++ pkgs/development/web/nodejs/v20.nix | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index f470f32aac7e4..568359796f2a3 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -63,5 +63,12 @@ buildNodejs { url = "https://github.com/nodejs/node/commit/d0a6b605fba6cd69a82e6f12ff0363eef8fe1ee9.patch"; hash = "sha256-TfYal/PikRZHL6zpAlC3SmkYXCe+/8Gs83dLX/X/P/k="; }) + # Remove unused `fdopen` in vendored zlib, which causes compilation failures with clang 18 on Darwin. + (fetchpatch2 { + url = "https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9.patch?full_index=1"; + extraPrefix = "deps/v8/third_party/zlib/"; + stripLen = 1; + hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; + }) ] ++ gypPatches; } diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix index 6fa35c0ac4475..4d86a2df9fe9f 100644 --- a/pkgs/development/web/nodejs/v20.nix +++ b/pkgs/development/web/nodejs/v20.nix @@ -27,5 +27,13 @@ buildNodejs { ./bypass-darwin-xcrun-node16.patch ./node-npm-build-npm-package-logic.patch ./use-correct-env-in-tests.patch + + # Remove unused `fdopen` in vendored zlib, which causes compilation failures with clang 18 on Darwin. + (fetchpatch2 { + url = "https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9.patch?full_index=1"; + extraPrefix = "deps/v8/third_party/zlib/"; + stripLen = 1; + hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; + }) ] ++ gypPatches; } From 81987d9ff405b694b5378c9ebb053d125832e8c8 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 16 Nov 2024 16:16:24 +0000 Subject: [PATCH 04/10] nodejs_{18,20}: apply V8 patches for LLVM 19 (cherry picked from commit 5cb1de1b5da8c47ca67ee3f0bebff4276f22e39a) --- pkgs/development/web/nodejs/v18.nix | 15 +++++++++++++++ pkgs/development/web/nodejs/v20.nix | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index 568359796f2a3..ae1f670f8c257 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -70,5 +70,20 @@ buildNodejs { stripLen = 1; hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; }) + # Backport V8 fixes for LLVM 19. + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/182d9c05e78b1ddb1cb8242cd3628a7855a0336f%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-bDTwFbATPn5W4VifWz/SqaiigXYDWHq785C64VezuUE="; + }) + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/1a3ecc2483b2dba6ab9f7e9f8f4b60dbfef504b7%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg="; + }) ] ++ gypPatches; } diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix index 4d86a2df9fe9f..18a9635cb870b 100644 --- a/pkgs/development/web/nodejs/v20.nix +++ b/pkgs/development/web/nodejs/v20.nix @@ -35,5 +35,20 @@ buildNodejs { stripLen = 1; hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; }) + # Backport V8 fixes for LLVM 19. + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/182d9c05e78b1ddb1cb8242cd3628a7855a0336f%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-bDTwFbATPn5W4VifWz/SqaiigXYDWHq785C64VezuUE="; + }) + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/1a3ecc2483b2dba6ab9f7e9f8f4b60dbfef504b7%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg="; + }) ] ++ gypPatches; } From 858190e02c09aeb0088957008ba51a347a72b6df Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 16 Nov 2024 16:36:42 +0000 Subject: [PATCH 05/10] Revert "nodejs_18: fix build with clang 16 mk2" libc++ 19 no longer supports Clang < 17. This reverts commit b034e4cbf12f7c0d749674c102e31e6a47fa2d7f. (cherry picked from commit 42ef3589e685ba2ba10a67928341e5a40e225038) --- pkgs/development/web/nodejs/v18.nix | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index ae1f670f8c257..56e54d6fba9ed 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -1,9 +1,6 @@ { callPackage, lib, - overrideCC, - pkgs, - buildPackages, openssl, python311, fetchpatch2, @@ -11,25 +8,8 @@ }: let - # Clang 16+ cannot build Node v18 due to -Wenum-constexpr-conversion errors. - # Use an older version of clang with the current libc++ for compatibility (e.g., with icu). - ensureCompatibleCC = - packages: - if packages.stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion packages.stdenv.cc.cc) "16" then - overrideCC packages.llvmPackages_15.stdenv ( - packages.llvmPackages_15.stdenv.cc.override { - inherit (packages.llvmPackages) libcxx; - } - ) - else - packages.stdenv; - buildNodejs = callPackage ./nodejs.nix { inherit openssl; - stdenv = ensureCompatibleCC pkgs; - buildPackages = buildPackages // { - stdenv = ensureCompatibleCC buildPackages; - }; python = python311; }; From 0dbdc3b6afc0d6976451af3d8868c413015b0bba Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Fri, 22 Nov 2024 19:31:46 +0100 Subject: [PATCH 06/10] nodejs_{20,22,23}: fix flaky test (cherry picked from commit f634fa26cc24f7a32913f5c6d8afedcfd80116eb) --- pkgs/development/web/nodejs/nodejs.nix | 1 + pkgs/development/web/nodejs/v20.nix | 5 +++++ pkgs/development/web/nodejs/v22.nix | 6 ++++++ pkgs/development/web/nodejs/v23.nix | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index ab63e1e14a7a6..b2c007e339e7e 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -291,6 +291,7 @@ let "FLAKY_TESTS=skip" # Skip some tests that are not passing in this context "CI_SKIP_TESTS=${lib.concatStringsSep "," ([ + # Tests don't work in sandbox. "test-child-process-exec-env" "test-child-process-uid-gid" "test-fs-write-stream-eagain" diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix index 18a9635cb870b..5ff889928b9da 100644 --- a/pkgs/development/web/nodejs/v20.nix +++ b/pkgs/development/web/nodejs/v20.nix @@ -50,5 +50,10 @@ buildNodejs { stripLen = 1; hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg="; }) + # fixes test failure, remove when included in release + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/b6fe731c55eb4cb9d14042a23e5002ed39b7c8b7.patch?full_index=1"; + hash = "sha256-KoKsQBFKUji0GeEPTR8ixBflCiHBhPqd2cPVPuKyua8="; + }) ] ++ gypPatches; } diff --git a/pkgs/development/web/nodejs/v22.nix b/pkgs/development/web/nodejs/v22.nix index 03d23ba9983a1..5fe7a73e7aaba 100644 --- a/pkgs/development/web/nodejs/v22.nix +++ b/pkgs/development/web/nodejs/v22.nix @@ -18,5 +18,11 @@ buildNodejs { ./node-npm-build-npm-package-logic.patch ./use-correct-env-in-tests.patch ./bin-sh-node-run-v22.patch + + # fixes test failure, remove when included in release + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/b6fe731c55eb4cb9d14042a23e5002ed39b7c8b7.patch?full_index=1"; + hash = "sha256-KoKsQBFKUji0GeEPTR8ixBflCiHBhPqd2cPVPuKyua8="; + }) ]; } diff --git a/pkgs/development/web/nodejs/v23.nix b/pkgs/development/web/nodejs/v23.nix index 7e5a915ed3574..e496741d4b769 100644 --- a/pkgs/development/web/nodejs/v23.nix +++ b/pkgs/development/web/nodejs/v23.nix @@ -63,5 +63,10 @@ buildNodejs { url = "https://github.com/nodejs/node/commit/f270462c09ddfd770291a7c8a2cd204b2c63d730.patch?full_index=1"; hash = "sha256-Err0i5g7WtXcnhykKgrS3ocX7/3oV9UrT0SNeRtMZNU="; }) + # fixes test failure, remove when included in release + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/b6fe731c55eb4cb9d14042a23e5002ed39b7c8b7.patch?full_index=1"; + hash = "sha256-KoKsQBFKUji0GeEPTR8ixBflCiHBhPqd2cPVPuKyua8="; + }) ]; } From 7d52295f4e70d3055222ccc506f7e37db6a9f3c3 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Wed, 27 Nov 2024 09:26:25 +0100 Subject: [PATCH 07/10] nodejs_{20,22}: fix test-os failure Same as #356257 (cherry picked from commit cb05815e588481a472b44141ef53d3deae25c6e1) --- pkgs/development/web/nodejs/v20.nix | 10 ++++++++++ pkgs/development/web/nodejs/v22.nix | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix index 5ff889928b9da..b0afedff7f987 100644 --- a/pkgs/development/web/nodejs/v20.nix +++ b/pkgs/development/web/nodejs/v20.nix @@ -35,6 +35,16 @@ buildNodejs { stripLen = 1; hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; }) + # Fix for https://github.com/NixOS/nixpkgs/issues/355919 + # FIXME: remove after a minor point release + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/a094a8166cd772f89e92b5deef168e5e599fa815.patch?full_index=1"; + hash = "sha256-5FZfozYWRa1ZI/f+e+xpdn974Jg2DbiHbua13XUQP5E="; + }) + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/f270462c09ddfd770291a7c8a2cd204b2c63d730.patch?full_index=1"; + hash = "sha256-Err0i5g7WtXcnhykKgrS3ocX7/3oV9UrT0SNeRtMZNU="; + }) # Backport V8 fixes for LLVM 19. (fetchpatch2 { url = "https://chromium.googlesource.com/v8/v8/+/182d9c05e78b1ddb1cb8242cd3628a7855a0336f%5E%21/?format=TEXT"; diff --git a/pkgs/development/web/nodejs/v22.nix b/pkgs/development/web/nodejs/v22.nix index 5fe7a73e7aaba..8f57d42057c7b 100644 --- a/pkgs/development/web/nodejs/v22.nix +++ b/pkgs/development/web/nodejs/v22.nix @@ -19,6 +19,16 @@ buildNodejs { ./use-correct-env-in-tests.patch ./bin-sh-node-run-v22.patch + # Fix for https://github.com/NixOS/nixpkgs/issues/355919 + # FIXME: remove after a minor point release + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/a094a8166cd772f89e92b5deef168e5e599fa815.patch?full_index=1"; + hash = "sha256-5FZfozYWRa1ZI/f+e+xpdn974Jg2DbiHbua13XUQP5E="; + }) + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/f270462c09ddfd770291a7c8a2cd204b2c63d730.patch?full_index=1"; + hash = "sha256-Err0i5g7WtXcnhykKgrS3ocX7/3oV9UrT0SNeRtMZNU="; + }) # fixes test failure, remove when included in release (fetchpatch2 { url = "https://github.com/nodejs/node/commit/b6fe731c55eb4cb9d14042a23e5002ed39b7c8b7.patch?full_index=1"; From 20b148aae78d1f9cabe843665fb9ba7f1cbae021 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Sat, 14 Dec 2024 14:15:32 +0100 Subject: [PATCH 08/10] nodejs_18: fix test-os failure (cherry picked from commit bc353483c70ddb56bd06f4616f4bc41f59fbefe0) --- pkgs/development/web/nodejs/v18.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index 56e54d6fba9ed..a67a1538f83e4 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -65,5 +65,15 @@ buildNodejs { stripLen = 1; hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg="; }) + # Fix for https://github.com/NixOS/nixpkgs/issues/355919 + # FIXME: remove after a minor point release + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/a094a8166cd772f89e92b5deef168e5e599fa815.patch?full_index=1"; + hash = "sha256-5FZfozYWRa1ZI/f+e+xpdn974Jg2DbiHbua13XUQP5E="; + }) + (fetchpatch2 { + url = "https://github.com/nodejs/node/commit/f270462c09ddfd770291a7c8a2cd204b2c63d730.patch?full_index=1"; + hash = "sha256-Err0i5g7WtXcnhykKgrS3ocX7/3oV9UrT0SNeRtMZNU="; + }) ] ++ gypPatches; } From 598874d4e2db5965fbeac1316f35f6fccc853b7a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 25 Dec 2024 22:06:28 +0100 Subject: [PATCH 09/10] nodejs_22: 22.11.0 -> 22.12.0 (#361565) (cherry picked from commit e4f44407a7a9a5561cd6b589a6d27e7a8f91a720) --- pkgs/development/web/nodejs/v22.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/development/web/nodejs/v22.nix b/pkgs/development/web/nodejs/v22.nix index 8f57d42057c7b..2e4645af5590a 100644 --- a/pkgs/development/web/nodejs/v22.nix +++ b/pkgs/development/web/nodejs/v22.nix @@ -8,8 +8,8 @@ let in buildNodejs { inherit enableNpm; - version = "22.11.0"; - sha256 = "bbf0297761d53aefda9d7855c57c7d2c272b83a7b5bad4fea9cb29006d8e1d35"; + version = "22.12.0"; + sha256 = "fe1bc4be004dc12721ea2cb671b08a21de01c6976960ef8a1248798589679e16"; patches = [ ./configure-emulator.patch ./configure-armv6-vfpv2.patch @@ -21,10 +21,6 @@ buildNodejs { # Fix for https://github.com/NixOS/nixpkgs/issues/355919 # FIXME: remove after a minor point release - (fetchpatch2 { - url = "https://github.com/nodejs/node/commit/a094a8166cd772f89e92b5deef168e5e599fa815.patch?full_index=1"; - hash = "sha256-5FZfozYWRa1ZI/f+e+xpdn974Jg2DbiHbua13XUQP5E="; - }) (fetchpatch2 { url = "https://github.com/nodejs/node/commit/f270462c09ddfd770291a7c8a2cd204b2c63d730.patch?full_index=1"; hash = "sha256-Err0i5g7WtXcnhykKgrS3ocX7/3oV9UrT0SNeRtMZNU="; From 0f893f1d886ddddebeee4f47b2e6b887f6a3911c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 25 Dec 2024 22:07:09 +0100 Subject: [PATCH 10/10] nodejs_23: 23.2.0 -> 23.5.0 (#357699) (cherry picked from commit 2b8df7696923fa204511df546be1256a8b9cfa1f) --- pkgs/development/web/nodejs/v23.nix | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pkgs/development/web/nodejs/v23.nix b/pkgs/development/web/nodejs/v23.nix index e496741d4b769..712c4d41d3a74 100644 --- a/pkgs/development/web/nodejs/v23.nix +++ b/pkgs/development/web/nodejs/v23.nix @@ -14,8 +14,8 @@ let in buildNodejs { inherit enableNpm; - version = "23.2.0"; - sha256 = "3cf7a8a36682775693691f1de901bb5973ad3c0ae2aa87b1add9de515e7b2fc7"; + version = "23.5.0"; + sha256 = "32e77b36c0774c68baab41bc7c2acc58663ca0a2b7c4d3e9bec6f761c15fdac0"; patches = [ ./configure-emulator.patch ./configure-armv6-vfpv2.patch @@ -53,20 +53,10 @@ buildNodejs { hash = "sha256-gmIyiSyNzC3pClL1SM2YicckWM+/2tsbV1xv2S3d5G0="; revert = true; }) - # Fix for https://github.com/NixOS/nixpkgs/issues/355919 # FIXME: remove after a minor point release (fetchpatch2 { - url = "https://github.com/nodejs/node/commit/a094a8166cd772f89e92b5deef168e5e599fa815.patch?full_index=1"; - hash = "sha256-5FZfozYWRa1ZI/f+e+xpdn974Jg2DbiHbua13XUQP5E="; - }) - (fetchpatch2 { - url = "https://github.com/nodejs/node/commit/f270462c09ddfd770291a7c8a2cd204b2c63d730.patch?full_index=1"; - hash = "sha256-Err0i5g7WtXcnhykKgrS3ocX7/3oV9UrT0SNeRtMZNU="; - }) - # fixes test failure, remove when included in release - (fetchpatch2 { - url = "https://github.com/nodejs/node/commit/b6fe731c55eb4cb9d14042a23e5002ed39b7c8b7.patch?full_index=1"; - hash = "sha256-KoKsQBFKUji0GeEPTR8ixBflCiHBhPqd2cPVPuKyua8="; + url = "https://github.com/nodejs/node/commit/49acdc8748fe9fe83bc1b444e24c456dff00ecc5.patch?full_index=1"; + hash = "sha256-iK7bj4KswTeQ9I3jJ22ZPTsvCU8xeGGXEOo43dxg3Mk="; }) ]; }