me
/
guix
Archived
1
0
Fork 0

environment: Really auto-load (guix scripts pack).

Fixes a performance regression on cache hits introduced in
b31ea797ed, whereby (guix scripts pack)
would be loaded eagerly during startup, leading hundreds of (gnu
packages *) modules to be loaded.

Fixes <https://issues.guix.gnu.org/62899>.

* guix/scripts/environment.scm: Autoload (gnu build install).
(%options): Add indirection when calling 'symlink-spec-option-parser' so
that (guix scripts pack) is auto-loaded only when needed.
master
Ludovic Courtès 2023-04-17 14:32:24 +02:00 committed by Maxim Cournoyer
parent 72096b7330
commit abdf812acc
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 6 additions and 2 deletions

View File

@ -38,7 +38,7 @@
#:autoload (guix scripts pack) (symlink-spec-option-parser) #:autoload (guix scripts pack) (symlink-spec-option-parser)
#:use-module (guix transformations) #:use-module (guix transformations)
#:autoload (ice-9 ftw) (scandir) #:autoload (ice-9 ftw) (scandir)
#:use-module (gnu build install) #:autoload (gnu build install) (evaluate-populate-directive)
#:autoload (gnu build linux-container) (call-with-container %namespaces #:autoload (gnu build linux-container) (call-with-container %namespaces
user-namespace-supported? user-namespace-supported?
unprivileged-user-namespace-supported? unprivileged-user-namespace-supported?
@ -271,7 +271,11 @@ use '--preserve' instead~%"))
(alist-cons 'file-system-mapping (alist-cons 'file-system-mapping
(specification->file-system-mapping arg #f) (specification->file-system-mapping arg #f)
result))) result)))
(option '(#\S "symlink") #t #f symlink-spec-option-parser) (option '(#\S "symlink") #t #f
(lambda (opt name arg result)
;; Delay call to avoid auto-loading (guix scripts pack)
;; when unnecessary.
(symlink-spec-option-parser opt name arg result)))
(option '(#\r "root") #t #f (option '(#\r "root") #t #f
(lambda (opt name arg result) (lambda (opt name arg result)
(alist-cons 'gc-root arg result))) (alist-cons 'gc-root arg result)))