[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/42: guix: node-build-system: Add delete-lockfiles phase.
From: |
guix-commits |
Subject: |
01/42: guix: node-build-system: Add delete-lockfiles phase. |
Date: |
Sat, 8 Jan 2022 20:09:20 -0500 (EST) |
lilyp pushed a commit to branch master
in repository guix.
commit 5add4af6fcbb030b0146334d21810d4de18238fb
Author: Philip McGrath <philip@philipmcgrath.com>
AuthorDate: Sat Jan 8 03:41:49 2022 -0500
guix: node-build-system: Add delete-lockfiles phase.
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 <liliana.prikler@gmail.com>
---
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 <davet@gnu.org>
;;; Copyright © 2016, 2020 Jelle Licht <jlicht@fsfe.org>
;;; Copyright © 2019, 2021 Timothy Sample <samplet@ngyro.com>
+;;; Copyright © 2021 Philip McGrath <philip@philipmcgrath.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -96,6 +97,17 @@
(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 @@
(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)
- branch master updated (3e47387805 -> 9d613c36de), guix-commits, 2022/01/08
- 02/42: guix: node-build-system: Add implicit libuv input., guix-commits, 2022/01/08
- 05/42: guix: node-build-system: Add 'delete-dependencies' helper function., guix-commits, 2022/01/08
- 08/42: gnu: node-binary-search-bootstrap: Use 'delete-dependencies'., guix-commits, 2022/01/08
- 09/42: gnu: node-debug-bootstrap: Use 'delete-dependencies'., guix-commits, 2022/01/08
- 10/42: gnu: node-llparse-builder-bootstrap: Use 'delete-dependencies'., guix-commits, 2022/01/08
- 13/42: gnu: node-semver: Use 'delete-dependencies'., guix-commits, 2022/01/08
- 14/42: gnu: node-wrappy: Use 'delete-dependencies'., guix-commits, 2022/01/08
- 01/42: guix: node-build-system: Add delete-lockfiles phase.,
guix-commits <=
- 11/42: gnu: node-llparse-frontend-bootstrap: Use 'delete-dependencies'., guix-commits, 2022/01/08
- 24/42: gnu: Add node-addon-api., guix-commits, 2022/01/08
- 28/42: gnu: Add node-segfault-handler., guix-commits, 2022/01/08
- 26/42: gnu: Add node-file-uri-to-path., guix-commits, 2022/01/08
- 29/42: gnu: Add node-ms., guix-commits, 2022/01/08
- 31/42: gnu: Add node-serialport-binding-abstract., guix-commits, 2022/01/08
- 32/42: gnu: Add node-serialport-parser-delimiter., guix-commits, 2022/01/08
- 04/42: guix: node-build-system: Add avoid-node-gyp-rebuild phase., guix-commits, 2022/01/08
- 03/42: guix: node-build-system: Add JSON utilities., guix-commits, 2022/01/08
- 06/42: gnu: node-semver-bootstrap: Use 'delete-dependencies'., guix-commits, 2022/01/08