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.
			
			
This commit is contained in:
		
							parent
							
								
									63500cbbee
								
							
						
					
					
						commit
						9fad6067d9
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -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)))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue