From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SGdwOgk012HFLwAAgWs5BA (envelope-from ) for ; Thu, 06 Jan 2022 19:25:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OP/6Ngk012HtrQAAauVa8A (envelope-from ) for ; Thu, 06 Jan 2022 19:25:13 +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 AA8142FF44 for ; Thu, 6 Jan 2022 19:25:13 +0100 (CET) Received: from localhost ([::1]:40418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5XRo-0006Jr-JK for larch@yhetil.org; Thu, 06 Jan 2022 13:25:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5XRf-0006JM-8L for guix-patches@gnu.org; Thu, 06 Jan 2022 13:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5XRe-0000ZM-UE for guix-patches@gnu.org; Thu, 06 Jan 2022 13:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5XRe-0004xs-Q5 for guix-patches@gnu.org; Thu, 06 Jan 2022 13:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v8 01/41] guix: node-build-system: Add delete-lockfiles phase. References: <20211114124151.36743-1-philip@philipmcgrath.com> In-Reply-To: <20211114124151.36743-1-philip@philipmcgrath.com> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 18:25: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: Philip McGrath Cc: 51838@debbugs.gnu.org, Timothy Sample , Pierre Langlois , Jelle Licht , Leo Famulari Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.164149346718768 (code B ref 51838); Thu, 06 Jan 2022 18:25:02 +0000 Received: (at 51838) by debbugs.gnu.org; 6 Jan 2022 18:24:27 +0000 Received: from localhost ([127.0.0.1]:42149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5XR4-0004sG-Eh for submit@debbugs.gnu.org; Thu, 06 Jan 2022 13:24:27 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5XR1-0004rY-7B for 51838@debbugs.gnu.org; Thu, 06 Jan 2022 13:24:24 -0500 Received: by mail-wm1-f68.google.com with SMTP id e5so2428718wmq.1 for <51838@debbugs.gnu.org>; Thu, 06 Jan 2022 10:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:to:cc:content-transfer-encoding:message-id :mime-version; bh=kKs7hf6RlDAxhc/L2xkJDbLwKKmZzstAlhN4AK1SxNk=; b=b/G5qgva+FwoG/qAGUmydbNgJNdRuvRrTnJ7uhYJTOfJvsQN0REkYtt9/Ixwtsoph4 0xIeZIENHXFRwRq2DSLN+k6Tj7gRTaKjFiqJyWlTrwdohJ7RaXdX2L2Mlf2+t4kapQQe NuoAUOB55aUyfFjIB8rFNafc4fvPOwB9BH26dGxpaCJXXJfYugAQMqRkHkIkGsG8oVzT IgpjIBsbP642onB/Sql+I+W1RWK1Z1UIo1pRL5+mYgWYWzEikj6AXj2Yzca14luTvVh2 YFeW2YCWEXLD5M1VfZth1aJMkyRRQP3Wni6cgVivuRCwzS1BtqH5DZM8rPmprXejRkw2 o7VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:to:cc :content-transfer-encoding:message-id:mime-version; bh=kKs7hf6RlDAxhc/L2xkJDbLwKKmZzstAlhN4AK1SxNk=; b=6jNvHMqNx5RluVANzY4VUjoFLTBkyfWE8hnuEkf9CbCEqZiia2+Jqd9zfVEanFOoZX Ah9+CYRszCAF6riwEr5IDthzjYzSAR5AO84FD0CTGNJgwUpgTDfh+o98kmAbdWiyJ5qF uTBso4ZXgGdTV0UPVLVPaww3Ll/F4ViQ9ALQq40a4aahVIRwy1E0Jc45o05unMARAVAf pLXxR9OGifaQIAw/ur9jSiSBnbjEGpdNCDjui6dJUmv+UISwjBq/cFtOE63cXUQ6ZpeB ChP4hp2k1qB0qC0Smn53MhJPEPn5SrhDDCUcsccrrSbFi40l1KgQSF/ZKkhbAAZqk/jV /joQ== X-Gm-Message-State: AOAM532qQxabbgHtCdPZF/4nZecu0dBWFk9SsYZ/LT2YlNT25y7dYJr3 ByweW56/hBGDtWvVN9aSyKw= X-Google-Smtp-Source: ABdhPJynHJumCW938QgNAVfQ8gzhJhIeyTbL1zjpmDzc6V87uIw5uhcGOIYDl2TXTZLoN5uDZ6rovw== X-Received: by 2002:a05:600c:34ca:: with SMTP id d10mr8167782wmq.133.1641493457593; Thu, 06 Jan 2022 10:24:17 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id b17sm2693311wrq.91.2022.01.06.10.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 10:24:17 -0800 (PST) From: Liliana Marie Prikler Date: Thu, 30 Dec 2021 02:38:39 -0500 Content-Transfer-Encoding: 8bit Message-ID: <5bf0071bdbe1d0a7daa08dc35e6a96c46dafdada.camel@gmail.com> MIME-Version: 1.0 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=1641493513; 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=kKs7hf6RlDAxhc/L2xkJDbLwKKmZzstAlhN4AK1SxNk=; b=mHxDiq7yI/xiMySf2v9STwLMFhBQtOPq7cTgPt+8Kd8U0/O8aOLzybRFGc+C7KyIiPukqk guv+dGb444DuYka23yekF9aOhosBEfWmvSx3O4x2ExSo/xIiKLC2hlOUXpYTmUc0Bd4Uhy ru4BVq2S/Bv7VAjsdkUs8R/KR60vb5ow2ODtQnUJ6tZIMVddhVKOBdMWidLY5bzspY79gb /jVVGCu+eW6jbHNq3WrY+3xNq3YfSCUdT9nhI6CdZ5yim6BjyqvXm932hYCKDhbngIQzCQ IBHk1GbPbxPtBomWgUqXHt2/QfsiKkPuqdp9OJsWjmkQY8GkeUNIWvp/ZgQQbg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641493513; a=rsa-sha256; cv=none; b=pA6EbubtR2WFbxavwwP5u4rgVXNMleRTMkWltMN81gqMSr63hx7BFSNfzeMZRRp+5sHGjP 2PLjp7OeS84NA3SBkTO638e/dvQyoBkYkMQJPO7sFhq6MwtliDuvj4tTYW3nvPEcflrfpH x8ktgs2jXLX04zONl1HEW34Hglm9N0v/Z0ylVIWZDaP1sPFCmqIpdUWTIYzfFHYelbtBMu xSxobF/MqHTgXoBzEdToaLBvghlkoNiHkx1kKmBY5efFFGK9zSbB0oxpa6t6gPQ7rM7fWP sqKj2kDUBLyHbPn9/PtsyP0NWU9ra47SkofpN0oZ0CYhnx4njGg4YzqxA4S1mg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="b/G5qgva"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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.80 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="b/G5qgva"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: AA8142FF44 X-Spam-Score: -0.80 X-Migadu-Scanner: scn0.migadu.com X-TUID: f96I9GL2kjb0 Guix does not use any of these lock files to determine the package versions used during the build, so they only serve to cause problems. * guix/build/node-build-system.scm (delete-lockfiles): New variable. (%standard-phases): Add 'delete-lockfiles' after 'patch-dependencies'. Signed-off-by: Liliana Marie Prikler --- guix/build/node-build-system.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm index 70a367618e..2d7a3bdc67 100644 --- a/guix/build/node-build-system.scm +++ b/guix/build/node-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2015 David Thompson ;;; Copyright © 2016, 2020 Jelle Licht ;;; Copyright © 2019, 2021 Timothy Sample +;;; Copyright © 2021 Philip McGrath ;;; ;;; This file is part of GNU Guix. ;;; @@ -96,6 +97,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 +158,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.34.0