From unknown Mon Aug 18 06:56:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#64591] [PATCH 2/2] gnu: node-lts: Install files irrespective of number of hardlinks. Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: jlicht@fsfe.org, guix-patches@gnu.org Resent-Date: Thu, 13 Jul 2023 08:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64591 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64591@debbugs.gnu.org Cc: Ricardo Wurmus , Jelle Licht X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Jelle Licht Received: via spool by submit@debbugs.gnu.org id=B.168923703711362 (code B ref -1); Thu, 13 Jul 2023 08:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 Jul 2023 08:30:37 +0000 Received: from localhost ([127.0.0.1]:53328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJrif-0002xC-16 for submit@debbugs.gnu.org; Thu, 13 Jul 2023 04:30:37 -0400 Received: from lists.gnu.org ([209.51.188.17]:40782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJrid-0002x4-8O for submit@debbugs.gnu.org; Thu, 13 Jul 2023 04:30:35 -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 1qJrid-0004Cc-2P for guix-patches@gnu.org; Thu, 13 Jul 2023 04:30:35 -0400 Received: from sender3-of-o58.zoho.com ([136.143.184.58]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJrib-0000NF-CF for guix-patches@gnu.org; Thu, 13 Jul 2023 04:30:34 -0400 Delivered-To: rekado@elephly.net ARC-Seal: i=1; a=rsa-sha256; t=1689237028; cv=none; d=zohomail.com; s=zohoarc; b=l/bbiLFxCd+duwPIswkYYxuC995drEa7spw9T3yNnToAttcpowvmM58YBWwcyy0nKVKaLMalsGmnXiVIbiMV3vVilVlqfTOs0OX2uvdob/oQJwHi9IYKu1YaYRqi7i+F+EcJTdpx+z0U3KoE/sMnLAJlAktsJ8Zj2Gwh7gFA/kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689237028; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=A1pVJh1z+Og8xzJbOj5hYiiWHnsQ7PWcLACwxNi9gI4=; b=O0StJ1BSwsUe2vOy6cKyDmUZItmNU2QVIq8rVOojb6KaaUprTWiymPIPpzfdbay6DleNS0m2NrIrSf7n4vn+y1vVr/cXUubrHJGdRRr3lJ4S+6XcBmibonpge1sU/08UVRERiibihOxRI4g/MYAOUfgr3tuLneVZs3VlarR3myY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1689237028; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=A1pVJh1z+Og8xzJbOj5hYiiWHnsQ7PWcLACwxNi9gI4=; b=gajKvSqZPgNDzJe7lNwpuWU815B5hnsZ9HeyI9XHDM2nUbfHxFhOH7YzPNnyi6PY Rjh3dPrDPuiz9nMDhUieQpk7wOLJov4xzyqktn3rUm+MFnD/inoYKr2En40Lt2jbC6s 2OOBw+XyGfFXEpUj/zwHAins8IG9L/lOZ+hhWveM= Received: from localhost (215-111-142-46.pool.kielnet.net [46.142.111.215]) by mx.zohomail.com with SMTPS id 1689237026531302.7942123395153; Thu, 13 Jul 2023 01:30:26 -0700 (PDT) From: Ricardo Wurmus Date: Thu, 13 Jul 2023 10:30:15 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.184.58; envelope-from=rekado@elephly.net; helo=sender3-of-o58.zoho.com 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * 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 From unknown Mon Aug 18 06:56:59 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ricardo Wurmus Subject: bug#64591: closed ([PATCH 2/2] gnu: node-lts: Install files irrespective of number of hardlinks.) Message-ID: References: <87y1jkgpzk.fsf@elephly.net> X-Gnu-PR-Message: they-closed 64591 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 64591@debbugs.gnu.org Date: Thu, 13 Jul 2023 08:45:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1689237903-12732-1" This is a multi-part message in MIME format... ------------=_1689237903-12732-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #64591: [PATCH 2/2] gnu: node-lts: Install files irrespective of number of = hardlinks. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64591@debbugs.gnu.org. --=20 64591: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64591 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1689237903-12732-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 64591-done) by debbugs.gnu.org; 13 Jul 2023 08:44:52 +0000 Received: from localhost ([127.0.0.1]:53350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJrwR-0003Ib-TD for submit@debbugs.gnu.org; Thu, 13 Jul 2023 04:44:52 -0400 Received: from sender3-of-o57.zoho.com ([136.143.184.57]:21781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJrwE-0003IH-9D for 64591-done@debbugs.gnu.org; Thu, 13 Jul 2023 04:44:50 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1689237875; cv=none; d=zohomail.com; s=zohoarc; b=mcYI0nJ1E1cpixex8D5KvYq/2gzR/fNyHyXH2JXchj09YhPdqPJBbLTpyBV8U9dv8g+dJ4vm08zjGATehomnKVdNew7UYazJtYaFgSxmZUsyo43rj4psRAVaVwfm8UNJTkClpwMtIRAjGb+EjnJQOKppnbrcqjKEWuFKQbjq3tg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689237875; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=aWxzWJftqdpTRVUJaH3Ap+hoxQca7rV376cxLfpbzXM=; b=gRpRRYoZ72WIfEyZoP/wLFvA39vsRTcPL9LTBQwQl9lBAoOwHU/bZ5syGyKf1WmigOtgQug+lSxdScx/t2CE66ujYaG24et1MehIcIAy85JrHlTtOdH+Lysg9CsUDrOyYeKeQV3kPD14uWV9ODyzLdlevhiJfSkofOj9KPQ19V4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1689237875; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To:Cc; bh=aWxzWJftqdpTRVUJaH3Ap+hoxQca7rV376cxLfpbzXM=; b=M8ivNjAQCx1X7xI9ckamBKXzo93KRo5+AlvPX+bWc+Kh1yC45twfwDk9C5USNGGN bEwkJ3bWYL3QxeVX40IF1fasyoCnamequNK8ZLACP+fR/MLP/wBOGn9dBiPXrPWIMPy AsAtrmw2+eioQQXTYJ3oWCrBVLZBzB6sNaRqk1qA= Received: from localhost (215-111-142-46.pool.kielnet.net [46.142.111.215]) by mx.zohomail.com with SMTPS id 1689237874236297.36400131419316; Thu, 13 Jul 2023 01:44:34 -0700 (PDT) User-agent: mu4e 1.10.3; emacs 28.2 From: Ricardo Wurmus To: 64591-done@debbugs.gnu.org Subject: [PATCH 2/2] gnu: node-lts: Install files irrespective of number of hardlinks. Date: Thu, 13 Jul 2023 10:44:07 +0200 Message-ID: <87y1jkgpzk.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64591-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Closing as duplicate of https://issues.guix.gnu.org/64592 -- Ricardo ------------=_1689237903-12732-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Jul 2023 08:30:37 +0000 Received: from localhost ([127.0.0.1]:53328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJrif-0002xC-16 for submit@debbugs.gnu.org; Thu, 13 Jul 2023 04:30:37 -0400 Received: from lists.gnu.org ([209.51.188.17]:40782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJrid-0002x4-8O for submit@debbugs.gnu.org; Thu, 13 Jul 2023 04:30:35 -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 1qJrid-0004Cc-2P for guix-patches@gnu.org; Thu, 13 Jul 2023 04:30:35 -0400 Received: from sender3-of-o58.zoho.com ([136.143.184.58]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJrib-0000NF-CF for guix-patches@gnu.org; Thu, 13 Jul 2023 04:30:34 -0400 Delivered-To: rekado@elephly.net ARC-Seal: i=1; a=rsa-sha256; t=1689237028; cv=none; d=zohomail.com; s=zohoarc; b=l/bbiLFxCd+duwPIswkYYxuC995drEa7spw9T3yNnToAttcpowvmM58YBWwcyy0nKVKaLMalsGmnXiVIbiMV3vVilVlqfTOs0OX2uvdob/oQJwHi9IYKu1YaYRqi7i+F+EcJTdpx+z0U3KoE/sMnLAJlAktsJ8Zj2Gwh7gFA/kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689237028; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=A1pVJh1z+Og8xzJbOj5hYiiWHnsQ7PWcLACwxNi9gI4=; b=O0StJ1BSwsUe2vOy6cKyDmUZItmNU2QVIq8rVOojb6KaaUprTWiymPIPpzfdbay6DleNS0m2NrIrSf7n4vn+y1vVr/cXUubrHJGdRRr3lJ4S+6XcBmibonpge1sU/08UVRERiibihOxRI4g/MYAOUfgr3tuLneVZs3VlarR3myY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1689237028; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=A1pVJh1z+Og8xzJbOj5hYiiWHnsQ7PWcLACwxNi9gI4=; b=gajKvSqZPgNDzJe7lNwpuWU815B5hnsZ9HeyI9XHDM2nUbfHxFhOH7YzPNnyi6PY Rjh3dPrDPuiz9nMDhUieQpk7wOLJov4xzyqktn3rUm+MFnD/inoYKr2En40Lt2jbC6s 2OOBw+XyGfFXEpUj/zwHAins8IG9L/lOZ+hhWveM= Received: from localhost (215-111-142-46.pool.kielnet.net [46.142.111.215]) by mx.zohomail.com with SMTPS id 1689237026531302.7942123395153; Thu, 13 Jul 2023 01:30:26 -0700 (PDT) From: Ricardo Wurmus To: guix-patches@gnu.org Subject: [PATCH 2/2] gnu: node-lts: Install files irrespective of number of hardlinks. Date: Thu, 13 Jul 2023 10:30:15 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Jelle Licht Content-Transfer-Encoding: 8bit X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.184.58; envelope-from=rekado@elephly.net; helo=sender3-of-o58.zoho.com 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * 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 ------------=_1689237903-12732-1--