From patchwork Mon Dec 13 06:00:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 35160 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 38D1327BBEA; Mon, 13 Dec 2021 06:03:43 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 024AC27BBE9 for ; Mon, 13 Dec 2021 06:03:43 +0000 (GMT) Received: from localhost ([::1]:40728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mweR4-0001jc-4x for patchwork@mira.cbaines.net; Mon, 13 Dec 2021 01:03:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mweQS-0000qy-A5 for guix-patches@gnu.org; Mon, 13 Dec 2021 01:03:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42160) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mweQS-000753-0m for guix-patches@gnu.org; Mon, 13 Dec 2021 01:03:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mweQR-0002Rg-Ra for guix-patches@gnu.org; Mon, 13 Dec 2021 01:03:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v4 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: Mon, 13 Dec 2021 06:03: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.16393753699301 (code B ref 51838); Mon, 13 Dec 2021 06:03:03 +0000 Received: (at 51838) by debbugs.gnu.org; 13 Dec 2021 06:02:49 +0000 Received: from localhost ([127.0.0.1]:53691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweQC-0002Px-Tp for submit@debbugs.gnu.org; Mon, 13 Dec 2021 01:02:49 -0500 Received: from mail-ua1-f47.google.com ([209.85.222.47]:34612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweQ9-0002PO-GR for 51838@debbugs.gnu.org; Mon, 13 Dec 2021 01:02:46 -0500 Received: by mail-ua1-f47.google.com with SMTP id n6so27363453uak.1 for <51838@debbugs.gnu.org>; Sun, 12 Dec 2021 22:02:45 -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=faFcURG4TQlSAGOUnyB6KLqF0ghBt1qh6ARSUssJYZJv93s5KGtplKVfjLFih4sK+Y I+cz1HWPwSUbEf8r2q0FVIHSOdNTzpplvWXqyyCZ6mcZ2zXEvCqSh/0p7ETDcKojHWCI 94AnRww9m/w/ZImpyrNCjIVlmVeakgvSf1mySYt7PHUXNUwd2Qoc0EKf8qYs7uSWxHfV 5K1tkGnM3r9DnFuE/OIU4dg4xN1qZJ17ybW0+PdMT7XvlHZNtNqo47M+lHp69WRAFRvP Obe9bWDIiCor6byjbIJjLkZRCI6hYEgHMNpHIuYWDApDDqnx6e0JS3JHW28Ph8Ko9b/m eweA== 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=c5OTw80yMsYVAOa87ouUC3nSuy7z335zKCvM+SO53WwyNFIezsbTuKKirQUXgiJF4G RZz0IpyAoDabOqJzS7XjG1H/8DsRFZClB7A8izBu33MVUOQLNvXP1sF7muwFXNT44a9v hVjX0Dp2YLLV7P7ZooQ85uZe5aHRbMOUofLOc2eE4Dwc5mkwJ3fNfFfrcm1ic7qwiZSU BoAl1mZpYo7t8hDPyoV1bPCpefcnICo+A4kFptN4ZkN1WxqSTFftAhTrwIfxhH0BVUL7 0cnr99KHUulrJx/EJAHOvJ+9ak8lGhQzgwI5ZTNI2uv26k740rcVfb3Oc4kDpBOpx7gE vCdA== X-Gm-Message-State: AOAM531QX1pdY+8WNHePl6FInWTGnwZwEx0IJP3yOxC+8g5pVCI9QioR FGdANk2fYyEoHnEPy8dj77I21F8ZlqClnKC3BQ4= X-Google-Smtp-Source: ABdhPJzitM2Gbw7Tf8C7cqQXKV8/u0QsT267thwQQDhtIrB8yWLTrqUU5jdswTZnpyG6J4F8co69zQ== X-Received: by 2002:a67:5fc6:: with SMTP id t189mr24690800vsb.79.1639375360050; Sun, 12 Dec 2021 22:02:40 -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 a26sm3819330vko.54.2021.12.12.22.02.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Dec 2021 22:02:39 -0800 (PST) From: Philip McGrath Date: Mon, 13 Dec 2021 01:00:27 -0500 Message-Id: <20211213060107.129223-6-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211213060107.129223-1-philip@philipmcgrath.com> References: <46a042bc08eb72a068b1e8c69bfe28cf2d4b2e53.camel@gmail.com> <20211208202838.752542-1-philip@philipmcgrath.com> <20211208202838.752542-5-philip@philipmcgrath.com> <877dc924h7.fsf@gmx.com> <5c62c3ce-dd50-5dcd-00ed-ff1524be4e0b@philipmcgrath.com> <20211213060107.129223-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/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)