From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 4JF6HXhP2WGGTAAAgWs5BA (envelope-from ) for ; Sat, 08 Jan 2022 09:46:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MJcFGnhP2WEq5gAAauVa8A (envelope-from ) for ; Sat, 08 Jan 2022 09:46:48 +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 29DE23A758 for ; Sat, 8 Jan 2022 09:46:48 +0100 (CET) Received: from localhost ([::1]:41830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67N9-0003hW-CS for larch@yhetil.org; Sat, 08 Jan 2022 03:46:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n67KV-00028G-58 for guix-patches@gnu.org; Sat, 08 Jan 2022 03:44:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n67KU-00046b-RW for guix-patches@gnu.org; Sat, 08 Jan 2022 03:44:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n67KU-0000it-QE for guix-patches@gnu.org; Sat, 08 Jan 2022 03:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v9 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: Sat, 08 Jan 2022 08:44: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 , Philip McGrath , Pierre Langlois , Liliana Marie Prikler , Leo Famulari , Jelle Licht Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.16416314242725 (code B ref 51838); Sat, 08 Jan 2022 08:44:02 +0000 Received: (at 51838) by debbugs.gnu.org; 8 Jan 2022 08:43:44 +0000 Received: from localhost ([127.0.0.1]:46285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n67KC-0000ht-3H for submit@debbugs.gnu.org; Sat, 08 Jan 2022 03:43:44 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:43879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n67KA-0000hd-HI for 51838@debbugs.gnu.org; Sat, 08 Jan 2022 03:43:43 -0500 Received: by mail-qk1-f172.google.com with SMTP id f138so8473398qke.10 for <51838@debbugs.gnu.org>; Sat, 08 Jan 2022 00:43:42 -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=LdZs1FW3wxcELyyFEiVAVcuSZhVay4HA/ADjYH1bwlU=; b=PiK5/qu570WzQK0r+SDmB8fdd+E/jJq8+5bicwaI+pjB9a96u6yGnfrF0gmz3QUqRC TLs1ARga2Mps8D3MuFg8EP2Lv3qhDwm/sVqYxc/ogXCWvs+7/g51GhvYb4k6jEmuDn5S u6Nji8/Uag2OqxDLTXF5jenmocffgxLKAsQc3sTVHJyzkFLP8Fl193LcA3jNVbVzIfvF Xai9yxlbpq+/m8dPeA4wcLB2VmjSm+HbDoKWdUtBlpm+anAaZV18PJYs/xCG/cHgyVup mTbCcu8m+K8HwrM9ZTBU4pBnMcNhs6voBGtGHad45Pib/mlOD+oiXE2eQx1ylbiTiKn0 TGjQ== 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=LdZs1FW3wxcELyyFEiVAVcuSZhVay4HA/ADjYH1bwlU=; b=3JIlSyAAPSuYMuOg4trBu39oc53z+gH7q/VtKw+AcIswQ4xz2Zdhe5qNiZxUcsQ2X2 KnBUZL7Sg89dsyVyKSH/PKRBdg3hdUCA69JE9Ba1OU8CsO+W4QxDRrm9wpH2IZBiK75R lklShEVik2zUxXobzMX/VxpAbGthF7F3qDJh9FSkQYKt7NAUi2RZL+/D4tL1EUzPrqmH TLxRccJvd6rX/FVx83Xz0S5X+RWu/F3rRRcoP1Fcr/amRJ3qoDqCxFdFEjRNEeLnE5Zx qOdX+onl7QqjS6YP/4bmYRonCE8jqg4VoqRCyeoepsBMh4awQ660C+ahXLC5klH14fTn sjVw== X-Gm-Message-State: AOAM533h3At2vBguzY3cWqlEcTTmkgHoTYX3cgUXdoMtv2EfLijpimDk KSoKEhp0h87Cw8KMFGaeyhpJFRTgkRRUfLmY X-Google-Smtp-Source: ABdhPJwlbsHfl7cNxjB3Z5gAEroXdE+tMj7Thgn6E5pUBezcKXWXIOvZOpqSAAW9q8DR4boUjQFpYQ== X-Received: by 2002:a05:620a:4454:: with SMTP id w20mr47337357qkp.369.1641631416773; Sat, 08 Jan 2022 00:43:36 -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 ay42sm696848qkb.40.2022.01.08.00.43.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Jan 2022 00:43:36 -0800 (PST) From: Philip McGrath Date: Sat, 8 Jan 2022 03:41:49 -0500 Message-Id: <20220108084229.362642-2-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220108084229.362642-1-philip@philipmcgrath.com> References: <64e08d3a1838ed8507f33fae895545372960522f.camel@gmail.com> <7b04af28bbd57c67093ce8f33a648efec89693bd.camel@gmail.com> <441bfeb0-eb6e-81f6-488b-cdf1b09a78ef@philipmcgrath.com> <20220108084229.362642-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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=1641631608; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=LdZs1FW3wxcELyyFEiVAVcuSZhVay4HA/ADjYH1bwlU=; b=m4VdPIHciIB3dMTVcj1EoFs4Iu9n2P5zrIXNuq2sVajAxd5pI5dRB/YK0lF1+NAwnN0ihf 3rbTe6OYyB/M02gvNDcRStW6oJxPFLD6xQeCL2KJblkaYnYGu/Esmls859LUSLyRMLs//L cMoW7KQa5lrQjlwON30YHLqRL/As3RA4CskeMZaUrGtuqbk+aS530h/mydyTDlMW/69slv C4UML7waTTkzE8rUxIfR9+kp8DoXF0XqBXmkFJVpR0PVLxX9st86vKfuRkNZQO08Wl3LPx aEzk3ffHBOu/LSH41b6ofpq7JBmYeg/4rM/kLlT8C9Lva6rjuqMs7bWqRfFq5Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641631608; a=rsa-sha256; cv=none; b=FdWvhgGVE2p78G7pDGm8U6gx3RIKWJgREPeA609zaBGUtrrFg1XXbzDyGhwENM7/SSeY3/ W1vijrHgXKTOeuwPZbulwiMnx2ICWxmYiGsPfLdFOKq8RT33RIZjfnsOpAS5o7nbt0Iyfv KOCxJ73uHycy/BBCu44ShSsLRO75yUce/Chp9Vcn/xMKpPhnda4MtpuJergUJiPYobPToY G5zRT0NMkLsqZe0F2I5uPpQ8/pyzJ2y/CFi59x5IaJO4NocQdhZIlgLjVMxS/wo8X2+Svb LuYP5mlvIB8O6ximdlsGPRPSuE7HvATu6oibhKlzzV1VdoNgeEwsCc69vNjGtA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b="PiK5/qu5"; 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.10 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b="PiK5/qu5"; 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: 29DE23A758 X-Spam-Score: -0.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: FMXQ3+De5vgS 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'. --- 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.32.0