From 394dca860e767df69562f3e5afa3ec3c588afbaa Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 7 Oct 2024 15:51:48 +0100 Subject: bin: Pass manifest file paths, not manifests to other functions. * bin/ravanan: Move to (ravanan command-line-tool). Add comment about declarative modules. (main): Pass manifest file path to run-workflow. * ravanan/command-line-tool.scm (run-command-line-tool, build-command-line-tool-script): Accept manifest file path instead of manifest. * ravanan/workflow.scm (workflow-scheduler, run-workflow): Accept manifest file path instead of manifest. --- bin/ravanan | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'bin') diff --git a/bin/ravanan b/bin/ravanan index 19bb8b5..cc9005d 100755 --- a/bin/ravanan +++ b/bin/ravanan @@ -97,27 +97,6 @@ files that have the token in the @verbatim{SLURM_JWT=token} format." string-trim-both get-string-all))) -(define (load-manifest manifest-file) - "Load manifest from @var{manifest-file} and return it." - ;; We load the manifest file into a dummy module of its own so that any - ;; definitions from there don't leak out. We also ensure that this dummy - ;; module is different for different manifest files so that definitions from - ;; one manifest file don't leak into other manifest files. - (let ((manifest-file-path (canonicalize-file-name manifest-file)) - (manifest-module (resolve-module (match (file-name-split manifest-file-path) - (("" parts ...) - (map string->symbol parts)))))) - ;; Import modules required for loading manifests. - (for-each (lambda (module-name) - (module-use! manifest-module (resolve-interface module-name))) - '((guile) - (gnu packages) - (guix profiles))) - (save-module-excursion - (lambda () - (set-current-module manifest-module) - (load manifest-file-path))))) - (define main (match-lambda ((program args ...) @@ -151,9 +130,8 @@ files that have the token in the @verbatim{SLURM_JWT=token} format." ;; We must not try to compile guix manifest files. (set! %load-should-auto-compile #f) (scm->json (run-workflow (file-name-stem workflow-file) - (load-manifest - (canonicalize-path - (assq-ref args 'guix-manifest-file))) + (canonicalize-path + (assq-ref args 'guix-manifest-file)) (read-workflow workflow-file) (read-inputs inputs-file) (case (assq-ref args 'batch-system) -- cgit v1.2.3