aboutsummaryrefslogtreecommitdiff
path: root/guix/transformations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-01-05 19:29:50 +0100
committerLudovic Courtès <ludo@gnu.org>2022-01-11 20:34:59 +0100
commit0552dcb294bbfed76d7a495f5e368c53f20b852a (patch)
tree9e6c02128719eb15ca8eb3a76aad66f811942a04 /guix/transformations.scm
parent6128c274786fc0c109c0c4ce257e5d8b01ac86c3 (diff)
downloadguix-0552dcb294bbfed76d7a495f5e368c53f20b852a.tar
guix-0552dcb294bbfed76d7a495f5e368c53f20b852a.tar.gz
shell: Cache profiles even when using package specs.
This enables profile caching not just when '-m' or '-f' is used, but also when package specs are passed on the command line, as in: guix shell -D guix git It also changes profile cache keys to include the system type, which was previously ignored. * guix/scripts/shell.scm (options-with-caching)[single-file-for-caching]: Remove. Call 'profile-cached-gc-root' instead; adjust to accept two values. (profile-cache-primary-key): New procedure. (profile-cache-key): Remove. (profile-file-cache-key, profile-spec-cache-key): New procedures. (profile-cached-gc-root): Rewrite to include functionality formally in 'single-file-for-caching', but extend to handle package specs. * gnu/packages.scm (cache-is-authoritative?): Export. * guix/transformations.scm (transformation-option-key?): New procedure. * doc/guix.texi (Invoking guix shell): Move '--rebuild-cache' documentation to the bottom, just above '--root'. Explain caching and how these two options relate to that.
Diffstat (limited to 'guix/transformations.scm')
-rw-r--r--guix/transformations.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/transformations.scm b/guix/transformations.scm
index c43c00cdd3..0976f0d824 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -56,6 +56,7 @@
tuned-package
show-transformation-options-help
+ transformation-option-key?
%transformation-options))
;;; Commentary:
@@ -796,6 +797,12 @@ are replaced by their latest upstream version."
(and (eq? k key) proc)))
%transformations))
+(define (transformation-option-key? key)
+ "Return true if KEY is an option key (as returned while parsing options with
+%TRANSFORMATION-OPTIONS) corresponding to a package transformation option.
+For example, (transformation-option-key? 'with-input) => #t."
+ (->bool (transformation-procedure key)))
+
;;;
;;; Command-line handling.