From patchwork Sat Jan 8 08:41:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 36120 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B1F9927BBEA; Sat, 8 Jan 2022 08:46:47 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7310927BBE9 for ; Sat, 8 Jan 2022 08:46:47 +0000 (GMT) Received: from localhost ([::1]:41830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67N8-0003hW-I0 for patchwork@mira.cbaines.net; Sat, 08 Jan 2022 03:46:46 -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 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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)