From patchwork Fri Oct 27 16:02:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jelle Licht X-Patchwork-Id: 55392 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 9F1AD27BBEA; Fri, 27 Oct 2023 17:03:55 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 BDE9527BBE9 for ; Fri, 27 Oct 2023 17:03:54 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwPJF-0007rV-3l; Fri, 27 Oct 2023 12:03:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwPJC-0007ie-MF for guix-patches@gnu.org; Fri, 27 Oct 2023 12:03:38 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwPJ4-0005GT-WC for guix-patches@gnu.org; Fri, 27 Oct 2023 12:03:37 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qwPJZ-0003nm-Tg for guix-patches@gnu.org; Fri, 27 Oct 2023 12:04:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66158] [PATCH v2] gnu: node-lts: Update to 18.18.2. References: In-Reply-To: Resent-From: jlicht@fsfe.org Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Oct 2023 16:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66158 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66158@debbugs.gnu.org Cc: Jelle Licht Received: via spool by 66158-submit@debbugs.gnu.org id=B66158.169842259214480 (code B ref 66158); Fri, 27 Oct 2023 16:04:01 +0000 Received: (at 66158) by debbugs.gnu.org; 27 Oct 2023 16:03:12 +0000 Received: from localhost ([127.0.0.1]:36903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwPIl-0003lR-K3 for submit@debbugs.gnu.org; Fri, 27 Oct 2023 12:03:12 -0400 Received: from mail2.fsfe.org ([213.95.165.55]:37150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwPIi-0003lC-RO for 66158@debbugs.gnu.org; Fri, 27 Oct 2023 12:03:11 -0400 From: jlicht@fsfe.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021081301; t=1698422555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=431TUeo6oxZF4fErqeVOOOeXJXq501xvwWTZuCpRxZ4=; b=LDR6RYAS/K2dIvSbxJzVQ+7JCprRO+HEZLKz9EJy7FD1PdukR+J93cZxO9srClSerTotz0 0MX9spHoyn1jOA6FknHgY8uIA5RMa9bTsDznqtz4mzNAxCuHLCcs06bAIjB3OOWNzsgJLh C+/9PYZG4uEx2TNTUGHSYdVCM0p8YP4= Date: Fri, 27 Oct 2023 18:02:29 +0200 Message-ID: MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Jelle Licht * gnu/packages/node.scm (node-lts): Update to 18.18.2. [arguments]: Add 'install-node-gyp-wrapper phase. Change-Id: I6b17de33313505558a8fa9560126adef486fd0e3 --- I tried my hand at introducing a small wrapper script that works around the node-gyp regression introduced in the version of npm bundled with node 18.18.2. It's not quite clear yet whether upstream considers this a regression that will still be fixed or just behaviour that be kept as-is going forward. This patch series also leaves Node vulnerable to a recently reported CVE in many HTTP2 server implementations, such as nghttp2, but I believe this can be addressed by https://issues.guix.gnu.org/issue/66658 Changes in v2: - Re-bump from 18.18.0 to 18.18.2 - Fix 'node-gyp' regression. gnu/packages/node.scm | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) base-commit: 2ff8de3657a5c9d0abf67bb4705251b23d97702e diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index d769066dc4..6e30ad486a 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -738,14 +738,14 @@ (define-public llhttp-bootstrap (define-public node-lts (package (inherit node) - (version "18.17.1") + (version "18.18.2") (source (origin (method url-fetch) (uri (string-append "https://nodejs.org/dist/v" version "/node-v" version ".tar.gz")) (sha256 (base32 - "0dachvhf5jxrb1av8mn2dikbhwklxsgc9y2zg4h50fcwh5d54mqi")) + "0ci1faxjsbp0lv05kskh5anfljn6zawqcf7dawiby5d5qg7x572h")) (modules '((guix build utils))) (snippet '(begin @@ -903,7 +903,26 @@ (define-public node-lts "/lib/node_modules/npm/node_modules" "/tar/lib/write-entry.js"))) (substitute* file - (("this.stat.nlink > 1") "false"))))))))) + (("this.stat.nlink > 1") "false"))))) + (add-after 'install 'install-node-gyp-wrapper + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (dir (string-append out "/lib/node_modules/npm/bin/node-gyp-bin")) + (file (string-append dir "/node-gyp"))) + (mkdir-p dir) + ;; See https://github.com/npm/cli/issues/6842 + (call-with-output-file file + (lambda (port) + (format port "#!~a/bin/sh +if [ \"x$npm_config_node_gyp\" = \"x\" ]; then + ~a/bin/node \"~a/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"$@\" +else + \"$npm_config_node_gyp\" \"$@\" +fi" + (assoc-ref inputs "bash") + out + out))) + (chmod file #o555)))))))) (native-inputs (list ;; Runtime dependencies for binaries used as a bootstrap. c-ares-for-node