Compare commits

...

27 Commits

Author SHA1 Message Date
Efraim Flashner
b0b38e199c WIP: Maybe don't run the tests on node-12.
Change-Id: I81d523201e365038aa5619572d292b2887ffb627
2025-03-13 14:35:00 +02:00
Efraim Flashner
86dd2135b5 gnu: node-bootstrap: Remove powerpc-linux from supported-systems.
* gnu/packages/node.scm (node-bootstrap)[supported-systems]: Remove
powerpc-linux from the supported systems.
(node-lts)[supported-systems]: Adjust accordingly.

Change-Id: I66408d52cfe950d1ca4fb6f3303c82a759b050ec
2025-03-13 14:35:00 +02:00
Efraim Flashner
a4a914f4c2 fixup node-12 riscv64 support
Change-Id: I42b833c3a288f10dcf8cf9f5f1554464bf9a5d22
2025-03-13 14:35:00 +02:00
Efraim Flashner
fa21330de2 fixup node-12 riscv64 support
Change-Id: I1789a47843777dd283b4f8eae0445b468f3332b4
2025-03-13 14:35:00 +02:00
Efraim Flashner
856ac4ee6f fixup node-12 riscv64 support
Change-Id: I6e2929ca69a1e0089f2118163c56f8f35f5a1ff4
2025-03-13 14:35:00 +02:00
Efraim Flashner
420978037d fixup node-12 riscv64 support
Change-Id: I590d398ba91544dc62400eb3a3eecf9464fc1fff
2025-03-13 14:35:00 +02:00
Efraim Flashner
3534fedea9 fixup node-12 riscv64 support
Change-Id: Iabc4173577a19d59de77b962522a95d3c3f46839
2025-03-13 14:35:00 +02:00
Efraim Flashner
babcff42cc fixup node-12 riscv64 support
Change-Id: Ic376b07adaba7b4eccfe9879382b87b287ed1e6c
2025-03-13 14:34:59 +02:00
Efraim Flashner
368addcbf8 fixup Add node-12
Change-Id: I1e6dd82605465d0840db218ea314e21049472b94
2025-03-13 14:34:59 +02:00
Efraim Flashner
05158cb89f fixup node-12 riscv64 support
Change-Id: I7de046a2182ef03cb528ad4c729b2d0199ff69f5
2025-03-13 14:34:59 +02:00
Efraim Flashner
169142ee0e fixup node-12 riscv64 support
Change-Id: I4a3c02868374de85a86787321d8df0b9bc9c04e7
2025-03-13 14:34:59 +02:00
Efraim Flashner
0bc4527a25 fixup Add node-12
Change-Id: I0648220dcc1a1ad952a91b108815c5b8bcca8592
2025-03-13 14:34:59 +02:00
Efraim Flashner
735fe0eea8 fixup node-12 riscv64 support
Change-Id: I059bd5af5a2279f8c0040055a290fc02e0861fe7
2025-03-13 14:34:59 +02:00
Efraim Flashner
ec78708653 fixup node-12 riscv64 support
Change-Id: Ib3dfa0bf354331b407d98edddc1fa10d76291881
2025-03-13 14:34:59 +02:00
Efraim Flashner
50cac2510e gnu: ncdu: Update to 2.8.
* gnu/packages/ncdu.scm (ncdu): Update to 2.8.
[arguments]: Build with zig-0.14.

Change-Id: I36c61bdcf7fbcafa0f8a63620cbcce56ed82a26d
2025-03-13 14:34:59 +02:00
Efraim Flashner
a3b955718f gnu: ncdu-1: Update to 1.22.
* gnu/packages/ncdu.scm (ncdu-1): Update to 1.22.

Change-Id: I6e25cac8ee9f67ef629d38dd3e189be3d8680549
2025-03-13 14:34:59 +02:00
Efraim Flashner
64cc1353bb fixup node-12 riscv64 support
Change-Id: I1ff6a30a614ade6e82d44e3f2fe20530c93fc7c5
2025-03-13 14:34:59 +02:00
Efraim Flashner
2650a32e7a fixup Add node-12
Change-Id: I047f9a59b282f15764f48b0c2479cce6f723834a
2025-03-13 14:34:59 +02:00
Efraim Flashner
3eca82d936 gnu: qemu-minimal: Fix building on riscv64-linux.
* gnu/packages/virtualization.scm (qemu)[arguments]: Don't run the tests
in parallel when building for riscv64-linux.  Adjust riscv64's
'disable-some-tests phase to extend a test timeout.

