unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: jlicht@fsfe.org
To: 66158@debbugs.gnu.org
Cc: Jelle Licht <jlicht@fsfe.org>
Subject: [bug#66158] [PATCH v2] gnu: node-lts: Update to 18.18.2.
Date: Fri, 27 Oct 2023 18:02:29 +0200	[thread overview]
Message-ID: <b865aca9b05e55238918ea21270ca44055616927.1698422549.git.jlicht@fsfe.org> (raw)
In-Reply-To: <b6c80111b210fe06895f45fe54cde465cc757eb9.1695406392.git.jlicht@fsfe.org>

From: Jelle Licht <jlicht@fsfe.org>

* gnu/packages/node.scm (node-lts): Update to 18.18.2.
[arguments]<phases>: 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(-)

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

base-commit: 2ff8de3657a5c9d0abf67bb4705251b23d97702e
-- 
2.41.0





  parent reply	other threads:[~2023-10-27 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 18:13 [bug#66158] [PATCH] gnu: node-lts: Update to 18.18.0 jlicht
2023-10-06 15:59 ` Jelle Licht
2023-10-24 15:41   ` Ludovic Courtès
2023-10-27 16:02 ` jlicht [this message]
2023-11-03  9:53   ` [bug#66158] [PATCH v2] gnu: node-lts: Update to 18.18.2 Christopher Baines
2023-11-05 13:42     ` bug#66158: " Jelle Licht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b865aca9b05e55238918ea21270ca44055616927.1698422549.git.jlicht@fsfe.org \
    --to=jlicht@fsfe.org \
    --cc=66158@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).