gexp: Remove #:pre-load-modules? parameter.
* guix/gexp.scm (gexp->derivation): Remove #:pre-load-modules?. (compiled-modules): Likewise. Inline the case correspoding to PRE-LOAD-MODULES? = #t. * guix/packages.scm (patch-and-repack): Remove #:pre-load-modules?.
This commit is contained in:
		
							parent
							
								
									1380be3c73
								
							
						
					
					
						commit
						3c6b9fb5d2
					
				
					 2 changed files with 24 additions and 47 deletions
				
			
		| 
						 | 
				
			
			@ -633,12 +633,6 @@ names and file names suitable for the #:allowed-references argument to
 | 
			
		|||
                           leaked-env-vars
 | 
			
		||||
                           local-build? (substitutable? #t)
 | 
			
		||||
                           (properties '())
 | 
			
		||||
 | 
			
		||||
                           ;; TODO: This parameter is transitional; it's here
 | 
			
		||||
                           ;; to avoid a full rebuild.  Remove it on the next
 | 
			
		||||
                           ;; rebuild cycle.
 | 
			
		||||
                           (pre-load-modules? #t)
 | 
			
		||||
 | 
			
		||||
                           deprecation-warnings
 | 
			
		||||
                           (script-name (string-append name "-builder")))
 | 
			
		||||
  "Return a derivation NAME that runs EXP (a gexp) with GUILE-FOR-BUILD (a
 | 
			
		||||
| 
						 | 
				
			
			@ -743,8 +737,6 @@ The other arguments are as for 'derivation'."
 | 
			
		|||
                                                       #:module-path module-path
 | 
			
		||||
                                                       #:extensions extensions
 | 
			
		||||
                                                       #:guile guile-for-build
 | 
			
		||||
                                                       #:pre-load-modules?
 | 
			
		||||
                                                       pre-load-modules?
 | 
			
		||||
                                                       #:deprecation-warnings
 | 
			
		||||
                                                       deprecation-warnings)
 | 
			
		||||
                                     (return #f)))
 | 
			
		||||
| 
						 | 
				
			
			@ -1220,11 +1212,7 @@ last one is created from the given <scheme-file> object."
 | 
			
		|||
                           (guile (%guile-for-build))
 | 
			
		||||
                           (module-path %load-path)
 | 
			
		||||
                           (extensions '())
 | 
			
		||||
                           (deprecation-warnings #f)
 | 
			
		||||
 | 
			
		||||
                           ;; TODO: This flag is here to prevent a full
 | 
			
		||||
                           ;; rebuild.  Remove it on the next rebuild cycle.
 | 
			
		||||
                           (pre-load-modules? #t))
 | 
			
		||||
                           (deprecation-warnings #f))
 | 
			
		||||
  "Return a derivation that builds a tree containing the `.go' files
 | 
			
		||||
corresponding to MODULES.  All the MODULES are built in a context where
 | 
			
		||||
they can refer to each other."
 | 
			
		||||
| 
						 | 
				
			
			@ -1257,11 +1245,8 @@ they can refer to each other."
 | 
			
		|||
               (let* ((base   (basename entry ".scm"))
 | 
			
		||||
                      (output (string-append output "/" base ".go")))
 | 
			
		||||
                 (format #t "[~2@a/~2@a] Compiling '~a'...~%"
 | 
			
		||||
                         (+ 1 processed
 | 
			
		||||
                              (ungexp-splicing (if pre-load-modules?
 | 
			
		||||
                                                   (gexp ((ungexp total)))
 | 
			
		||||
                                                   (gexp ()))))
 | 
			
		||||
                         (ungexp (* total (if pre-load-modules? 2 1)))
 | 
			
		||||
                         (+ 1 processed (ungexp total))
 | 
			
		||||
                         (ungexp (* total 2))
 | 
			
		||||
                         entry)
 | 
			
		||||
                 (compile-file entry
 | 
			
		||||
                               #:output-file output
 | 
			
		||||
| 
						 | 
				
			
			@ -1275,6 +1260,26 @@ they can refer to each other."
 | 
			
		|||
                   processed
 | 
			
		||||
                   entries)))
 | 
			
		||||
 | 
			
		||||
         (define* (load-from-directory directory
 | 
			
		||||
                                       #:optional (loaded 0))
 | 
			
		||||
           "Load all the source files found in DIRECTORY."
 | 
			
		||||
           ;; XXX: This works around <https://bugs.gnu.org/15602>.
 | 
			
		||||
           (let ((entries (map (cut string-append directory "/" <>)
 | 
			
		||||
                               (scandir directory regular?))))
 | 
			
		||||
             (fold (lambda (file loaded)
 | 
			
		||||
                     (if (file-is-directory? file)
 | 
			
		||||
                         (load-from-directory file loaded)
 | 
			
		||||
                         (begin
 | 
			
		||||
                           (format #t "[~2@a/~2@a] Loading '~a'...~%"
 | 
			
		||||
                                   (+ 1 loaded) (ungexp (* 2 total))
 | 
			
		||||
                                   file)
 | 
			
		||||
                           (save-module-excursion
 | 
			
		||||
                            (lambda ()
 | 
			
		||||
                              (primitive-load file)))
 | 
			
		||||
                           (+ 1 loaded))))
 | 
			
		||||
                   loaded
 | 
			
		||||
                   entries)))
 | 
			
		||||
 | 
			
		||||
         (setvbuf (current-output-port)
 | 
			
		||||
                  (cond-expand (guile-2.2 'line) (else _IOLBF)))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1310,32 +1315,7 @@ they can refer to each other."
 | 
			
		|||
         (mkdir (ungexp output))
 | 
			
		||||
         (chdir (ungexp modules))
 | 
			
		||||
 | 
			
		||||
         (ungexp-splicing
 | 
			
		||||
          (if pre-load-modules?
 | 
			
		||||
              (gexp ((define* (load-from-directory directory
 | 
			
		||||
                                                   #:optional (loaded 0))
 | 
			
		||||
                       "Load all the source files found in DIRECTORY."
 | 
			
		||||
                       ;; XXX: This works around <https://bugs.gnu.org/15602>.
 | 
			
		||||
                       (let ((entries (map (cut string-append directory "/" <>)
 | 
			
		||||
                                           (scandir directory regular?))))
 | 
			
		||||
                         (fold (lambda (file loaded)
 | 
			
		||||
                                 (if (file-is-directory? file)
 | 
			
		||||
                                     (load-from-directory file loaded)
 | 
			
		||||
                                     (begin
 | 
			
		||||
                                       (format #t "[~2@a/~2@a] Loading '~a'...~%"
 | 
			
		||||
                                               (+ 1 loaded)
 | 
			
		||||
                                               (ungexp (* 2 total))
 | 
			
		||||
                                               file)
 | 
			
		||||
                                       (save-module-excursion
 | 
			
		||||
                                        (lambda ()
 | 
			
		||||
                                          (primitive-load file)))
 | 
			
		||||
                                       (+ 1 loaded))))
 | 
			
		||||
                               loaded
 | 
			
		||||
                               entries)))
 | 
			
		||||
 | 
			
		||||
                     (load-from-directory ".")))
 | 
			
		||||
              (gexp ())))
 | 
			
		||||
 | 
			
		||||
         (load-from-directory ".")
 | 
			
		||||
         (process-directory "." (ungexp output) 0))))
 | 
			
		||||
 | 
			
		||||
    ;; TODO: Pass MODULES as an environment variable.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -642,9 +642,6 @@ specifies modules in scope when evaluating SNIPPET."
 | 
			
		|||
 | 
			
		||||
    (let ((name (tarxz-name original-file-name)))
 | 
			
		||||
      (gexp->derivation name build
 | 
			
		||||
                        ;; TODO: Remove this on the next rebuild cycle.
 | 
			
		||||
                        #:pre-load-modules? #f
 | 
			
		||||
 | 
			
		||||
                        #:graft? #f
 | 
			
		||||
                        #:system system
 | 
			
		||||
                        #:deprecation-warnings #t ;to avoid a rebuild
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue