gexp: Inline bug-fix in 'compiled-modules'.

This is a followup to 5d669883ec.

* guix/gexp.scm (compiled-modules)[build-utils-hack?]: Remove.
Inline everything as if BUILD-UTILS-HACK? is true.
This commit is contained in:
Ludovic Courtès 2018-07-27 00:02:00 +02:00
parent 8c7bebd6ea
commit 4a42abc52c
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 23 additions and 43 deletions

View File

@ -1195,14 +1195,6 @@ corresponding to MODULES. All the MODULES are built in a context where
they can refer to each other." they can refer to each other."
(define total (length modules)) (define total (length modules))
(define build-utils-hack?
;; To avoid a full rebuild, we limit the fix below to the case where
;; MODULE-PATH is different from %LOAD-PATH. This happens when building
;; modules for 'compute-guix-derivation' upon 'guix pull'. TODO: Make
;; this unconditional on the next rebuild cycle.
(and (member '(guix build utils) modules)
(not (equal? module-path %load-path))))
(mlet %store-monad ((modules (imported-modules modules (mlet %store-monad ((modules (imported-modules modules
#:system system #:system system
#:guile guile #:guile guile
@ -1248,19 +1240,12 @@ they can refer to each other."
(setvbuf (current-output-port) (setvbuf (current-output-port)
(cond-expand (guile-2.2 'line) (else _IOLBF))) (cond-expand (guile-2.2 'line) (else _IOLBF)))
(ungexp-splicing (define mkdir-p
(if build-utils-hack?
(gexp ((define mkdir-p
;; Capture 'mkdir-p'. ;; Capture 'mkdir-p'.
(@ (guix build utils) mkdir-p)))) (@ (guix build utils) mkdir-p))
'()))
;; Add EXTENSIONS to the search path. ;; Add EXTENSIONS to the search path.
;; TODO: Remove the outer 'ungexp-splicing' on the next rebuild cycle. (set! %load-path
(ungexp-splicing
(if (null? extensions)
'()
(gexp ((set! %load-path
(append (map (lambda (extension) (append (map (lambda (extension)
(string-append extension (string-append extension
"/share/guile/site/" "/share/guile/site/"
@ -1273,21 +1258,16 @@ they can refer to each other."
(effective-version) (effective-version)
"/site-ccache")) "/site-ccache"))
'((ungexp-native-splicing extensions))) '((ungexp-native-splicing extensions)))
%load-compiled-path)))))) %load-compiled-path))
(set! %load-path (cons (ungexp modules) %load-path)) (set! %load-path (cons (ungexp modules) %load-path))
(ungexp-splicing ;; Above we loaded our own (guix build utils) but now we may need to
(if build-utils-hack? ;; load a compile a different one. Thus, force a reload.
;; Above we loaded our own (guix build utils) but now we may (let ((utils (string-append (ungexp modules)
;; need to load a compile a different one. Thus, force a "/guix/build/utils.scm")))
;; reload.
(gexp ((let ((utils (ungexp
(file-append modules
"/guix/build/utils.scm"))))
(when (file-exists? utils) (when (file-exists? utils)
(load utils))))) (load utils)))
'()))
(mkdir (ungexp output)) (mkdir (ungexp output))
(chdir (ungexp modules)) (chdir (ungexp modules))