From patchwork Mon May 2 06:10:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Sundberg X-Patchwork-Id: 39046 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3756727BBEA; Mon, 2 May 2022 07:11:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 566D927BBE9 for ; Mon, 2 May 2022 07:11:24 +0100 (BST) Received: from localhost ([::1]:48580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlPHH-0001yr-HC for patchwork@mira.cbaines.net; Mon, 02 May 2022 02:11:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlPGz-0001yg-A7 for guix-patches@gnu.org; Mon, 02 May 2022 02:11:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlPGz-0003Ta-16 for guix-patches@gnu.org; Mon, 02 May 2022 02:11:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlPGw-0002pm-By for guix-patches@gnu.org; Mon, 02 May 2022 02:11:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#53414] [PATCH] update Node LTS to 16.13.2 Resent-From: Ryan Sundberg Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 May 2022 06:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53414 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53414@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165147183110855 (code B ref -1); Mon, 02 May 2022 06:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 May 2022 06:10:31 +0000 Received: from localhost ([127.0.0.1]:34670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlPGN-0002ou-0l for submit@debbugs.gnu.org; Mon, 02 May 2022 02:10:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:57632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlPGL-0002om-3S for submit@debbugs.gnu.org; Mon, 02 May 2022 02:10:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlPGJ-0001rr-OM for guix-patches@gnu.org; Mon, 02 May 2022 02:10:24 -0400 Received: from mail.arctype.co ([138.68.9.245]:41113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlPGH-0003SI-7J for guix-patches@gnu.org; Mon, 02 May 2022 02:10:23 -0400 Received: from authenticated-user (mail.arctype.co [138.68.9.245]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.arctype.co (Postfix) with ESMTPSA id D9B3813B1CB for ; Mon, 2 May 2022 06:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=arctype.co; s=mail; t=1651471814; bh=3j3wqJ6MH+Nc5JnPimoZvUuHrsSEhEuf1UgpM1Q2hSs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=qhhyxBLSE0lDwchDzzSDP+4gdzvPC7unZ86aBG20h0PTzGOHYtw2MH1fns7+p3x7U B0zCdQgJxg4ldoGWsl7UCE98T/tpyfmbxbuEjlULXN/AT+kci3XwcVJPTx6a4ESALi rp0gMKspaC7HAgOUPtibFIF/zMTdtbHJOqCFlsb3s5pHp6PC5eJYWbnAike4keROUh te9GCZofLpZ4nuNOJAkLPThErzRhPNQX/b6CePAukv10d74Vw0C0/zwFQKZJ42pRGr AMTbXp7Ow1zJWEYnRJPQ7o3Bae0LlvEOEfeccfF0+Gf+VYBEmyRu8XApL+8aLMaAMR QTCOTKZGV/CZQ== Message-ID: <14d2b050-5e3c-c923-023f-38584bd726b8@arctype.co> Date: Sun, 1 May 2022 23:10:13 -0700 MIME-Version: 1.0 Content-Language: en-US References: <145389012.1197903.1642777885519@privateemail.com> <079ca956e4d7c6b71921ee34638de012ae0a0c5f.camel@telenet.be> <87lexyew8j.fsf@gmx.com> In-Reply-To: Received-SPF: pass client-ip=138.68.9.245; envelope-from=ryan@arctype.co; helo=mail.arctype.co X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Ryan Sundberg X-ACL-Warn: , Ryan Sundberg via Guix-patches X-Patchwork-Original-From: Ryan Sundberg via Guix-patches via From: Ryan Sundberg X-getmail-retrieved-from-mailbox: Patches Hello all, here is a revised version of zamfofex's patch that inherits from node-14. I tried to trim as much fat out as possible in the inherited node-(16-)lts, but some of the package arguments were divergent in minor ways. I also bumped the version to 16.5.0 in the meantime. --- Sincerely, Ryan Sundberg On 2/25/22 9:22 AM, Maxime Devos wrote: > Pierre Langlois schreef op vr 25-02-2022 om 16:31 [+0000]: >> If I may shime in, I agree that it's best to have fewer versions of >> node >> for Guix's own node packages, however for end-users I think it's a >> good >> idea to provide multiple versions they can install. > > I'm not opposed to including multiple LTS versions, as long as they > are supported upstream, there actual users of the old LTS versions > and there is some reason to use older versions (perhaps there are > a few incompatibilities?). > > However, I would prefer the latest version to be standard version > (with variable name node-lts) so node packages in Guix use the latest > LTS by default. Something like > > (define-public node-lts > (package > (inherit node) > (version "16.13.2") > [...])) > > ;; Older LTS versions, still maintained upstream and used (see <...>). > ;; There are some incompatibilities between [...], so allow users > ;; to choose which node to use. > (define-public node-14 > (package > (inherit node-lts) > (version "14.[...]") > [...])) > > Greetings, > Maxime. From 14065e4f69eea85503db2af6e6ef38e6ec1a6e28 Mon Sep 17 00:00:00 2001 From: Ryan Sundberg Date: Sun, 1 May 2022 23:00:13 -0700 Subject: [PATCH] gnu: node-lts: Update to 16.15.0 Keeps node-14 available for legacy use cases and graceful migration purposes. * gnu/packages/node.scm (node-lts): Update to 16.15.0 * gnu/packages/node.scm (node-14): Export previous LTS version Co-authored-by: zamfofex --- gnu/packages/node.scm | 177 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 175 insertions(+), 2 deletions(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index ce94557a8c..c0f66ef04b 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -11,6 +11,8 @@ ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021, 2022 Philip McGrath +;;; Copyright © 2022 zamfofex +;;; Copyright © 2022 Ryan Sundberg ;;; ;;; This file is part of GNU Guix. ;;; @@ -662,7 +664,7 @@ (define-public node-llparse-bootstrap parser definition into a C output.") (license license:expat))) -(define-public llhttp-bootstrap +(define llhttp-2 (package (name "llhttp") (version "2.1.4") @@ -732,7 +734,49 @@ (define-public llhttp-bootstrap source files.") (license license:expat))) -(define-public node-lts +(define-public llhttp-bootstrap + (package + (inherit llhttp-2) + (name "llhttp") + (version "6.0.6") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nodejs/llhttp.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1c1p39m46frpslm5yx13hj58r7s0cila03yvqp6caip5dbizpfmr")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Fix imports for esbuild. + ;; https://github.com/evanw/esbuild/issues/477 + (substitute* "src/llhttp/http.ts" + (("\\* as assert") "assert")) + (substitute* "Makefile" + (("npx ts-node bin/generate.ts") + "node bin/generate.js")) + #t)))) + (build-system gnu-build-system) + (arguments + (substitute-keyword-arguments (package-arguments llhttp-2) + ((#:phases phases) + `(modify-phases ,phases + (replace 'install-src + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (src-dir (string-append out "/src")) + (src-src-dir (string-append src-dir "/src"))) + (install-file "src/llhttp.gyp" src-dir) + (install-file "src/common.gypi" src-dir) + (install-file "build/c/llhttp.c" src-src-dir) + (install-file "src/native/http.c" src-src-dir) + (install-file "src/native/api.c" src-src-dir) + #t))))))))) + +(define-public node-14 (package (inherit node) (version "14.18.3") @@ -878,6 +922,135 @@ (define-public node-lts c-ares-for-node icu4c-67 libuv-for-node + llhttp-2 + brotli + `(,nghttp2 "lib") + openssl + python-wrapper ;; for node-gyp (supports python3) + zlib)))) + +(define-public node-lts + (package + (inherit node-14) + (version "16.15.0") + (source (origin + (method url-fetch) + (uri (string-append "https://nodejs.org/dist/v" version + "/node-v" version ".tar.xz")) + (sha256 + (base32 + "1xx4drj3rc6kin60bm84f3wnnplglih7k588r8g34y1zqkpi5y50")) + (modules '((guix build utils))) + (snippet + `(begin + ;; Remove bundled software, where possible + (for-each delete-file-recursively + '("deps/cares" + "deps/icu-small" + "deps/nghttp2" + "deps/openssl" + "deps/zlib")) + (substitute* "Makefile" + ;; Remove references to bundled software. + (("deps/uv/uv.gyp") "") + (("deps/zlib/zlib.gyp") "")) + #t)))) + (arguments + (substitute-keyword-arguments (package-arguments node-14) + ((#:phases phases) + `(modify-phases ,phases + (replace 'delete-problematic-tests + (lambda* (#:key inputs #:allow-other-keys) + ;; Fix hardcoded /bin/sh references. + (substitute* '("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-stdin-from-file-spawn.js" + "test/parallel/test-stdio-closed.js" + "test/sequential/test-child-process-emfile.js") + (("'/bin/sh'") + (string-append "'" (assoc-ref inputs "bash") "/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 "'" (assoc-ref inputs "coreutils") + "/bin/env'"))) + + ;; 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-primary-error.js" + "test/parallel/test-cluster-primary-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 require networking. + (delete-file "test/parallel/test-https-agent-unref-socket.js") + + ;; This test is timing-sensitive, and fails sporadically on + ;; slow, busy, or even very fast machines. + (delete-file "test/parallel/test-fs-utimes.js") + + ;; FIXME: This test fails randomly: + ;; https://github.com/nodejs/node/issues/31213 + (delete-file "test/parallel/test-net-listen-after-destroying-stdin.js") + + ;; FIXME: These tests fail on armhf-linux: + ;; https://github.com/nodejs/node/issues/31970 + ,@(if (target-arm32?) + '((for-each delete-file + '("test/parallel/test-zlib.js" + "test/parallel/test-zlib-brotli.js" + "test/parallel/test-zlib-brotli-flush.js" + "test/parallel/test-zlib-brotli-from-brotli.js" + "test/parallel/test-zlib-brotli-from-string.js" + "test/parallel/test-zlib-convenience-methods.js" + "test/parallel/test-zlib-random-byte-pipes.js" + "test/parallel/test-zlib-write-after-flush.js"))) + '()) + + ;; 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. + ;; TODO: Regenerate certs instead. + (for-each delete-file + '("test/parallel/test-tls-passphrase.js" + "test/parallel/test-tls-server-verify.js" + "test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js")))) + (replace 'replace-llhttp-sources + (lambda* (#:key inputs #:allow-other-keys) + ;; Replace pre-generated llhttp sources + (delete-file-recursively "deps/llhttp") + (copy-recursively (string-append (assoc-ref inputs "llhttp") "/src") + "deps/llhttp"))))))) + (native-inputs + (list ;; Runtime dependencies for binaries used as a bootstrap. + c-ares-for-node + brotli + icu4c + libuv-for-node + `(,nghttp2 "lib") + openssl + zlib + ;; Regular build-time dependencies. + perl + pkg-config + procps + python + util-linux)) + (inputs + (list bash-minimal + coreutils + c-ares-for-node + icu4c + libuv-for-node llhttp-bootstrap brotli `(,nghttp2 "lib") -- 2.34.0