GNU bug report logs - #64592
[PATCH 1/2] gnu: node-lts: Simplify snippet.

Previous Next

Package: guix-patches;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Thu, 13 Jul 2023 08:31:02 UTC

Severity: normal

Tags: patch

Done: 宋文武 <iyzsong <at> envs.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64592 in the body.
You can then email your comments to 64592 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to jlicht <at> fsfe.org, guix-patches <at> gnu.org:
bug#64592; Package guix-patches. (Thu, 13 Jul 2023 08:31:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricardo Wurmus <rekado <at> elephly.net>:
New bug report received and forwarded. Copy sent to jlicht <at> fsfe.org, guix-patches <at> gnu.org. (Thu, 13 Jul 2023 08:31:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: guix-patches <at> gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: [PATCH 1/2] gnu: node-lts: Simplify snippet.
Date: Thu, 13 Jul 2023 10:30:14 +0200
* gnu/packages/node.scm (node-lts)[source]: Remove quasiquote, trailing #T,
and IF with explicit booleans.
---
 gnu/packages/node.scm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 7695614b3a..c0bb4f2342 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2018-2022 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2020, 2021 Pierre Langlois <pierre.langlois <at> gmx.com>
-;;; Copyright © 2020 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2020, 2023 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021, 2022 Philip McGrath <philip <at> philipmcgrath.com>
@@ -748,13 +748,12 @@ (define-public node-lts
                 "0vcc132z7lkxnw5clmiz6sp6ccmw35pyb69hczphrig5frfmqkva"))
               (modules '((guix build utils)))
               (snippet
-               `(begin
+               '(begin
                   ;; openssl.cnf is required for build.
                   (for-each delete-file-recursively
                             (find-files "deps/openssl"
                                         (lambda (file stat)
-                                          (if (string-contains file "nodejs-openssl.cnf")
-                                              #f #t))))
+                                          (not (string-contains file "nodejs-openssl.cnf")))))
                   ;; Remove bundled software, where possible
                   (for-each delete-file-recursively
                             '("deps/cares"
@@ -764,8 +763,7 @@ (define-public node-lts
                   (substitute* "Makefile"
                     ;; Remove references to bundled software.
                     (("deps/uv/uv.gyp") "")
-                    (("deps/zlib/zlib.gyp") ""))
-                  #t))))
+                    (("deps/zlib/zlib.gyp") ""))))))
     (arguments
      (substitute-keyword-arguments (package-arguments node)
        ((#:configure-flags configure-flags)

base-commit: 2794caed7c813f2ec4249236de36eaccafee8361
-- 
2.40.1





Information forwarded to jlicht <at> fsfe.org, guix-patches <at> gnu.org:
bug#64592; Package guix-patches. (Thu, 13 Jul 2023 08:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 64592 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 64592 <at> debbugs.gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: [PATCH 2/2] gnu: node-lts: Install files irrespective of number of
 hardlinks.
Date: Thu, 13 Jul 2023 10:47:01 +0200
* gnu/packages/node.scm (node-lts)[arguments]: Add build phase
'ignore-number-of-hardlinks.
---
 gnu/packages/node.scm | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index c0bb4f2342..8ba57dd4e0 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -874,7 +874,36 @@ (define-public node-lts
                  (copy-file (string-append llhttp "/src/http.c")
                             "deps/llhttp/src/http.c")
                  (copy-file (string-append llhttp "/include/llhttp.h")
-                            "deps/llhttp/include/llhttp.h"))))))))
+                            "deps/llhttp/include/llhttp.h"))))
+           ;; npm installs dependencies by copying their files over a tar
+           ;; stream.  A file with more than one hardlink is marked as a
+           ;; "Link".  pacote/lib/fetcher.js calls node-tar's extractor with a
+           ;; filter that ignores any "Link" entries.  This means that
+           ;; dependending on the number of hardlinks on files in a node-*
+           ;; package *some* of its files may not be installed when generating
+           ;; another package's "node_modules" directory.  The build output
+           ;; would differ depending on irrelevant file system state.
+           ;;
+           ;; To avoid this, we patch node-tar to treat files with hardlinks
+           ;; the same as any other file, so that node-tar has no choice but
+           ;; to extract all of them --- independent of pacote's filter.
+           ;;
+           ;; Why not patch pacote's filter instead?  This has led to subtle
+           ;; differences in where the files are installed, so it's easier to
+           ;; just ensure that files with hardlinks are always treated as
+           ;; regular files.
+           ;;
+           ;; Discussion:
+           ;;   https://lists.gnu.org/archive/html/guix-devel/2023-07/msg00040.html
+           ;; Upstream bug report:
+           ;;   https://github.com/npm/pacote/issues/285
+           (add-after 'install 'ignore-number-of-hardlinks
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((file (string-append (assoc-ref outputs "out")
+                                          "/lib/node_modules/npm/node_modules"
+                                          "/tar/lib/write-entry.js")))
+                 (substitute* file
+                   (("this.stat.nlink > 1") "false")))))))))
     (native-inputs
      (list ;; Runtime dependencies for binaries used as a bootstrap.
            c-ares-for-node
-- 
2.40.1





Reply sent to 宋文武 <iyzsong <at> envs.net>:
You have taken responsibility. (Fri, 21 Jul 2023 12:29:02 GMT) Full text and rfc822 format available.

Notification sent to Ricardo Wurmus <rekado <at> elephly.net>:
bug acknowledged by developer. (Fri, 21 Jul 2023 12:29:02 GMT) Full text and rfc822 format available.

Message #13 received at 64592-done <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: bug#64592 <64592-done <at> debbugs.gnu.org>
Subject: Re: bug#64592: [PATCH 1/2] gnu: node-lts: Simplify snippet.
Date: Fri, 21 Jul 2023 20:28:09 +0800
Pushed as 5dc2a88f99e2e448f7e9ca842a4a0d072a8f8f20, close issue...




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Aug 2023 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 362 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.