From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0DWYFuNizWHexgAAgWs5BA (envelope-from ) for ; Thu, 30 Dec 2021 08:42:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iKBKD+NizWHiNAEAG6o9tA (envelope-from ) for ; Thu, 30 Dec 2021 08:42:27 +0100 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 D3388BC59 for ; Thu, 30 Dec 2021 08:42:26 +0100 (CET) Received: from localhost ([::1]:52878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2q4v-0007Dn-PZ for larch@yhetil.org; Thu, 30 Dec 2021 02:42:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2q3a-0006op-Mq for guix-patches@gnu.org; Thu, 30 Dec 2021 02:41:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2q3a-0007sI-DM for guix-patches@gnu.org; Thu, 30 Dec 2021 02:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2q3a-0006TX-CN for guix-patches@gnu.org; Thu, 30 Dec 2021 02:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v6 01/41] guix: node-build-system: Add delete-lockfiles phase. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Dec 2021 07:41:02 +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.164085005524845 (code B ref 51838); Thu, 30 Dec 2021 07:41:02 +0000 Received: (at 51838) by debbugs.gnu.org; 30 Dec 2021 07:40:55 +0000 Received: from localhost ([127.0.0.1]:50948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2q3S-0006Sd-Sc for submit@debbugs.gnu.org; Thu, 30 Dec 2021 02:40:55 -0500 Received: from mail-vk1-f179.google.com ([209.85.221.179]:40765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2q3M-0006S1-3n for 51838@debbugs.gnu.org; Thu, 30 Dec 2021 02:40:48 -0500 Received: by mail-vk1-f179.google.com with SMTP id 70so13266025vkx.7 for <51838@debbugs.gnu.org>; Wed, 29 Dec 2021 23:40:48 -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=hni5nY4ay9AazjxpIX/1NQXjHwPNsblOTWxNj5BVAFAOy/mWRUeofR8llCHgaR6O8j CNGjBvmKYdzchgD/2FRRXuj3jxF/a8wfWcMrONMWdY2kQHxj1/hILcZpRmo+WkJh8hWg uQw0OPpdz24PQ+z2QBAfbzThzgkCkb6AK21NM5ChbTjE73u/rvaF6FddfhTvTyHi+euh a6X54qURnMaKbHOWGnyB3lhHivggPP3rNs85nxmA6bgGW3L0dfjcKVf4+EKOQS+e8Y7X di8Ks7sjYkg+LZcHWg6gfsAqdhUMeeV0QOCzsQfMJb9nqn72lpKn+R/CorijrD/ALiq6 2s1Q== 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=xD4dID1Q71XhKtXpsVIF1oYqUCKTtUBmYDwsuIsfK2JHKkzitAmbdUfg1bRAerMzZC q9Y0IC7U79f92jqLEvpgNytRBBaUWpR+tx7EYy8zeYVHY2DMw0xyhHXwkHWmHMDt5nDR uN2bI5Dwp2tLVitA+XmE7l/2GZzELDrIUN8iZTADL0ni/oWivWs4ID5lRsKYcb393HT7 icF/dJAZdzWlg96cEsPyGasXumnQ2nEn1fiNb8xGnA4/JON0B1/UgFSR87BdofYzIuh/ y8YWK7zFJIokhWxMwTnckf/OZcBNF76IN2hQATp192Z2UCFCWsCUDFO7/H5s43WFmRH2 ryIg== X-Gm-Message-State: AOAM53189yLCv6T0qwBrdS6dGQJV4AVse+mYMdczC2aMc1ATLvy9tq4U 1g18wrH5pBjnHGHQWX9Lnw2GqHwNPOeIhryv X-Google-Smtp-Source: ABdhPJyAs4LvPXBlgxnXpFAZdK7GFchehP1RfUIzSG+uCIfvbMa3G8oPsxHfTrQurj1hOEXAwcgWbg== X-Received: by 2002:a1f:f8c4:: with SMTP id w187mr9787444vkh.41.1640850042549; Wed, 29 Dec 2021 23:40:42 -0800 (PST) Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with UTF8SMTPSA id t3sm4939377vsl.25.2021.12.29.23.40.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Dec 2021 23:40:42 -0800 (PST) From: Philip McGrath Date: Thu, 30 Dec 2021 02:38:39 -0500 Message-Id: <20211230073919.30327-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211230073919.30327-1-philip@philipmcgrath.com> References: <082a81964a43ae5f735ad2ca433d0dfe00859c35.camel@gmail.com> <20211230073919.30327-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=1640850147; 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=ArnbPuTsTvV8EaFGqP5AlKLOKBVSFwNrGwpw/oYpujWwXWepxeHaRJhB8+IsW+MSzpdMl8 dadlK4OLTLnNPPRFuQeZPrq2EnwYt3OzIyN0+OFZqtN9qho6t9Wf7mOIQB5Mu36KpccJlV kOyMN1P+Bet9WRgMOXtykSrdppDB1UJ5wnN3ECz7BToiDzpvgIR1gLw6xKgUtLr+Q99rKe uCiZZ87BFizRai/lmJX7hGuCw8cDiE7BY92jsKNlWLj7qqq0u7k4YM5+p5++yKvYitKlg2 nW9/9ANH2fT4Cct3IMhSoIlZhqqpE9i3k/X62WYW4bkyIm9UXszjsPhH9OeymA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640850147; a=rsa-sha256; cv=none; b=cUVEgTlw1Ygcbacy8r7tI5D5Vk9WvueMnbOn874cNSkL/57ui2iuNO+93m5C2zPi6ENZOF laA9SIITApRfNI0MAZHnRO1U78cc67CsaYXVn247n0XpoGP9VgmW1gGQXKQV7OdUDTjwR7 JL+Yco3d9s0YumS64ZPnhIZ9YcZsZl8qE/bqaWwkwE36bmU3Z1mTil30Vz2tZxHrSxvLGv GU/k+Cz/xBEHSiv2TXfwfUa1Y2Cv04rrJsZFyK9naHxgy0BrqA3hSid3a1rvP4CgEVDUAt KbrnkVYqKhyYx/F6BUytggzKdif85Q4pbcDfuDXfgOqF3Ne8EaXxwGOW8Ozd8Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=hni5nY4a; 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.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=hni5nY4a; 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: D3388BC59 X-Spam-Score: 0.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: CJnG4gqp9DWu * 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