From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SDVpBSgWsWFVCQAAgWs5BA (envelope-from ) for ; Wed, 08 Dec 2021 21:31:36 +0100 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id WHMVASgWsWE3JAAAbx9fmQ (envelope-from ) for ; Wed, 08 Dec 2021 20:31:36 +0000 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 aspmx2.migadu.com (Postfix) with ESMTPS id B15392D7FF for ; Wed, 8 Dec 2021 21:31:35 +0100 (CET) Received: from localhost ([::1]:49412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mv3bB-0001M3-O6 for larch@yhetil.org; Wed, 08 Dec 2021 15:31:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv3a0-0006lr-3y for guix-patches@gnu.org; Wed, 08 Dec 2021 15:30:21 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mv3Zq-0000RM-5k for guix-patches@gnu.org; Wed, 08 Dec 2021 15:30:19 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mv3Zq-00060Y-2a for guix-patches@gnu.org; Wed, 08 Dec 2021 15:30:10 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v3 20/43] guix: node-build-system: Add delete-lockfiles phase. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Dec 2021 20:30:10 +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 Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.163899536222692 (code B ref 51838); Wed, 08 Dec 2021 20:30:10 +0000 Received: (at 51838) by debbugs.gnu.org; 8 Dec 2021 20:29:22 +0000 Received: from localhost ([127.0.0.1]:41605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv3Z3-0005tp-H0 for submit@debbugs.gnu.org; Wed, 08 Dec 2021 15:29:21 -0500 Received: from mail-ua1-f41.google.com ([209.85.222.41]:44638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv3Yq-0005pf-G9 for 51838@debbugs.gnu.org; Wed, 08 Dec 2021 15:29:15 -0500 Received: by mail-ua1-f41.google.com with SMTP id p2so6851394uad.11 for <51838@debbugs.gnu.org>; Wed, 08 Dec 2021 12:29:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=GmQf+3nyLP4yk1qa1kKSk5fMjvztBAE12UbCFxQNkvY=; b=h9IolEJnWkmuHo/bCQbPmsSBo5X/7BndU8II0cCMyki42VSeIikQCNgNSMDV1e7T09 z6LuaYH+XSE8lAqLx8ehdfaA7LXAzlWM8aqlVZcaVcMxE1gzS0YRqvEsWlFtMfWJCsdM Nb8lyoxMT2w0OIKlTRVl8LESMi+OlPYKYPpGkdmY0D4Trr8Rvbo6BJ3nb/3BU24eUa0j 0vLBd0JCIC/ITvuPoyJULSn8lJXdriBiRGkUn1R4QVJzIzkTKpc7P6YGVHQ0t+Ptrp/f MGLZdqDYsPsDCu/5Lvi9DjeBQzBbltx1eHVZDHYHiCTYRnBYtmUpNFeDZBipse24k/3s T31w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GmQf+3nyLP4yk1qa1kKSk5fMjvztBAE12UbCFxQNkvY=; b=o1Czd+SKkp/qAyNlI4cZthugL9OUiCpeF/irmmcI7JYL3aeVp8Tf0f/neUf8ugdc5d 1eF2X3FvFct/ceMGLUnu+hZXl/u++VK7VGNqO/dNztUdq07i7xJPeB2eO0ezg+zJxRSW +v1ab4QTiLGP4Jk0E9xn1RB1y7hKgtOSyfouImBCzcSy2luc5Hq1mXoX7wBrd763Ard1 WMUAwYCb7dQJiYtOJq2VKQSD7WKv+dLdufqy1eAJsmybc9oVyVbOa0BbJVx1wabEDShg eJBY5LoN75q4XEt3LDV3VF/6fWLv8sY8SrVW6w4HePpQueJejRoYMumPF3OGaVxqGNC5 evBg== X-Gm-Message-State: AOAM532CXFd3XLPvn6M6VAFZWbIVhvXBhRGC7op6aZEnQhqGGi+HWXOB hnJkAJ+MIYyRSUh/UKqhTOc0gHjWjfnKGaczbzU= X-Google-Smtp-Source: ABdhPJylVEkCxiJqA6C1ioMt9LJ91O4WD29rIEnyC526CdRzM2/QpEhu63BQ/q48KdB58g3Na2dJJA== X-Received: by 2002:a9f:2c4a:: with SMTP id s10mr11151294uaj.50.1638995341962; Wed, 08 Dec 2021 12:29:01 -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 q26sm2648089vsp.23.2021.12.08.12.29.01 for <51838@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Dec 2021 12:29:01 -0800 (PST) From: Philip McGrath Date: Wed, 8 Dec 2021 15:28:15 -0500 Message-Id: <20211208202838.752542-21-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211208202838.752542-1-philip@philipmcgrath.com> References: <46a042bc08eb72a068b1e8c69bfe28cf2d4b2e53.camel@gmail.com> <20211208202838.752542-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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638995495; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=GmQf+3nyLP4yk1qa1kKSk5fMjvztBAE12UbCFxQNkvY=; b=eNtTLmUAd7d26pXHx5l6q7F1lqCbybcPo66IX1OcTtMJJd6COiwC/DBgxH1dG1GxXFjhN/ iSIXz3jfjwRUX8CWP4T7FO+uk1QJhb+HpWdoAuNaHblnrBnicdpq0u+ijqOOkMwRFTf7E4 VnpnytQVUvq7WVEs8cz6AKH4dJ013Dan0AHk+srdKL38ldH40HXdI/EcsH/voH3D5SV3mk B2GoBnML3kIqW292eeanZJLypE4rCYVDJvzkWfyyb9Ou2YwyXOqmH+ndY045EHMfrUGL2u aH3vlv1LoDKWdx+jwRNtflTv+gzq6HHf+diCpwpAVDmgyGGEdqZY4x1CkXCjpQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638995495; a=rsa-sha256; cv=none; b=Nu3ANXKNi6eaEggtZAv83BgMFiHne//GzNgEnfjjB4VSuRk2iETEf9MlbqrAy2wSB3Wdqj c9ytRpVComRTnXzT/h+srUn+fjBlbIeP0gftA/4Hud3PKMOn3wawv7jFfOOjxkYnfs/2za 7/Nnc4p5ETOtkgB53dRstnptieTkwrikrKojLny37Jr0Js0mqqL0Qtu1feeEymB3T2h8l+ 6UFABUhaJJOIrvHUlOw9AwlnaapRshtBMSrG3CwvBQqnHKJacHyCqEp4a6kAJZ7mqPYI5H uwLiV+pp9sEX2Etf9RNRCnAG4dIrUGPj/UBNlE5taN7IxZ5spuBwUZ7Ynd6VzA== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=h9IolEJn; dmarc=none; spf=pass (aspmx2.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.45 Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=h9IolEJn; dmarc=none; spf=pass (aspmx2.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: B15392D7FF X-Spam-Score: -0.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: IffdATCh3rPh * 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 dependency both exact versions and integrity hashes, they only cause problems for Guix. (%standard-phases): Add 'delete-lockfiles' after 'patch-dependencies'. --- gnu/packages/node.scm | 12 ------------ guix/build/node-build-system.scm | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index 6d48816c77..5289e2fe4f 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -488,12 +488,6 @@ (define-public node-llparse-builder-bootstrap "typescript") #:phases (modify-phases %standard-phases - (add-before 'configure 'remove-package-lock - ;; Having package-lock.json seems to cause npm - ;; to look for things on the internet in the configure phase, - ;; even if we have them properly installed. - (lambda args - (delete-file-recursively "package-lock.json"))) (replace 'build (lambda* (#:key inputs #:allow-other-keys) (let ((esbuild (string-append (assoc-ref inputs "esbuild") @@ -621,12 +615,6 @@ (define-public node-llparse-bootstrap "typescript") #:phases (modify-phases %standard-phases - (add-before 'configure 'remove-package-lock - ;; Having package-lock.json seems to cause npm - ;; to look for things on the internet in the configure phase, - ;; even if we have them properly installed. - (lambda args - (delete-file-recursively "package-lock.json"))) (replace 'build (lambda* (#:key inputs #:allow-other-keys) (let ((esbuild (string-append (assoc-ref inputs "esbuild") diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm index 249b3deee6..892104b6d2 100644 --- a/guix/build/node-build-system.scm +++ b/guix/build/node-build-system.scm @@ -118,6 +118,17 @@ (define (resolve-dependencies meta-alist 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") @@ -168,6 +179,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