lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nodejs: fix cross compilation for armv7l

The v8 library supports only limited number of build platforms based on
the host architecture. The rule there is the bitness (the mixing of
32bit and 64bit architectures seems to be in most cases disallowed).
Thus this adds usage of the emulator of the host platform and builds
tools for that.

Co-authored-by: Ivan Trubach <mr.trubach@icloud.com>

authored by

Karel Kočí
Ivan Trubach
and committed by
Ivan Trubach
e5906ddf 09de87d2

+405 -73
+138
pkgs/development/web/nodejs/configure-emulator-node18.patch
··· 1 + From 4b83f714c821d6d4d2306673ee3a87907cfec80e Mon Sep 17 00:00:00 2001 2 + From: Ivan Trubach <mr.trubach@icloud.com> 3 + Date: Fri, 19 Jul 2024 10:45:13 +0300 4 + Subject: [PATCH] build: support setting an emulator from configure script 5 + MIME-Version: 1.0 6 + Content-Type: text/plain; charset=UTF-8 7 + Content-Transfer-Encoding: 8bit 8 + 9 + V8’s JIT infrastructure requires binaries such as mksnapshot to be run 10 + during the build. However, these binaries must have the same bit-width 11 + as the host platform (e.g. a x86_64 build platform targeting ARMv6 needs 12 + to produce a 32-bit binary). 13 + 14 + To work around this issue, allow building the binaries for the host 15 + platform and running them on the build platform with an emulator. 16 + 17 + Based on Buildroot’s nodejs-src 0001-add-qemu-wrapper-support.patch. 18 + https://gitlab.com/buildroot.org/buildroot/-/blob/c1d5eada4d4db9eeaa1c44dd1dea95a67c8a70ca/package/nodejs/nodejs-src/0001-add-qemu-wrapper-support.patch 19 + 20 + Upstream: https://github.com/nodejs/node/pull/53899 21 + --- 22 + common.gypi | 1 + 23 + configure.py | 14 ++++++++++++++ 24 + node.gyp | 3 +++ 25 + tools/v8_gypfiles/v8.gyp | 4 ++++ 26 + 4 files changed, 22 insertions(+) 27 + 28 + diff --git a/common.gypi b/common.gypi 29 + index ec92c9df4c..6474495ab6 100644 30 + --- a/common.gypi 31 + +++ b/common.gypi 32 + @@ -13,6 +13,7 @@ 33 + 'enable_pgo_generate%': '0', 34 + 'enable_pgo_use%': '0', 35 + 'python%': 'python', 36 + + 'emulator%': [], 37 + 38 + 'node_shared%': 'false', 39 + 'force_dynamic_crt%': 0, 40 + diff --git a/configure.py b/configure.py 41 + index 82916748fd..10dc0becbb 100755 42 + --- a/configure.py 43 + +++ b/configure.py 44 + @@ -112,6 +112,12 @@ parser.add_argument('--dest-cpu', 45 + choices=valid_arch, 46 + help=f"CPU architecture to build for ({', '.join(valid_arch)})") 47 + 48 + +parser.add_argument('--emulator', 49 + + action='store', 50 + + dest='emulator', 51 + + default=None, 52 + + help='emulator command that can run executables built for the target system') 53 + + 54 + parser.add_argument('--cross-compiling', 55 + action='store_true', 56 + dest='cross_compiling', 57 + @@ -2160,6 +2166,14 @@ write('config.mk', do_not_edit + config_str) 58 + gyp_args = ['--no-parallel', '-Dconfiguring_node=1'] 59 + gyp_args += ['-Dbuild_type=' + config['BUILDTYPE']] 60 + 61 + +if options.emulator is not None: 62 + + if not options.cross_compiling: 63 + + # Note that emulator is a list so we have to quote the variable. 64 + + gyp_args += ['-Demulator=' + shlex.quote(options.emulator)] 65 + + else: 66 + + # TODO: perhaps use emulator for tests? 67 + + warn('The `--emulator` option has no effect when cross-compiling.') 68 + + 69 + if options.use_ninja: 70 + gyp_args += ['-f', 'ninja-' + flavor] 71 + elif flavor == 'win' and sys.platform != 'msys': 72 + diff --git a/node.gyp b/node.gyp 73 + index 08cb3f38e8..515b305933 100644 74 + --- a/node.gyp 75 + +++ b/node.gyp 76 + @@ -332,6 +332,7 @@ 77 + '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc', 78 + ], 79 + 'action': [ 80 + + '<@(emulator)', 81 + '<(node_mksnapshot_exec)', 82 + '--build-snapshot', 83 + '<(node_snapshot_main)', 84 + @@ -351,6 +352,7 @@ 85 + '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc', 86 + ], 87 + 'action': [ 88 + + '<@(emulator)', 89 + '<@(_inputs)', 90 + '<@(_outputs)', 91 + ], 92 + @@ -1520,6 +1522,7 @@ 93 + '<(PRODUCT_DIR)/<(node_core_target_name).def', 94 + ], 95 + 'action': [ 96 + + '<@(emulator)', 97 + '<(PRODUCT_DIR)/gen_node_def.exe', 98 + '<@(_inputs)', 99 + '<@(_outputs)', 100 + diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp 101 + index ba8b161f0f..d5c90dad50 100644 102 + --- a/tools/v8_gypfiles/v8.gyp 103 + +++ b/tools/v8_gypfiles/v8.gyp 104 + @@ -99,6 +99,7 @@ 105 + '<@(torque_outputs_inc)', 106 + ], 107 + 'action': [ 108 + + '<@(emulator)', 109 + '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)', 110 + '-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated', 111 + '-v8-root', '<(V8_ROOT)', 112 + @@ -219,6 +220,7 @@ 113 + 'action': [ 114 + '<(python)', 115 + '<(V8_ROOT)/tools/run.py', 116 + + '<@(emulator)', 117 + '<@(_inputs)', 118 + '<@(_outputs)', 119 + ], 120 + @@ -442,6 +444,7 @@ 121 + }], 122 + ], 123 + 'action': [ 124 + + '<@(emulator)', 125 + '>@(_inputs)', 126 + '>@(mksnapshot_flags)', 127 + ], 128 + @@ -1577,6 +1580,7 @@ 129 + 'action': [ 130 + '<(python)', 131 + '<(V8_ROOT)/tools/run.py', 132 + + '<@(emulator)', 133 + '<@(_inputs)', 134 + '<@(_outputs)', 135 + ], 136 + -- 137 + 2.44.1 138 +
+146
pkgs/development/web/nodejs/configure-emulator.patch
··· 1 + From 999d918bc8fefec1752243743a47c0ce5380bcec Mon Sep 17 00:00:00 2001 2 + From: Ivan Trubach <mr.trubach@icloud.com> 3 + Date: Wed, 17 Jul 2024 10:16:02 +0300 4 + Subject: [PATCH] build: support setting an emulator from configure script 5 + MIME-Version: 1.0 6 + Content-Type: text/plain; charset=UTF-8 7 + Content-Transfer-Encoding: 8bit 8 + 9 + V8’s JIT infrastructure requires binaries such as mksnapshot to be run 10 + during the build. However, these binaries must have the same bit-width 11 + as the host platform (e.g. a x86_64 build platform targeting ARMv6 needs 12 + to produce a 32-bit binary). 13 + 14 + To work around this issue, allow building the binaries for the host 15 + platform and running them on the build platform with an emulator. 16 + 17 + Based on Buildroot’s nodejs-src 0001-add-qemu-wrapper-support.patch. 18 + https://gitlab.com/buildroot.org/buildroot/-/blob/c1d5eada4d4db9eeaa1c44dd1dea95a67c8a70ca/package/nodejs/nodejs-src/0001-add-qemu-wrapper-support.patch 19 + 20 + Upstream: https://github.com/nodejs/node/pull/53899 21 + --- 22 + common.gypi | 1 + 23 + configure.py | 14 ++++++++++++++ 24 + node.gyp | 4 ++++ 25 + tools/v8_gypfiles/v8.gyp | 4 ++++ 26 + 4 files changed, 23 insertions(+) 27 + 28 + diff --git a/common.gypi b/common.gypi 29 + index 154bbf2a0d..54d2afe3b3 100644 30 + --- a/common.gypi 31 + +++ b/common.gypi 32 + @@ -13,6 +13,7 @@ 33 + 'enable_pgo_generate%': '0', 34 + 'enable_pgo_use%': '0', 35 + 'python%': 'python', 36 + + 'emulator%': [], 37 + 38 + 'node_shared%': 'false', 39 + 'force_dynamic_crt%': 0, 40 + diff --git a/configure.py b/configure.py 41 + index f7e3310723..f7c7acdf4f 100755 42 + --- a/configure.py 43 + +++ b/configure.py 44 + @@ -112,6 +112,12 @@ parser.add_argument('--dest-cpu', 45 + choices=valid_arch, 46 + help=f"CPU architecture to build for ({', '.join(valid_arch)})") 47 + 48 + +parser.add_argument('--emulator', 49 + + action='store', 50 + + dest='emulator', 51 + + default=None, 52 + + help='emulator command that can run executables built for the target system') 53 + + 54 + parser.add_argument('--cross-compiling', 55 + action='store_true', 56 + dest='cross_compiling', 57 + @@ -2276,6 +2282,14 @@ if flavor == 'win' and python.lower().endswith('.exe'): 58 + # will fail to run python scripts. 59 + gyp_args += ['-Dpython=' + python] 60 + 61 + +if options.emulator is not None: 62 + + if not options.cross_compiling: 63 + + # Note that emulator is a list so we have to quote the variable. 64 + + gyp_args += ['-Demulator=' + shlex.quote(options.emulator)] 65 + + else: 66 + + # TODO: perhaps use emulator for tests? 67 + + warn('The `--emulator` option has no effect when cross-compiling.') 68 + + 69 + if options.use_ninja: 70 + gyp_args += ['-f', 'ninja-' + flavor] 71 + elif flavor == 'win' and sys.platform != 'msys': 72 + diff --git a/node.gyp b/node.gyp 73 + index 9617596760..439c76aca6 100644 74 + --- a/node.gyp 75 + +++ b/node.gyp 76 + @@ -703,6 +703,7 @@ 77 + '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc', 78 + ], 79 + 'action': [ 80 + + '<@(emulator)', 81 + '<(node_mksnapshot_exec)', 82 + '--build-snapshot', 83 + '<(node_snapshot_main)', 84 + @@ -722,6 +723,7 @@ 85 + '<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc', 86 + ], 87 + 'action': [ 88 + + '<@(emulator)', 89 + '<@(_inputs)', 90 + '<@(_outputs)', 91 + ], 92 + @@ -1010,6 +1012,7 @@ 93 + '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc', 94 + ], 95 + 'action': [ 96 + + '<@(emulator)', 97 + '<(node_js2c_exec)', 98 + '<@(_outputs)', 99 + 'lib', 100 + @@ -1477,6 +1480,7 @@ 101 + '<(PRODUCT_DIR)/<(node_core_target_name).def', 102 + ], 103 + 'action': [ 104 + + '<@(emulator)', 105 + '<(PRODUCT_DIR)/gen_node_def.exe', 106 + '<@(_inputs)', 107 + '<@(_outputs)', 108 + diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp 109 + index d65a5c268e..5cd6c36b86 100644 110 + --- a/tools/v8_gypfiles/v8.gyp 111 + +++ b/tools/v8_gypfiles/v8.gyp 112 + @@ -112,6 +112,7 @@ 113 + '<@(torque_outputs_inc)', 114 + ], 115 + 'action': [ 116 + + '<@(emulator)', 117 + '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)', 118 + '-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated', 119 + '-v8-root', '<(V8_ROOT)', 120 + @@ -232,6 +233,7 @@ 121 + 'action': [ 122 + '<(python)', 123 + '<(V8_ROOT)/tools/run.py', 124 + + '<@(emulator)', 125 + '<@(_inputs)', 126 + '<@(_outputs)', 127 + ], 128 + @@ -453,6 +455,7 @@ 129 + }], 130 + ], 131 + 'action': [ 132 + + '<@(emulator)', 133 + '>@(_inputs)', 134 + '>@(mksnapshot_flags)', 135 + ], 136 + @@ -1842,6 +1845,7 @@ 137 + 'action': [ 138 + '<(python)', 139 + '<(V8_ROOT)/tools/run.py', 140 + + '<@(emulator)', 141 + '<@(_inputs)', 142 + '<@(_outputs)', 143 + ], 144 + -- 145 + 2.44.1 146 +
+118 -73
pkgs/development/web/nodejs/nodejs.nix
··· 1 - { lib, stdenv, fetchurl, openssl, python, zlib, libuv, util-linux, http-parser, bash 1 + { lib, stdenv, fetchurl, openssl, python, zlib, libuv, http-parser, icu, bash 2 2 , pkg-config, which, buildPackages 3 3 , testers 4 4 # for `.pkgs` attribute ··· 7 7 , writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, nix, runtimeShell 8 8 , gnupg 9 9 , darwin, xcbuild 10 - , procps, icu 11 10 , installShellFiles 12 11 }: 13 12 ··· 16 15 let 17 16 inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; 18 17 19 - isCross = stdenv.hostPlatform != stdenv.buildPlatform; 20 - 21 18 majorVersion = lib.versions.major version; 22 19 minorVersion = lib.versions.minor version; 23 20 24 21 pname = if enableNpm then "nodejs" else "nodejs-slim"; 25 22 23 + canExecute = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 24 + emulator = stdenv.hostPlatform.emulator buildPackages; 25 + 26 + # See valid_os and valid_arch in configure.py. 27 + destOS = 28 + let 29 + platform = stdenv.hostPlatform; 30 + in 31 + if platform.isiOS then 32 + "ios" 33 + else if platform.isAndroid then 34 + "android" 35 + else if platform.isWindows then 36 + "win" 37 + else if platform.isDarwin then 38 + "mac" 39 + else if platform.isLinux then 40 + "linux" 41 + else if platform.isOpenBSD then 42 + "openbsd" 43 + else if platform.isFreeBSD then 44 + "freebsd" 45 + else 46 + throw "unsupported os ${platform.uname.system}"; 47 + destCPU = 48 + let 49 + platform = stdenv.hostPlatform; 50 + in 51 + if platform.isAarch then 52 + "arm" + lib.optionalString platform.is64bit "64" 53 + else if platform.isMips32 then 54 + "mips" + lib.optionalString platform.isLittleEndian "le" 55 + else if platform.isMips64 && platform.isLittleEndian then 56 + "mips64el" 57 + else if platform.isPower then 58 + "ppc" + lib.optionalString platform.is64bit "64" 59 + else if platform.isx86_64 then 60 + "x64" 61 + else if platform.isx86_32 then 62 + "ia32" 63 + else if platform.isS390x then 64 + "s390x" 65 + else if platform.isRiscV64 then 66 + "riscv64" 67 + else if platform.isLoongArch64 then 68 + "loong64" 69 + else 70 + throw "unsupported cpu ${platform.uname.processor}"; 71 + destARMFPU = 72 + let 73 + platform = stdenv.hostPlatform; 74 + in 75 + if platform.isAarch32 && platform ? gcc.fpu then 76 + lib.throwIfNot (builtins.elem platform.gcc.fpu [ 77 + "vfp" 78 + "vfpv3" 79 + "vfpv3-d16" 80 + "neon" 81 + ]) "unsupported ARM FPU ${platform.gcc.fpu}" platform.gcc.fpu 82 + else 83 + null; 84 + destARMFloatABI = 85 + let 86 + platform = stdenv.hostPlatform; 87 + in 88 + if platform.isAarch32 && platform ? gcc.float-abi then 89 + lib.throwIfNot (builtins.elem platform.gcc.float-abi [ 90 + "soft" 91 + "softfp" 92 + "hard" 93 + ]) "unsupported ARM float ABI ${platform.gcc.float-abi}" platform.gcc.float-abi 94 + else 95 + null; 96 + # TODO: also handle MIPS flags (mips_arch, mips_fpu, mips_float_abi). 97 + 26 98 useSharedHttpParser = !stdenv.isDarwin && lib.versionOlder "${majorVersion}.${minorVersion}" "11.4"; 27 99 28 100 sharedLibDeps = { inherit openssl zlib libuv; } // (lib.optionalAttrs useSharedHttpParser { inherit http-parser; }); 29 101 30 - sharedConfigureFlags = lib.concatMap (name: [ 31 - "--shared-${name}" 32 - "--shared-${name}-libpath=${lib.getLib sharedLibDeps.${name}}/lib" 33 - /** Closure notes: we explicitly avoid specifying --shared-*-includes, 34 - * as that would put the paths into bin/nodejs. 35 - * Including pkg-config in build inputs would also have the same effect! 36 - */ 37 - ]) (builtins.attrNames sharedLibDeps) ++ [ 38 - "--with-intl=system-icu" 39 - "--openssl-use-def-ca-store" 40 - ]; 41 - 42 102 copyLibHeaders = 43 103 map 44 104 (name: "${lib.getDev sharedLibDeps.${name}}/include/*") 45 105 (builtins.attrNames sharedLibDeps); 46 - 47 - extraConfigFlags = lib.optionals (!enableNpm) [ "--without-npm" ]; 48 106 49 107 package = stdenv.mkDerivation (finalAttrs: 50 108 let ··· 66 124 # Otherwise, nodejs would require the 11.0 SDK and macOS 10.15+. 67 125 NIX_CFLAGS_COMPILE = "-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=101300"; 68 126 }; 69 - 70 - depsBuildBuild = [ buildPackages.stdenv.cc openssl libuv zlib icu ]; 71 127 72 128 # NB: technically, we do not need bash in build inputs since all scripts are 73 129 # wrappers over the corresponding JS scripts. There are some packages though ··· 82 138 setOutputFlags = false; 83 139 moveToDev = false; 84 140 85 - configureFlags = let 86 - inherit (stdenv.hostPlatform) gcc isAarch32; 87 - in sharedConfigureFlags ++ lib.optionals (lib.versionOlder version "19") [ 88 - "--without-dtrace" 89 - ] ++ (lib.optionals isCross [ 90 - "--cross-compiling" 91 - "--dest-cpu=${let platform = stdenv.hostPlatform; in 92 - if platform.isAarch32 then "arm" 93 - else if platform.isAarch64 then "arm64" 94 - else if platform.isMips32 && platform.isLittleEndian then "mipsel" 95 - else if platform.isMips32 && !platform.isLittleEndian then "mips" 96 - else if platform.isMips64 && platform.isLittleEndian then "mips64el" 97 - else if platform.isPower && platform.is32bit then "ppc" 98 - else if platform.isPower && platform.is64bit then "ppc64" 99 - else if platform.isx86_64 then "x86_64" 100 - else if platform.isx86_32 then "x86" 101 - else if platform.isS390 && platform.is64bit then "s390x" 102 - else if platform.isRiscV && platform.is64bit then "riscv64" 103 - else throw "unsupported cpu ${stdenv.hostPlatform.uname.processor}"}" 104 - ]) ++ (lib.optionals (isCross && isAarch32 && lib.hasAttr "fpu" gcc) [ 105 - "--with-arm-fpu=${gcc.fpu}" 106 - ]) ++ (lib.optionals (isCross && isAarch32 && lib.hasAttr "float-abi" gcc) [ 107 - "--with-arm-float-abi=${gcc.float-abi}" 108 - ]) ++ extraConfigFlags; 141 + configureFlags = 142 + [ 143 + "--no-cross-compiling" 144 + "--dest-os=${destOS}" 145 + "--dest-cpu=${destCPU}" 146 + ] 147 + ++ lib.optionals (destARMFPU != null) [ "--with-arm-fpu=${destARMFPU}" ] 148 + ++ lib.optionals (destARMFloatABI != null) [ "--with-arm-float-abi=${destARMFloatABI}" ] 149 + ++ lib.optionals (!canExecute) [ 150 + # Node.js requires matching bitness between build and host platforms, e.g. 151 + # for V8 startup snapshot builder (see tools/snapshot) and some other 152 + # tools. We apply a patch that runs these tools using a host platform 153 + # emulator and avoid cross-compiling altogether (from the build system’s 154 + # perspective). 155 + "--emulator=${emulator}" 156 + ] 157 + ++ lib.optionals (lib.versionOlder version "19") [ "--without-dtrace" ] 158 + ++ lib.optionals (!enableNpm) [ "--without-npm" ] 159 + ++ lib.concatMap (name: [ 160 + "--shared-${name}" 161 + "--shared-${name}-libpath=${lib.getLib sharedLibDeps.${name}}/lib" 162 + /** 163 + Closure notes: we explicitly avoid specifying --shared-*-includes, 164 + as that would put the paths into bin/nodejs. 165 + Including pkg-config in build inputs would also have the same effect! 166 + 167 + FIXME: the statement above is outdated, we have to include pkg-config 168 + in build inputs for system-icu. 169 + */ 170 + ]) (builtins.attrNames sharedLibDeps) 171 + ++ [ 172 + "--with-intl=system-icu" 173 + "--openssl-use-def-ca-store" 174 + ]; 109 175 110 - configurePlatforms = []; 176 + configurePlatforms = [ ]; 111 177 112 178 dontDisableStatic = true; 113 179 114 180 configureScript = writeScript "nodejs-configure" '' 115 - export CC_host="$CC_FOR_BUILD" CXX_host="$CXX_FOR_BUILD" 116 181 exec ${python.executable} configure.py "$@" 117 182 ''; 118 183 ··· 140 205 141 206 __darwinAllowLocalNetworking = true; # for tests 142 207 143 - # TODO: what about tests when cross-compiling? 144 - # Note that currently stdenv does not run check phase if build ≠ host. 145 - doCheck = true; 208 + doCheck = canExecute; 146 209 147 210 # Some dependencies required for tools/doc/node_modules (and therefore 148 211 # test-addons, jstest and others) target are not included in the tarball. ··· 213 276 postInstall = '' 214 277 HOST_PATH=$out/bin patchShebangs --host $out 215 278 216 - ${lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 217 - $out/bin/${self.meta.mainProgram} --completion-bash > ${self.meta.mainProgram}.bash 218 - installShellCompletion ${self.meta.mainProgram}.bash 279 + ${lib.optionalString canExecute '' 280 + $out/bin/node --completion-bash > node.bash 281 + installShellCompletion node.bash 219 282 ''} 220 283 221 - ${lib.optionalString (enableNpm) '' 284 + ${lib.optionalString enableNpm '' 222 285 mkdir -p $out/share/bash-completion/completions 223 286 ln -s $out/lib/node_modules/npm/lib/utils/completion.sh \ 224 287 $out/share/bash-completion/completions/npm ··· 231 294 ''} 232 295 233 296 # install the missing headers for node-gyp 297 + # TODO: add dev output and use propagatedBuildInputs instead of copying headers. 234 298 cp -r ${lib.concatStringsSep " " copyLibHeaders} $out/include/node 235 299 236 300 # assemble a static v8 library and put it in the 'libv8' output 237 301 mkdir -p $libv8/lib 238 302 pushd out/Release/obj.target 239 303 find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" | sort -u >files 240 - ${if stdenv.buildPlatform.isGnu then '' 241 - ar -cqs $libv8/lib/libv8.a @files 242 - '' else '' 243 - # llvm-ar supports response files, so take advantage of it if it’s available. 244 - if [ "$(basename $(readlink -f $(command -v ar)))" = "llvm-ar" ]; then 245 - ar -cqs $libv8/lib/libv8.a @files 246 - else 247 - cat files | while read -r file; do 248 - ar -cqS $libv8/lib/libv8.a $file 249 - done 250 - fi 251 - ''} 304 + $AR -cqs $libv8/lib/libv8.a @files 252 305 popd 253 306 254 307 # copy v8 headers ··· 290 343 platforms = platforms.linux ++ platforms.darwin; 291 344 mainProgram = "node"; 292 345 knownVulnerabilities = optional (versionOlder version "18") "This NodeJS release has reached its end of life. See https://nodejs.org/en/about/releases/."; 293 - 294 - # Node.js build system does not have separate host and target OS 295 - # configurations (architectures are defined as host_arch and target_arch, 296 - # but there is no such thing as host_os and target_os). 297 - # 298 - # We may be missing something here, but it doesn’t look like it is 299 - # possible to cross-compile between different operating systems. 300 - broken = stdenv.buildPlatform.parsed.kernel.name != stdenv.hostPlatform.parsed.kernel.name; 301 346 }; 302 347 303 348 passthru.python = python; # to ensure nodeEnv uses the same version
+1
pkgs/development/web/nodejs/v18.nix
··· 26 26 version = "18.20.4"; 27 27 sha256 = "sha256-p2x+oblq62ljoViAYmDICUtiRNZKaWUp0CBUe5qVyio="; 28 28 patches = [ 29 + ./configure-emulator-node18.patch 29 30 ./disable-darwin-v8-system-instrumentation.patch 30 31 ./bypass-darwin-xcrun-node16.patch 31 32 ./revert-arm64-pointer-auth.patch
+1
pkgs/development/web/nodejs/v20.nix
··· 15 15 version = "20.15.1"; 16 16 sha256 = "sha256-/dU6VynZNmkaKhFRBG+0iXchy4sPyir5V4I6m0D+DDQ="; 17 17 patches = [ 18 + ./configure-emulator.patch 18 19 ./disable-darwin-v8-system-instrumentation-node19.patch 19 20 ./bypass-darwin-xcrun-node16.patch 20 21 ./node-npm-build-npm-package-logic.patch
+1
pkgs/development/web/nodejs/v22.nix
··· 15 15 version = "22.4.1"; 16 16 sha256 = "sha256-ZfyFf1qoJWqvyQCzRMARXJrq4loCVB/Vzg29Tf0cX7k="; 17 17 patches = [ 18 + ./configure-emulator.patch 18 19 ./disable-darwin-v8-system-instrumentation-node19.patch 19 20 ./bypass-darwin-xcrun-node16.patch 20 21 ./node-npm-build-npm-package-logic.patch