From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0GooAYrwu2FSNAEAgWs5BA (envelope-from ) for ; Fri, 17 Dec 2021 03:06:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YJN0OInwu2FIbgAAbx9fmQ (envelope-from ) for ; Fri, 17 Dec 2021 02:06:01 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C40E51B4C1 for ; Fri, 17 Dec 2021 03:06:01 +0100 (CET) Received: from localhost ([::1]:50914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1my2dE-0003Ei-Ui for larch@yhetil.org; Thu, 16 Dec 2021 21:06:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1my2cL-00037m-EW for guix-patches@gnu.org; Thu, 16 Dec 2021 21:05:14 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1my2cJ-0007YI-9a for guix-patches@gnu.org; Thu, 16 Dec 2021 21:05:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1my2cJ-00055b-4m for guix-patches@gnu.org; Thu, 16 Dec 2021 21:05:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v5 05/45] guix: node-build-system: Add delete-lockfiles phase. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Dec 2021 02:05:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51838 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51838@debbugs.gnu.org Cc: Timothy Sample , Pierre Langlois , Jelle Licht , Philip McGrath , Liliana Marie Prikler Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.163970666019370 (code B ref 51838); Fri, 17 Dec 2021 02:05:03 +0000 Received: (at 51838) by debbugs.gnu.org; 17 Dec 2021 02:04:20 +0000 Received: from localhost ([127.0.0.1]:37272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my2bc-00052L-H8 for submit@debbugs.gnu.org; Thu, 16 Dec 2021 21:04:20 -0500 Received: from mail-qk1-f174.google.com ([209.85.222.174]:41760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my2bV-00051a-H6 for 51838@debbugs.gnu.org; Thu, 16 Dec 2021 21:04:15 -0500 Received: by mail-qk1-f174.google.com with SMTP id t83so772735qke.8 for <51838@debbugs.gnu.org>; Thu, 16 Dec 2021 18:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UqCWz+02IeHqBG76t8ha9dj85wQjLagMgL0iihmBPRc=; b=T54Z7tru4r/5y6mpO5/aF6P3Okn3gk4tNEJ10zX8qfIk7aJgH82gTlI39qN/l7wPj8 EJWEa43xIb9R8N1hjGh0OREtCBS7CceF8G/liiLdsyqqVDQVQUx4udXAXrr4f6+IhcV9 9uEgQJqZAgsDuovfP5TIgzvFkijNO7L0d2jGbYg0MMT6tAE++LuXbkUUDYwAeTL5lUnt o/DlVDO2D3AnmWxNMneE1S9CyeaBdUdWscgbdMOy1GCvsWBIy2/XhFlhfW/hk4Gh5L5c jqoBHkoS8gO2BN8tH3G9dC1SacuuFnY4D+G95WJ3Lfi5nliEeIVVxvS8YRVvPBVh0uTr HuxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UqCWz+02IeHqBG76t8ha9dj85wQjLagMgL0iihmBPRc=; b=oqsy5KD2d1tcrh8xQTM71752lDNtiye3/djWX/SkX1DExfeRCdMJpzpZe3G4RyCjZg FEEY4l+YAwFOmO/V5fAlrJlsmGZt7TJXBJdojGzeQl0HLGXi9MaDfl/4Ffr1NukuO5V3 36zzKD8q2/2CPHbhVgBE2aFMAEGXko37c11H0LhQRwVYBG302S+9acvsfcY/395HT4Ts +pCpuRba8yhPktKDjZZtrufvjNhmyJrBNpCfprJlzDP8uFtw6vei6ffhphWtkR8/Jaj5 bTQVGD0JG0MdWgG9t6Kcx9VICvr493CvAaYFyMr9ii6ootHPXvGq5HWc9gbYorerqrmR bNaA== X-Gm-Message-State: AOAM531leA/s5TkbvlRv64xtE7nLSeFRBxfxPcjpeK+gGF0/AvRtR/gc i6cAGo2PtcWSTSZ4QTXHA8nUHADB6273ULa7xp8= X-Google-Smtp-Source: ABdhPJz0dlYPx7xHGh3nUNWuMi/fUfXPpIQW9fTK0kUYGU0AKSe2jYhCG6ul9NkOCDMiv6gWOiHVeQ== X-Received: by 2002:a37:6312:: with SMTP id x18mr569894qkb.198.1639706648084; Thu, 16 Dec 2021 18:04:08 -0800 (PST) Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with ESMTPSA id bj32sm3897402qkb.75.2021.12.16.18.04.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Dec 2021 18:04:07 -0800 (PST) From: Philip McGrath Date: Thu, 16 Dec 2021 21:02:45 -0500 Message-Id: <20211217020325.520821-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211217020325.520821-1-philip@philipmcgrath.com> References: <20211213060107.129223-1-philip@philipmcgrath.com> <20211217020325.520821-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639706761; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=UqCWz+02IeHqBG76t8ha9dj85wQjLagMgL0iihmBPRc=; b=BfncanIrMpO2h4h3Brz+zDereAagPoCNyUQKb72t7DW5094S/onhy6u9Ac9Z1/4jfclN06 k4QGVom3idfuAaP8tQ7l+MHeBLuKJ41JIWmRMEc2D18Rv1uPig7gN17UC7a8eMNRLXrmQu nUugRbGs+G4Y3IuVVSRS2YS9FoD0QPPEwZOUFbq4KhjynL7tVmGDfFBypG1a0i1yAofxGV zRIVWMxGec6eRrx5Kj/2TAt6Oh/Ly6wgNskvIqszdO4sKozA1Dl1+IVe2PA3jjiHjKIv6i X1Xh8WJ+ZmqTb1QD1fqMoTk8ySXhrCpa1P+bPd0Fc5eP6sKf6zAL4nOauEytGA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639706761; a=rsa-sha256; cv=none; b=qF2y5HqQkTiGgoz7ew0yD78sB43XU3lakewZNqFWeL4joyLfxqnqK9ooiR053AqZdm89YX JBbf2KiqGy23Sog9kBiIMr4azWT/eSP70UNw17N0GSGjUVFD1gMAhtHOoaRJSnfGAdJ9qa ev0Jv8H+WHGa0JeK7TXYo4RMq3O2XrSb10glLZMl/H4ZwI9zAkdim4AOXgShZbBogj1lQa 3/IaoJc4m+t3totc+QNMSTvIa65miBHzBtz3ACZ9mN+qAZR9fYykm81ge97smeCQvrZGwx YmKeW0QG/+bNCOad4NUkpo7yfQCMvC3CxEMBdabjvQxCCV8XhhFyWJj89d7ERQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=T54Z7tru; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.01 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=T54Z7tru; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C40E51B4C1 X-Spam-Score: 0.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: 55ejBCwBdA/I * guix/build/node-build-system.scm (delete-lockfiles): New function. Remove 'package-lock.json', 'yarn.lock', and 'npm-shrinkwrap.json', if they exist. Because these files specify both exact dependency versions and integrity hashes, they only cause problems for Guix. (%standard-phases): Add 'delete-lockfiles' after 'patch-dependencies'. --- guix/build/node-build-system.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm index 70a367618e..dcaa719f40 100644 --- a/guix/build/node-build-system.scm +++ b/guix/build/node-build-system.scm @@ -96,6 +96,17 @@ (define (resolve-dependencies package-meta meta-key) (write-json package-meta out)))) #t) +(define* (delete-lockfiles #:key inputs #:allow-other-keys) + "Delete 'package-lock.json', 'yarn.lock', and 'npm-shrinkwrap.json', if they +exist." + (for-each (lambda (pth) + (when (file-exists? pth) + (delete-file pth))) + '("package-lock.json" + "yarn.lock" + "npm-shrinkwrap.json")) + #t) + (define* (configure #:key outputs inputs #:allow-other-keys) (let ((npm (string-append (assoc-ref inputs "node") "/bin/npm"))) (invoke npm "--offline" "--ignore-scripts" "install") @@ -146,6 +157,7 @@ (define %standard-phases (modify-phases gnu:%standard-phases (add-after 'unpack 'set-home set-home) (add-before 'configure 'patch-dependencies patch-dependencies) + (add-after 'patch-dependencies 'delete-lockfiles delete-lockfiles) (replace 'configure configure) (replace 'build build) (replace 'check check) -- 2.32.0