diff options
author | Arun Isaac | 2024-10-27 03:15:57 +0000 |
---|---|---|
committer | Arun Isaac | 2024-11-06 00:37:10 +0000 |
commit | 720384b5f135ad008ae6abf68079d203f58a28dc (patch) | |
tree | b2ae7f3790bce7441d6de93fe14bd4a88955081c | |
parent | 1beff9ccc0e46da496c7b9c828f9425861e3416d (diff) | |
download | ravanan-720384b5f135ad008ae6abf68079d203f58a28dc.tar.gz ravanan-720384b5f135ad008ae6abf68079d203f58a28dc.tar.lz ravanan-720384b5f135ad008ae6abf68079d203f58a28dc.zip |
command-line-tool: Implement WorkReuse.
*
ravanan/command-line-tool.scm (%command-line-tool-supported-requirements):
Add WorkReuse.
* ravanan/command-line-tool.scm (build-command-line-tool-script):
Implement WorkReuse.
-rw-r--r-- | ravanan/command-line-tool.scm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm index 250f5b2..da585d8 100644 --- a/ravanan/command-line-tool.scm +++ b/ravanan/command-line-tool.scm @@ -73,7 +73,8 @@ "InlineJavascriptRequirement" "InitialWorkDirRequirement" "ResourceRequirement" - "SoftwareRequirement")) + "SoftwareRequirement" + "WorkReuse")) (define (command-line-tool-supported-requirements batch-system) (cond @@ -722,13 +723,23 @@ named @var{name} with @var{inputs} using tools from Guix manifest in (check-requirements requirements batch-system command-line-tool-supported-requirements - %command-line-tool-supported-requirements)) + %command-line-tool-supported-requirements) + ;; Error out if WorkReuse is disabled. + (maybe-let* ((work-reuse (find-requirement requirements "WorkReuse"))) + (and (not (coerce-type (assoc-ref* work-reuse "enableReuse") + 'boolean)) + (user-error "Disabling WorkReuse is not supported. ravanan's strong caching using Guix makes it unnecessary.")))) (maybe-let* ((hints (maybe-assoc-ref (just cwl) "hints"))) (check-requirements hints batch-system command-line-tool-supported-requirements %command-line-tool-supported-requirements - #t)) + #t) + ;; Warn if WorkReuse is disabled. + (maybe-let* ((work-reuse (find-requirement hints "WorkReuse"))) + (and (not (coerce-type (assoc-ref* work-reuse "enableReuse") + 'boolean)) + (warning "Ignoring disable of WorkReuse. ravanan's strong caching using Guix makes it unnecessary.")))) ;; Copy input files and update corresponding input objects. (build-gexp-script name (let* ((requirements (inherit-requirements (or (assoc-ref cwl "requirements") |