Change-Id: I82e2a59bb74bd2c68ccd2397601b0289f47bdbfe
2025-03-13 14:34:58 +02:00
Efraim Flashner
3502e45965 fixup Add node-12
Change-Id: I4f7b4619387a6ddfc830dfc641d560ce4b373459
2025-03-13 14:34:58 +02:00
Efraim Flashner
10c112524a fixup Add node-12
Change-Id: I2f2553fb136fb8f08f4062a631dd64705e540ba4
2025-03-13 14:34:58 +02:00
Efraim Flashner
68fe63ab7b fixup node-12 riscv64 support 2025-03-13 14:34:58 +02:00
Efraim Flashner
5f54bb4c8e fixup node-12 riscv64 support 2025-03-13 14:34:58 +02:00
Efraim Flashner
5bf81d0bd7 fixup node-12 riscv64 support 2025-03-13 14:34:58 +02:00
Efraim Flashner
2e996ba595 fixup node-12 riscv64 support 2025-03-13 14:34:58 +02:00
Efraim Flashner
5cb138ab05 WIP: node-12: Add riscv64-linux support.
* gnu/packages/node.scm (node-12)[source]: Add patch.
[supported-systems]: Remove field.
* gnu/packages/patches/node-12-riscv64-support.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
2025-03-13 14:34:58 +02:00
Efraim Flashner
845d5c9f37 gnu: Add node-12.
* gnu/packages/node.scm (node-12): New variable.

Change-Id: If749149358338ef8852e2218512031a73804d2ab
2025-03-13 14:34:58 +02:00
5 changed files with 36562 additions and 8 deletions

View File

@@ -1906,6 +1906,7 @@ dist_patch_DATA = \
%D%/packages/patches/nginx-socket-cloexec.patch \
%D%/packages/patches/nickle-man-release-date.patch \
%D%/packages/patches/nnpack-system-libraries.patch \
%D%/packages/patches/node-12-riscv64-support.patch \
%D%/packages/patches/nsis-env-passthru.patch \
%D%/packages/patches/nss-getcwd-nonnull.patch \
%D%/packages/patches/nss-increase-test-timeout.patch \

View File

