From 336c757f09a5bdbcd09802cd2484c6a16ad7d552 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 7 Mar 2026 23:52:08 +0100 Subject: [PATCH 1/9] tools: make `v8.nix` more stable If we only pass to the V8 builders the dependencies it actually needs, we can avoid rebuilding the same version of V8 just because an unrelated Node.js dependency has been updated. --- shell.nix | 112 +++++++++++++++----------- tools/dep_updaters/update-gyp-next.sh | 12 ++- tools/gyp/src.nix | 4 + tools/nix/non-v8-deps-mock.nix | 76 +++++++++++++++++ tools/nix/v8.nix | 75 +++++++++-------- 5 files changed, 196 insertions(+), 83 deletions(-) create mode 100644 tools/gyp/src.nix create mode 100644 tools/nix/non-v8-deps-mock.nix diff --git a/shell.nix b/shell.nix index fc20fca2ce095e..c6c62a936c67bf 100644 --- a/shell.nix +++ b/shell.nix @@ -18,21 +18,18 @@ withSQLite ? true, withSSL ? true, withTemporal ? false, - sharedLibDeps ? - let - d = import ./tools/nix/sharedLibDeps.nix { - inherit - pkgs - withLief - withQuic - withSQLite - withSSL - withTemporal - ; - }; - in - # To avoid conflicts with V8's bundled simdutf lib, it's easier to remove it when using a precompiled V8. - if (useSeparateDerivationForV8 != false) then builtins.removeAttrs d [ "simdutf" ] else d, + sharedLibDeps ? ( + import ./tools/nix/sharedLibDeps.nix { + inherit + pkgs + withLief + withQuic + withSQLite + withSSL + withTemporal + ; + } + ), # dev tools (not needed to build Node.js, useful to maintain it) ncu-path ? null, # Provide this if you want to use a local version of NCU @@ -45,9 +42,20 @@ let useSharedAda = builtins.hasAttr "ada" sharedLibDeps; useSharedOpenSSL = builtins.hasAttr "openssl" sharedLibDeps; - needsRustCompiler = withTemporal && !builtins.hasAttr "temporal_capi" sharedLibDeps; + useSharedTemporal = builtins.hasAttr "temporal_capi" sharedLibDeps; + needsRustCompiler = withTemporal && !useSharedTemporal; - buildInputs = builtins.attrValues sharedLibDeps ++ pkgs.lib.optional useSharedICU icu; + nativeBuildInputs = + pkgs.nodejs-slim_latest.nativeBuildInputs + ++ pkgs.lib.optionals needsRustCompiler [ + pkgs.cargo + pkgs.rustc + ]; + buildInputs = + pkgs.lib.optional useSharedICU icu + ++ pkgs.lib.optional (withTemporal && useSharedTemporal) sharedLibDeps.temporal_capi; + + # Put here only the configure flags that affect the V8 build configureFlags = [ ( if icu == null then @@ -57,47 +65,31 @@ let ) ] ++ extraConfigFlags - ++ pkgs.lib.optional (!withAmaro) "--without-amaro" - ++ pkgs.lib.optional (!withLief) "--without-lief" - ++ pkgs.lib.optional withQuic "--experimental-quic" - ++ pkgs.lib.optional (!withSQLite) "--without-sqlite" - ++ pkgs.lib.optional (!withSSL) "--without-ssl" ++ pkgs.lib.optional withTemporal "--v8-enable-temporal-support" - ++ pkgs.lib.optional (ninja != null) "--ninja" - ++ pkgs.lib.optional loadJSBuiltinsDynamically "--node-builtin-modules-path=${builtins.toString ./.}" - ++ pkgs.lib.concatMap (name: [ - "--shared-${name}" - "--shared-${name}-libpath=${pkgs.lib.getLib sharedLibDeps.${name}}/lib" - "--shared-${name}-include=${pkgs.lib.getInclude sharedLibDeps.${name}}/include" - ]) (builtins.attrNames sharedLibDeps); + ++ pkgs.lib.optional (withTemporal && useSharedTemporal) "--shared-temporal_capi"; in pkgs.mkShell { - inherit (pkgs.nodejs-slim_latest) nativeBuildInputs; + inherit nativeBuildInputs; buildInputs = - buildInputs + builtins.attrValues sharedLibDeps + ++ buildInputs ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) ( if useSeparateDerivationForV8 == true then - import ./tools/nix/v8.nix { - inherit - pkgs - configureFlags - buildInputs - needsRustCompiler - ; + let + sharedLibsToMock = pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { }; + in + pkgs.callPackage ./tools/nix/v8.nix { + inherit nativeBuildInputs; + + configureFlags = configureFlags ++ sharedLibsToMock.configureFlags ++ [ "--ninja" ]; + buildInputs = buildInputs ++ [ sharedLibsToMock ]; } else useSeparateDerivationForV8 ); - packages = - pkgs.lib.optional (ccache != null) ccache - ++ devTools - ++ benchmarkTools - ++ pkgs.lib.optionals needsRustCompiler [ - pkgs.cargo - pkgs.rustc - ]; + packages = devTools ++ benchmarkTools ++ pkgs.lib.optional (ccache != null) ccache; shellHook = pkgs.lib.optionalString (ccache != null) '' export CC="${pkgs.lib.getExe ccache} $CC" @@ -107,7 +99,33 @@ pkgs.mkShell { BUILD_WITH = if (ninja != null) then "ninja" else "make"; NINJA = pkgs.lib.optionalString (ninja != null) "${pkgs.lib.getExe ninja}"; CONFIG_FLAGS = builtins.toString ( - configureFlags ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) "--without-bundled-v8" + configureFlags + ++ pkgs.lib.optional (ninja != null) "--ninja" + ++ pkgs.lib.optional (!withAmaro) "--without-amaro" + ++ pkgs.lib.optional (!withLief) "--without-lief" + ++ pkgs.lib.optional withQuic "--experimental-quic" + ++ pkgs.lib.optional (!withSQLite) "--without-sqlite" + ++ pkgs.lib.optional (!withSSL) "--without-ssl" + ++ pkgs.lib.optional loadJSBuiltinsDynamically "--node-builtin-modules-path=${builtins.toString ./.}" + ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) "--without-bundled-v8" + ++ + pkgs.lib.concatMap + (name: [ + "--shared-${name}" + "--shared-${name}-libpath=${pkgs.lib.getLib sharedLibDeps.${name}}/lib" + "--shared-${name}-include=${pkgs.lib.getInclude sharedLibDeps.${name}}/include" + ]) + ( + builtins.attrNames ( + if (useSeparateDerivationForV8 != false) then + builtins.removeAttrs sharedLibDeps [ + "simdutf" + "temporal_capi" + ] + else + sharedLibDeps + ) + ) ); NOSQLITE = pkgs.lib.optionalString (!withSQLite) "1"; } diff --git a/tools/dep_updaters/update-gyp-next.sh b/tools/dep_updaters/update-gyp-next.sh index 731e91f3234d31..ca2a2dd30e2e8f 100755 --- a/tools/dep_updaters/update-gyp-next.sh +++ b/tools/dep_updaters/update-gyp-next.sh @@ -39,9 +39,10 @@ GYP_NEXT_TARBALL="$NEW_VERSION.tar.gz" cd "$WORKSPACE" -curl -sL -o "$GYP_NEXT_TARBALL" "https://github.com/nodejs/gyp-next/archive/refs/tags/v$NEW_VERSION.tar.gz" +URL="https://github.com/nodejs/gyp-next/archive/refs/tags/v$NEW_VERSION.tar.gz" +curl -sL -o "$GYP_NEXT_TARBALL" "$URL" -log_and_verify_sha256sum "gyp-next" "$GYP_NEXT_TARBALL" +HASH=$(log_and_verify_sha256sum "gyp-next" "$GYP_NEXT_TARBALL") gzip -dc "$GYP_NEXT_TARBALL" | tar xf - @@ -49,6 +50,13 @@ rm "$GYP_NEXT_TARBALL" mv "gyp-next-$NEW_VERSION" gyp +cat -> "$WORKSPACE/gyp/src.nix" < "$filtered" + filterdiff -p1 -i 'tools/gyp/pylib/*' "$patch" > "$filtered" if [ -s "$filtered" ]; then patches+=("$filtered") fi done + tar -C tools -xzf ${import ../../tools/gyp/src.nix} --wildcards 'gyp-*/pylib' + mv tools/gyp-* tools/gyp + ''; + # We need to remove the node_inspector.gypi ref so GYP does not search for it. + postPatch = '' + substituteInPlace node.gyp --replace-fail "'includes' : [ 'src/inspector/node_inspector.gypi' ]" "'includes' : []" ''; - inherit (nodejs) configureScript; - inherit configureFlags buildInputs; + inherit configureScript configureFlags buildInputs; - nativeBuildInputs = - nodejs.nativeBuildInputs - ++ [ - pkgs.patchutils - pkgs.validatePkgConfig - ] - ++ pkgs.lib.optionals needsRustCompiler [ - pkgs.cargo - pkgs.rustc - ]; + nativeBuildInputs = nativeBuildInputs ++ [ + patchutils + validatePkgConfig + ]; buildPhase = '' ninja -v -C out/Release v8_snapshot v8_libplatform ''; installPhase = '' ${ - if pkgs.stdenv.hostPlatform.isDarwin then + if stdenv.hostPlatform.isDarwin then # Darwin is excluded from creating thin archive in tools/gyp/pylib/gyp/generator/ninja.py:2488 "install -Dm644 out/Release/lib* -t $out/lib" else @@ -115,7 +122,7 @@ pkgs.stdenv.mkDerivation (finalAttrs: { cat -> $out/lib/pkgconfig/v8.pc << EOF Name: v8 Description: V8 JavaScript Engine build for Node.js CI - Version: ${version} + Version: ${finalAttrs.version} Libs: -L$out/lib $(for f in $out/lib/lib*.a; do b=$(basename "$f" .a) printf " -l%s" "''${b#lib}" From 7f2d1824ca7a08c90e89380a94bc0e99b1f72ecc Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 30 Mar 2026 18:31:42 +0200 Subject: [PATCH 2/9] fix typo --- tools/nix/non-v8-deps-mock.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nix/non-v8-deps-mock.nix b/tools/nix/non-v8-deps-mock.nix index 7477aabe417cc5..46933fd09c282b 100644 --- a/tools/nix/non-v8-deps-mock.nix +++ b/tools/nix/non-v8-deps-mock.nix @@ -30,7 +30,7 @@ let }; in symlinkJoin (finalAttrs: { - name = "non-v8-deps-mock"; + pname = "non-v8-deps-mock"; version = "0.0.0-mock"; nativeBuildInputs = [ validatePkgConfig ]; From d35e15b91a3ab3b1941f45eb1c90c23000206aa7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 31 Mar 2026 11:33:53 +0200 Subject: [PATCH 3/9] add support for small ICU --- shell.nix | 2 +- tools/nix/v8.nix | 69 ++++++++++++++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/shell.nix b/shell.nix index c6c62a936c67bf..022af37c5c1a70 100644 --- a/shell.nix +++ b/shell.nix @@ -80,7 +80,7 @@ pkgs.mkShell { sharedLibsToMock = pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { }; in pkgs.callPackage ./tools/nix/v8.nix { - inherit nativeBuildInputs; + inherit nativeBuildInputs icu; configureFlags = configureFlags ++ sharedLibsToMock.configureFlags ++ [ "--ninja" ]; buildInputs = buildInputs ++ [ sharedLibsToMock ]; diff --git a/tools/nix/v8.nix b/tools/nix/v8.nix index b7f27c0d649b35..7f66f4161be771 100644 --- a/tools/nix/v8.nix +++ b/tools/nix/v8.nix @@ -5,9 +5,17 @@ patchutils, validatePkgConfig, nodejs-slim_latest, + icu, - buildInputs ? [ ], - configureFlags ? [ ], + buildInputs ? [ icu ], + configureFlags ? [ + ( + if icu == null then + "--without-intl" + else + "--with-intl=${if builtins.isString icu then icu else "system"}-icu" + ) + ], configureScript ? nodejs-slim_latest.configureScript, nativeBuildInputs ? nodejs-slim_latest.nativeBuildInputs, @@ -41,29 +49,40 @@ stdenv.mkDerivation (finalAttrs: { in fileset.toSource { root = ../../.; - fileset = fileset.unions [ - v8Dir - ../../common.gypi - ../../configure.py - ../../node.gyp - ../../node.gypi - ../../src/node_version.h - ../../tools/configure.d/nodedownload.py - ../../tools/getmoduleversion.py - ../../tools/getnapibuildversion.py - ../../tools/gyp_node.py - ../../tools/icu/icu_versions.json - ../../tools/icu/icu-system.gyp - ../../tools/utils.py - ../../tools/v8_gypfiles/abseil.gyp - ../../tools/v8_gypfiles/features.gypi - ../../tools/v8_gypfiles/ForEachFormat.py - ../../tools/v8_gypfiles/ForEachReplace.py - ../../tools/v8_gypfiles/GN-scraper.py - ../../tools/v8_gypfiles/inspector.gypi - ../../tools/v8_gypfiles/toolchain.gypi - ../../tools/v8_gypfiles/v8.gyp - ]; + fileset = fileset.unions ( + [ + v8Dir + ../../common.gypi + ../../configure.py + ../../node.gyp + ../../node.gypi + ../../src/node_version.h + ../../tools/configure.d/nodedownload.py + ../../tools/getmoduleversion.py + ../../tools/getnapibuildversion.py + ../../tools/gyp_node.py + ../../tools/icu/icu_versions.json + ../../tools/icu/icu-system.gyp + ../../tools/utils.py + ../../tools/v8_gypfiles/abseil.gyp + ../../tools/v8_gypfiles/features.gypi + ../../tools/v8_gypfiles/ForEachFormat.py + ../../tools/v8_gypfiles/ForEachReplace.py + ../../tools/v8_gypfiles/GN-scraper.py + ../../tools/v8_gypfiles/inspector.gypi + ../../tools/v8_gypfiles/toolchain.gypi + ../../tools/v8_gypfiles/v8.gyp + ] + ++ lib.optionals (icu == "small") [ + ../../deps/icu-small + ../../tools/icu/current_ver.dep + ../../tools/icu/icu_small.json + ../../tools/icu/icu-generic.gyp + ../../tools/icu/iculslocs.cc + ../../tools/icu/icutrim.py + ../../tools/icu/no-op.cc + ] + ); }; # We need to download and patch GYP to work from within Nix sandbox From 731953bd071b8961ba97396714d52808c4c49180 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 31 Mar 2026 19:36:08 +0200 Subject: [PATCH 4/9] add support for no ICU --- tools/nix/v8.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/nix/v8.nix b/tools/nix/v8.nix index 7f66f4161be771..3c0395fe005f62 100644 --- a/tools/nix/v8.nix +++ b/tools/nix/v8.nix @@ -7,7 +7,7 @@ nodejs-slim_latest, icu, - buildInputs ? [ icu ], + buildInputs ? lib.optional (icu != null) icu, configureFlags ? [ ( if icu == null then @@ -61,8 +61,6 @@ stdenv.mkDerivation (finalAttrs: { ../../tools/getmoduleversion.py ../../tools/getnapibuildversion.py ../../tools/gyp_node.py - ../../tools/icu/icu_versions.json - ../../tools/icu/icu-system.gyp ../../tools/utils.py ../../tools/v8_gypfiles/abseil.gyp ../../tools/v8_gypfiles/features.gypi @@ -73,6 +71,10 @@ stdenv.mkDerivation (finalAttrs: { ../../tools/v8_gypfiles/toolchain.gypi ../../tools/v8_gypfiles/v8.gyp ] + ++ lib.optionals (icu != null) [ + ../../tools/icu/icu_versions.json + ../../tools/icu/icu-system.gyp + ] ++ lib.optionals (icu == "small") [ ../../deps/icu-small ../../tools/icu/current_ver.dep @@ -102,6 +104,12 @@ stdenv.mkDerivation (finalAttrs: { # We need to remove the node_inspector.gypi ref so GYP does not search for it. postPatch = '' substituteInPlace node.gyp --replace-fail "'includes' : [ 'src/inspector/node_inspector.gypi' ]" "'includes' : []" + '' + + lib.optionalString (icu == null) '' + substituteInPlace configure.py \ + --replace-fail \ + "icu_versions = json.loads((tools_path / 'icu' / 'icu_versions.json').read_text(encoding='utf-8'))" \ + "icu_versions = { 'minimum_icu': 1 }" ''; inherit configureScript configureFlags buildInputs; From 1af9e543322efa0fd3adbf6c3d379ebc3cfa9280 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 2 Apr 2026 10:01:36 +0200 Subject: [PATCH 5/9] squash! nits --- tools/nix/v8.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/nix/v8.nix b/tools/nix/v8.nix index 3c0395fe005f62..92bab590b287f2 100644 --- a/tools/nix/v8.nix +++ b/tools/nix/v8.nix @@ -4,7 +4,6 @@ lib, patchutils, validatePkgConfig, - nodejs-slim_latest, icu, buildInputs ? lib.optional (icu != null) icu, @@ -17,6 +16,7 @@ ) ], + nodejs-slim_latest ? null, configureScript ? nodejs-slim_latest.configureScript, nativeBuildInputs ? nodejs-slim_latest.nativeBuildInputs, patches ? nodejs-slim_latest.patches, @@ -120,9 +120,13 @@ stdenv.mkDerivation (finalAttrs: { ]; buildPhase = '' + runHook preBuild ninja -v -C out/Release v8_snapshot v8_libplatform + runHook postBuild ''; installPhase = '' + runHook preInstall + ${ if stdenv.hostPlatform.isDarwin then # Darwin is excluded from creating thin archive in tools/gyp/pylib/gyp/generator/ninja.py:2488 @@ -156,5 +160,7 @@ stdenv.mkDerivation (finalAttrs: { done) -lstdc++ Cflags: -I${v8Dir}/include -I${v8Dir}/third_party/abseil-cpp -I${v8Dir}/third_party/simdutf EOF + + runHook postInstall ''; }) From 8f313988c9d2fbdf4bca910a1c1673ed5384f67c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 2 Apr 2026 16:03:51 +0200 Subject: [PATCH 6/9] squash! fix Temporal support --- tools/nix/temporal-no-vendored-icu.patch | 63 ++++++++++++++++++++++++ tools/nix/v8.nix | 7 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 tools/nix/temporal-no-vendored-icu.patch diff --git a/tools/nix/temporal-no-vendored-icu.patch b/tools/nix/temporal-no-vendored-icu.patch new file mode 100644 index 00000000000000..d9a06b3ce6945f --- /dev/null +++ b/tools/nix/temporal-no-vendored-icu.patch @@ -0,0 +1,63 @@ +diff --git a/deps/v8/src/objects/js-temporal-zoneinfo64.cc b/deps/v8/src/objects/js-temporal-zoneinfo64.cc +index 99dd3a84c1e..b6b399c10dc 100644 +--- a/deps/v8/src/objects/js-temporal-zoneinfo64.cc ++++ b/deps/v8/src/objects/js-temporal-zoneinfo64.cc +@@ -11,12 +11,44 @@ + #include "temporal_rs/TimeZone.hpp" + + #ifdef V8_INTL_SUPPORT +-#include "udatamem.h" ++#include "unicode/udata.h" ++typedef struct { ++ uint16_t headerSize; ++ uint8_t magic1; ++ uint8_t magic2; ++} MappedData; ++typedef struct { ++ MappedData dataHeader; ++ UDataInfo info; ++} DataHeader; ++typedef struct { ++ void* Lookup; ++ void* NumEntries; ++} commonDataFuncs; ++struct UDataMemory { ++ const commonDataFuncs *vFuncs; /* Function Pointers for accessing TOC */ ++ ++ const DataHeader *pHeader; /* Header of the memory being described by this */ ++ /* UDataMemory object. */ ++ const void *toc; /* For common memory, table of contents for */ ++ /* the pieces within. */ ++ UBool heapAllocated; /* True if this UDataMemory Object is on the */ ++ /* heap and thus needs to be deleted when closed. */ ++ ++ void *mapAddr; /* For mapped or allocated memory, the start addr. */ ++ /* Only non-null if a close operation should unmap */ ++ /* the associated data. */ ++ void *map; /* Handle, or other data, OS dependent. */ ++ /* Only non-null if a close operation should unmap */ ++ /* the associated data, and additional info */ ++ /* beyond the mapAddr is needed to do that. */ ++ int32_t length; /* Length of the data in bytes; -1 if unknown. */ ++}; + #else + // Defined in builtins-temporal-zoneinfo64-data.cc, generated by + // include-file-as-bytes.py +-extern "C" uint32_t zoneinfo64_static_data[]; +-extern "C" size_t zoneinfo64_static_data_len; ++static uint32_t zoneinfo64_static_data[] = {}; ++static size_t zoneinfo64_static_data_len = 0; + #endif + + namespace v8::internal { +@@ -33,7 +65,7 @@ ZoneInfo64Provider::ZoneInfo64Provider() { + // NOT udata_getLength: this ignores the header, + // and we're parsing resb files with the header + auto length = memory->length; +- const void* data = udata_getRawMemory(memory); ++ const void* data = udata_getMemory(memory); + DCHECK_WITH_MSG(length % 4 == 0, "ICU4C should align udata to uint32_t"); + if (length % 4 != 0) { + // This really shouldn't happen: ICU4C aligns these files +-- +2.51.0 diff --git a/tools/nix/v8.nix b/tools/nix/v8.nix index 92bab590b287f2..e5f410e79368da 100644 --- a/tools/nix/v8.nix +++ b/tools/nix/v8.nix @@ -87,10 +87,15 @@ stdenv.mkDerivation (finalAttrs: { ); }; + patches = lib.optional ( + # V8 accesses internal ICU headers and methods in the Temporal files. + !(builtins.isString icu) && builtins.elem "--v8-enable-temporal-support" configureFlags + ) ./temporal-no-vendored-icu.patch; + # We need to download and patch GYP to work from within Nix sandbox # and so the local pycache does not pollute the hash. prePatch = '' - patches=() + ${lib.optionalString (builtins.length finalAttrs.patches == 0) "patches=()"} for patch in ${lib.concatStringsSep " " patches}; do filtered=$(mktemp) filterdiff -p1 -i 'tools/gyp/pylib/*' "$patch" > "$filtered" From ad981c4376026c2189e81d48ed28a7cc1fa9c221 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 2 Apr 2026 18:17:42 +0200 Subject: [PATCH 7/9] squash! use `gitTracked` --- Makefile | 1 + tools/dep_updaters/update-gyp-next.sh | 12 +-- tools/gyp/src.nix | 4 - tools/nix/v8.nix | 103 +++++++++++++------------- 4 files changed, 56 insertions(+), 64 deletions(-) delete mode 100644 tools/gyp/src.nix diff --git a/Makefile b/Makefile index 231bbe11f4c011..a85cf7b46d9918 100644 --- a/Makefile +++ b/Makefile @@ -1212,6 +1212,7 @@ $(TARBALL): release-only doc-only mkdir -p $(TARNAME)/doc/api cp doc/node.1 $(TARNAME)/doc/node.1 cp -r out/doc/api/* $(TARNAME)/doc/api/ + sed 's/fileset = fileset.intersection (fileset.gitTracked root)/fileset =/' tools/nix/v8.nix > $(TARNAME)/tools/nix/v8.nix $(RM) -r $(TARNAME)/.editorconfig $(RM) -r $(TARNAME)/.git* $(RM) -r $(TARNAME)/.mailmap diff --git a/tools/dep_updaters/update-gyp-next.sh b/tools/dep_updaters/update-gyp-next.sh index ca2a2dd30e2e8f..731e91f3234d31 100755 --- a/tools/dep_updaters/update-gyp-next.sh +++ b/tools/dep_updaters/update-gyp-next.sh @@ -39,10 +39,9 @@ GYP_NEXT_TARBALL="$NEW_VERSION.tar.gz" cd "$WORKSPACE" -URL="https://github.com/nodejs/gyp-next/archive/refs/tags/v$NEW_VERSION.tar.gz" -curl -sL -o "$GYP_NEXT_TARBALL" "$URL" +curl -sL -o "$GYP_NEXT_TARBALL" "https://github.com/nodejs/gyp-next/archive/refs/tags/v$NEW_VERSION.tar.gz" -HASH=$(log_and_verify_sha256sum "gyp-next" "$GYP_NEXT_TARBALL") +log_and_verify_sha256sum "gyp-next" "$GYP_NEXT_TARBALL" gzip -dc "$GYP_NEXT_TARBALL" | tar xf - @@ -50,13 +49,6 @@ rm "$GYP_NEXT_TARBALL" mv "gyp-next-$NEW_VERSION" gyp -cat -> "$WORKSPACE/gyp/src.nix" < Date: Thu, 2 Apr 2026 19:20:19 +0200 Subject: [PATCH 8/9] squash! no impure --- tools/nix/v8.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/nix/v8.nix b/tools/nix/v8.nix index 0bd4041757e5dc..73356f067c3a63 100644 --- a/tools/nix/v8.nix +++ b/tools/nix/v8.nix @@ -157,16 +157,29 @@ stdenv.mkDerivation (finalAttrs: { '' } + install -Dm644 deps/v8/third_party/simdutf/simdutf.h -t $out/include + find deps/v8/include -name '*.h' -print0 | while read -r -d "" file; do + install -Dm644 "$file" -T "$out/include/''${file#deps/v8/include/}" + done + find deps/v8/third_party/abseil-cpp/absl -name '*.h' -print0 | while read -r -d "" file; do + install -Dm644 "$file" -T "$out/include/''${file#deps/v8/third_party/abseil-cpp/}" + done + mkdir -p $out/lib/pkgconfig cat -> $out/lib/pkgconfig/v8.pc << EOF + prefix=$out + exec_prefix=\''${prefix} + libdir=\''${exec_prefix}/lib + includedir=\''${prefix}/include + Name: v8 Description: V8 JavaScript Engine build for Node.js CI Version: ${finalAttrs.version} - Libs: -L$out/lib $(for f in $out/lib/lib*.a; do + Libs: -L\''${libdir} $(for f in $out/lib/lib*.a; do b=$(basename "$f" .a) printf " -l%s" "''${b#lib}" done) -lstdc++ - Cflags: -I${v8Dir}/include -I${v8Dir}/third_party/abseil-cpp -I${v8Dir}/third_party/simdutf + Cflags: -I\''${includedir} EOF runHook postInstall From 57d3b1cacb83b7138e325798263d0a18a7561ed3 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 2 Apr 2026 23:47:11 +0200 Subject: [PATCH 9/9] squash! move `extraConfigFlags` out of the `v8.nix` path --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 022af37c5c1a70..382d112534f94c 100644 --- a/shell.nix +++ b/shell.nix @@ -64,7 +64,6 @@ let "--with-intl=${if useSharedICU then "system" else icu}-icu" ) ] - ++ extraConfigFlags ++ pkgs.lib.optional withTemporal "--v8-enable-temporal-support" ++ pkgs.lib.optional (withTemporal && useSharedTemporal) "--shared-temporal_capi"; in @@ -100,6 +99,7 @@ pkgs.mkShell { NINJA = pkgs.lib.optionalString (ninja != null) "${pkgs.lib.getExe ninja}"; CONFIG_FLAGS = builtins.toString ( configureFlags + ++ extraConfigFlags ++ pkgs.lib.optional (ninja != null) "--ninja" ++ pkgs.lib.optional (!withAmaro) "--without-amaro" ++ pkgs.lib.optional (!withLief) "--without-lief"