From a4a3fe08c1dc51af6deb76df98e45251b5a866aa Mon Sep 17 00:00:00 2001 From: Jelle Licht Date: Mon, 16 Mar 2026 15:45:49 +0100 Subject: [PATCH] Revert "build-system: node: Rewrite modify-json." This reverts commit dff01d4eb12016435b8fb8878294b79b25b3bf4a. The #:file keyword argument was still part of the rest arguments, which lead to custom file arguments being called as functions due to the `apply compose'. Change-Id: I91d6b576adb7ebb5af6a584e999248b5cc410f6a --- guix/build/node-build-system.scm | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm index 8c59ec086a..f1e9d00b5f 100644 --- a/guix/build/node-build-system.scm +++ b/guix/build/node-build-system.scm @@ -55,11 +55,24 @@ to be written as json to the replacement FILE." (lambda (in out) (scm->json (proc (json->scm in)) out)))) -(define* (modify-json #:key (file "package.json") #:rest modifications) +(define* (modify-json #:key (file "package.json") #:rest all-arguments) "Provide package.json modifying callbacks such as (delete-dependencies ...)" - (with-atomic-json-file-replacement - (apply compose modifications) - file)) + (let + ( + (modifications + (let loop ((arguments all-arguments)) + (cond + ((null? arguments) '()) + ((keyword? (car arguments)) (loop (cddr arguments))) + (else (cons (car arguments) (loop (cdr arguments)))))))) + (with-atomic-json-file-replacement + (lambda (package) + (fold + (lambda (modification package) + (modification package)) + package + modifications)) + file))) (define (delete-dependencies dependencies-to-remove) "Rewrite 'package.json' to allow the build to proceed without packages