@@ -39,14 +39,14 @@
;; yet, so we'll keep both for just a little longer.
(package
(name "ncdu")
(version "1.21")
(version "1.22")
(source (origin
(method url-fetch)
(uri (string-append "https://dev.yorhel.nl/download/ncdu-"
version ".tar.gz"))
(sha256
(base32
"19h1jvgiw7dvpxlhg6sqzc1c8gjkaj7z9girc255gkkbnjlx7558"))))
"0sqp39lkryjljvvrwv0x37a9fklg3g060iqhh42i5m84vjbc1mha"))))
(build-system gnu-build-system)
(arguments
(list #:configure-flags
@@ -70,17 +70,18 @@ ncurses installed.")
(package
(inherit ncdu-1)
(name "ncdu")
(version "2.7")
(version "2.8")
(source (origin
(method url-fetch)
(uri (string-append "https://dev.yorhel.nl/download/ncdu-"
version ".tar.gz"))
(sha256
(base32
"001hp47g45rlmbirg85cqflfg049xhdf5d0xjp7m565vl8acq65j"))))
"0h4fwgkny70d7v7r4nbhcwjx9aijbgpl508prcrgbzf9grpmfqda"))))
(build-system zig-build-system)
(arguments
(list #:install-source? #f
(list #:zig zig-0.14
#:install-source? #f
#:zig-release-type "safe"
#:zig-build-flags
#~(list "-Dpie")))

View File

@@ -342,7 +342,8 @@ for easily building fast, scalable network applications. Node.js uses an
event-driven, non-blocking I/O model that makes it lightweight and efficient,
perfect for data-intensive real-time applications that run across distributed
devices.")
(supported-systems (delete "riscv64-linux" %supported-systems))
(supported-systems (fold delete %supported-systems
'("powerpc-linux" "riscv64-linux")))
(home-page "https://nodejs.org/")
(license license:expat)
(properties '((max-silent-time . 7200) ;2h, needed on ARM
@@ -350,6 +351,396 @@ devices.")
(cpe-name . "node.js")
(hidden? . #t)))))
(define-public node-12
(package
(name "node")
(version "12.22.12")
(source (origin
(method url-fetch)
(uri (string-append "https://nodejs.org/dist/v" version
"/node-v" version ".tar.xz"))
(sha256
(base32
"1whl0zi6fs9ay33bhcn2kh9xynran05iipahg1zzr6sv97wbfhmw"))
(patches (search-patches "node-12-riscv64-support.patch"))
(modules '((guix build utils)))
(snippet
'(begin
;; Remove bundled software.
(for-each delete-file-recursively
'("deps/cares"
"deps/http_parser"
"deps/icu-small"
"deps/llhttp"
"deps/nghttp2"
"deps/openssl"
;"deps/uv" ; Needed by uvwasi
"deps/zlib"))
(substitute* "Makefile"
;; Remove references to bundled software.
(("deps/http_parser/http_parser.gyp") "")
(("deps/uv/include/\\*.h") "")
(("deps/uv/uv.gyp") "")
(("deps/zlib/zlib.gyp") ""))))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags
(list "--shared-brotli"
"--shared-cares"
"--shared-http-parser"
(string-append "--shared-http-parser-includes="
(assoc-ref %build-inputs "http-parser")
"/include")
(string-append "--shared-http-parser-libpath="
(assoc-ref %build-inputs "http-parser")
"/lib")
"--shared-libuv"
"--shared-nghttp2"
"--shared-openssl"
"--shared-zlib"
"--verbose"
"--ninja"
"--without-snapshot"
"--without-inspector" ; build without llhttp
"--with-intl=system-icu")
;; Run only the CI tests. The default test target requires additional
;; add-ons from NPM that are not distributed with the source.
#:test-target "test-ci-js"
;; We only use this package to bootstrap our later node versions.
;#:tests? ,(and (not (%current-target-system))
; (target-x86?))
;; Some of the tests can timeout under heavy load.
#:parallel-tests? ,(target-x86?)
#:modules
((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1)
(ice-9 match))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'remove-dependency-on-llhttp
(lambda _
;; This file unconditionally defines NODE_EXPERIMENTAL_HTTP
(substitute* "node.gyp"
(("src/node_http_parser_llhttp\\.cc") ""))
;; These unconditionally depend upon/add llhttp.
(substitute* '("lib/internal/bootstrap/loaders.js"
"src/node_binding.cc"
"src/node_metadata.h"
"src/node_metadata.cc")
((".*llhttp.*") ""))
;; '--http-parser=legacy' or not, only use http_parser.
(substitute* '("lib/_http_common.js"
"test/parallel/test-http-parser-lazy-loaded.js")
(("http_parser_llhttp") "http_parser"))
;; This test expects to use llhttp.
(delete-file "test/sequential/test-set-http-max-http-headers.js")))
(add-before 'configure 'patch-hardcoded-program-references
(lambda* (#:key inputs #:allow-other-keys)
;; Fix hardcoded /bin/sh references.
(substitute* '("deps/npm/node_modules/cross-spawn/lib/parse.js"
"deps/npm/node_modules/execa/index.js"
"lib/child_process.js"
"lib/internal/v8_prof_polyfill.js"
"test/parallel/test-child-process-spawnsync-shell.js"
"test/parallel/test-fs-write-sigxfsz.js"
"test/parallel/test-stdio-closed.js"
"test/sequential/test-child-process-emfile.js")
(("'/bin/sh'")
(string-append "'" (search-input-file inputs "/bin/sh") "'")))
;; Fix hardcoded /usr/bin/env references.
(substitute* '("test/parallel/test-child-process-default-options.js"
"test/parallel/test-child-process-env.js"
"test/parallel/test-child-process-exec-env.js")
(("'/usr/bin/env'")
(string-append "'" (search-input-file inputs "/bin/env") "'")))))
#;
(add-after 'unpack 'extend-default-test-timeout
(lambda _
;; The default is 120ms, with a multiplier for some architectures.
(substitute* "tools/test.py"
(("default=120") "default=480"))))
(add-after 'patch-hardcoded-program-references 'delete-problematic-tests
(lambda* (#:key inputs #:allow-other-keys)
;; FIXME: These tests fail in the build container, but they don't
;; seem to be indicative of real problems in practice.
(for-each delete-file
'("test/parallel/test-cluster-master-error.js"
"test/parallel/test-cluster-master-kill.js"))
;; These require a DNS resolver.
(for-each delete-file
'("test/parallel/test-dns.js"
"test/parallel/test-dns-lookupService-promises.js"))
;; These tests are timing-sensitive, and fail sporadically on
;; slow, busy, or even very fast machines.
(for-each delete-file '("test/parallel/test-fs-utimes.js"
"test/sequential/test-perf-hooks.js"))
;; FIXME: This test fails randomly:
;; https://github.com/nodejs/node/issues/31213
(delete-file "test/parallel/test-net-listen-after-destroying-stdin.js")
;; VM Modules is an experimental feature
(delete-file "test/parallel/test-vm-module-dynamic-import.js")
;; These tests need looking into:
(for-each delete-file
'("test/async-hooks/test-filehandle-no-reuse.js"
"test/async-hooks/test-graph.http.js"
"test/async-hooks/test-http-agent-handle-reuse.js"
"test/parallel/test-cli-options-precedence.js"
"test/parallel/test-http-methods.js"
"test/parallel/test-process-versions.js"
"test/parallel/test-uv-errno.js"
"test/report/test-report-uv-handles.js"))
;; [DEP0131] DeprecationWarning: The legacy HTTP parser is deprecated.
;; These are due to our blocking llhttp.
(for-each
delete-file
'("test/parallel/test-domain-http-server.js"
"test/parallel/test-domain-multi.js"
"test/parallel/test-http-chunked-smuggling.js"
"test/parallel/test-http-client-error-rawbytes.js"
"test/parallel/test-http-client-parse-error.js"
"test/parallel/test-http-deprecated-urls.js"
"test/parallel/test-http-header-overflow.js"
"test/parallel/test-http-outgoing-internal-headernames-getter.js"
"test/parallel/test-http-outgoing-internal-headernames-setter.js"
"test/parallel/test-http-outgoing-internal-headers.js"
"test/parallel/test-http-request-smuggling-content-length.js"
"test/parallel/test-http-server-client-error.js"
"test/parallel/test-http-server-destroy-socket-on-client-error.js"
"test/parallel/test-http-timeout-client-warning.js"
"test/parallel/test-http2-client-http1-server.js"
"test/parallel/test-http2-client-request-listeners-warning.js"
"test/parallel/test-http2-methods.js"
"test/parallel/test-http2-multiplex.js"
"test/parallel/test-http2-reset-flood.js"
"test/parallel/test-http2-server-set-header.js"
"test/parallel/test-https-simple.js"
"test/parallel/test-https-strict.js"
"test/parallel/test-release-npm.js"))
;; AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
(delete-file "test/parallel/test-intl.js")
;; Some architecture dependant test failures:
(cond
(,(target-ppc64le?)
(delete-file "test/parallel/test-worker-nearheaplimit-deadlock.js"))
(,(target-arm32?)
;; This test crashed.
(delete-file "test/parallel/test-worker-resource-limits.js"))
(,(target-aarch64?)
;; These tests timeout even with an extended timeout.
(with-directory-excursion "test"
(for-each
delete-file
(cons*
"parallel/test-async-hooks-worker-asyncfn-terminate-1.js"
"parallel/test-async-hooks-worker-asyncfn-terminate-2.js"
"parallel/test-async-hooks-worker-asyncfn-terminate-3.js"
"parallel/test-async-hooks-worker-asyncfn-terminate-4.js"
"parallel/test-cli-node-options.js"
"parallel/test-crypto-key-objects-messageport.js"
"parallel/test-crypto-worker-thread.js"
"parallel/test-disable-proto-delete.js"
"parallel/test-disable-proto-throw.js"
"parallel/test-performance-eventlooputil.js"
"parallel/test-preload.js"
"parallel/test-process-exec-argv.js"
"parallel/test-require-symlink.js"
"parallel/test-trace-events-api-worker-disabled.js"
"parallel/test-trace-events-async-hooks-worker.js"
"parallel/test-trace-events-worker-metadata.js"
"parallel/test-trace-exit.js"
"wasi/test-wasi-worker-terminate.js"
"wpt/test-console.js"
"wpt/test-encoding.js"
"wpt/test-hr-time.js"
"wpt/test-microtask-queuing.js"
"wpt/test-timers.js"
"wpt/test-url.js"
"report/test-report-worker.js"
"es-module/test-esm-loader-side-effect.mjs"
"sequential/test-worker-prof.js"
"abort/test-worker-abort-uncaught-exception.js"
(find-files "parallel" "^test-worker")))))
(else #t))
;; These tests have an expiry date: they depend on the validity of
;; TLS certificates that are bundled with the source. We want this
;; package to be reproducible forever, so remove those.
(for-each delete-file
'("test/parallel/test-tls-passphrase.js"
"test/parallel/test-tls-server-verify.js"))))
(add-before 'configure 'set-bootstrap-host-rpath
(lambda* (#:key native-inputs inputs #:allow-other-keys)
(let* ((inputs (or native-inputs inputs))
(brotli (assoc-ref inputs "brotli"))
(c-ares (assoc-ref inputs "c-ares"))
(http-parser (assoc-ref inputs "http-parser"))
(icu4c (assoc-ref inputs "icu4c"))
(nghttp2 (assoc-ref inputs "nghttp2"))
(openssl (assoc-ref inputs "openssl"))
(libuv (assoc-ref inputs "libuv"))
(zlib (assoc-ref inputs "zlib"))
(host-binaries '("torque"
"bytecode_builtins_list_generator"
"gen-regexp-special-case"
"node_mksnapshot"
"mksnapshot")))
(substitute* '("node.gyp" "tools/v8_gypfiles/v8.gyp")
(((string-append "'target_name': '("
(string-join host-binaries "|")
")',")
target)
(string-append target
"'ldflags': ['-Wl,-rpath="
c-ares "/lib:"
brotli "/lib:"
http-parser "/lib:"
icu4c "/lib:"
nghttp2 "/lib:"
openssl "/lib:"
libuv "/lib:"
zlib "/lib"
"'],"))))))
(replace 'configure
;; Node's configure script is actually a python script, so we can't
;; run it with bash.
(lambda* (#:key outputs (configure-flags '()) native-inputs inputs
#:allow-other-keys)
(let* ((prefix (assoc-ref outputs "out"))
(xflags ,(if (%current-target-system)
`'("--cross-compiling"
,(string-append
"--dest-cpu="
(match (%current-target-system)
((? (cut string-prefix? "arm" <>))
"arm")
((? (cut string-prefix? "aarch64" <>))
"arm64")
((? (cut string-prefix? "i686" <>))
"ia32")
((? (cut string-prefix? "x86_64" <>))
"x64")
((? (cut string-prefix? "powerpc64" <>))
"ppc64")
((? (cut string-prefix? "riscv64" <>))
"riscv64")
(_ "unsupported"))))
''()))
(flags (cons (string-append "--prefix=" prefix)
(append xflags configure-flags))))
(format #t "build directory: ~s~%" (getcwd))
(format #t "configure flags: ~s~%" flags)
;; Node's configure script expects the CC environment variable to
;; be set.
(setenv "CC_host" "gcc")
(setenv "CXX_host" "g++")
(setenv "CC" ,(cc-for-target))
(setenv "CXX" ,(cxx-for-target))
(setenv "PKG_CONFIG" ,(pkg-config-for-target))
(apply invoke
(let ((inpts (or native-inputs inputs)))
(with-exception-handler
(lambda (e)
(if (search-error? e)
(search-input-file inpts "/bin/python2")
(raise-exception e)))
(lambda ()
(search-input-file inpts "/bin/python"))
#:unwind? #t))
"configure"
flags))))
(add-after 'patch-shebangs 'patch-nested-shebangs
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Based on the implementation of patch-shebangs
;; from (guix build gnu-build-system).
(let ((path (append-map (match-lambda
((_ . dir)
(list (string-append dir "/bin")
(string-append dir "/sbin")
(string-append dir "/libexec"))))
(append outputs inputs))))
(for-each
(lambda (file)
(patch-shebang file path))
(find-files (search-input-directory outputs "lib/node_modules")
(lambda (file stat)
(executable-file? file))
#:stat lstat)))))
(add-after 'install 'install-npmrc
;; Note: programs like node-gyp only receive these values if
;; they are started via `npm` or `npx`.
;; See: https://github.com/nodejs/node-gyp#npm-configuration
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")))
(with-output-to-file
;; Use the config file "primarily for distribution
;; maintainers" rather than "{prefix}/etc/npmrc",
;; especially because node-build-system uses --prefix
;; to install things to their store paths:
(string-append out "/lib/node_modules/npm/npmrc")
(lambda ()
;; Tell npm (mostly node-gyp) where to find our
;; installed headers so it doesn't try to
;; download them from the internet:
(format #t "nodedir=~a\n" out)))))))))
(native-inputs
;; Runtime dependencies for binaries used as a bootstrap.
(list brotli
c-ares
http-parser
icu4c
libuv
(@ (gnu packages ninja) ninja)
`(,nghttp2 "lib")
openssl-1.1
zlib
;; Regular build-time dependencies.
perl
pkg-config
procps
python-2
util-linux))
(inputs
(list bash-minimal
coreutils
c-ares
http-parser
icu4c
libuv
`(,nghttp2 "lib")
openssl-1.1
python-wrapper ;for node-gyp (supports python3)
zlib))
(native-search-paths
(list (search-path-specification
(variable "NODE_PATH")
(files '("lib/node_modules")))))
(synopsis "Evented I/O for V8 JavaScript")
(description
"Node.js is a platform built on Chrome's JavaScript runtime
for easily building fast, scalable network applications. Node.js uses an
event-driven, non-blocking I/O model that makes it lightweight and efficient,
perfect for data-intensive real-time applications that run across distributed
devices.")
(home-page "https://nodejs.org/")
(license license:expat)
(properties '((max-silent-time . 7200) ;2h, needed on ARM
(timeout . 21600) ;6h
(hidden? . #t)
(cpe-name . "node.js")))))
;; Duplicate of node-semver
(define-public node-semver-bootstrap
(package
@@ -991,7 +1382,8 @@ fi"
`(,nghttp2 "lib")
openssl
zlib))
(supported-systems %supported-systems)
(supported-systems
(cons "riscv64-linux" (package-supported-systems node-bootstrap)))
(properties (alist-delete 'hidden? (package-properties node-bootstrap)))))
(define-public node node-lts)

File diff suppressed because it is too large Load Diff

View File

@@ -228,7 +228,8 @@
;; <https://bugs.gnu.org/40527>.
#:tests? (or (%current-target-system)
(not (string=? "i686-linux" (%current-system))))
#:parallel-tests? (not (target-arm32?))
#:parallel-tests? (not (or (target-arm32?)
(target-riscv64?)))
#:configure-flags
#~(let ((gcc (search-input-file %build-inputs "/bin/gcc"))
(openbios (search-input-file %build-inputs
@@ -362,6 +363,11 @@
((target-riscv64?)
#~((add-after 'unpack 'disable-some-tests
(lambda _
;; Extend the test timeout for this test:
(substitute* "tests/unit/meson.build"
(("test-crypto-tlssession': 90")
"test-crypto-tlssession': 180"))
;; qemu.qmp.QMPConnectError:
;; Unexpected empty reply from server
(delete-file "tests/qemu-iotests/040")