summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-10-27 22:32:09 +0100
committerLudovic Courtès <ludo@gnu.org>2019-10-27 23:05:00 +0100
commit5166d027308f4cf694f5cff1c0670b6ff622c226 (patch)
treeaf20f5ccc6dea8147786f8065e03a471c3b0602b /gnu/packages
parentd727a9343d861cf775645df8be5bfefd43d6c6f0 (diff)
gnu: bootstrap: 'bootstrap-origin' preserves eq?-ness when no changes are made.
This reduces the number of lookups in the 'add-data-to-store' cache from 2743 to 2705 (hit rate: 11% to 10%) when running GUIX_PROFILING=add-data-to-store-cache guix build libreoffice -nd The execution time of "guix build libreoffice -nd" goes from 1.80s to 1.78s. * gnu/packages/bootstrap.scm (bootstrap-origin): Return SOURCE unchanged when its has no patches and no snippet.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/bootstrap.scm29
1 files changed, 16 insertions, 13 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index ee713db0cff..363c99c7c38 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -167,19 +167,22 @@ for system '~a'")
167 ("patch" ,%bootstrap-coreutils&co))) 167 ("patch" ,%bootstrap-coreutils&co)))
168 168
169 (let ((orig-method (origin-method source))) 169 (let ((orig-method (origin-method source)))
170 (origin (inherit source) 170 (if (or (not (null? (origin-patches source)))
171 (method (cond ((eq? orig-method url-fetch) 171 (origin-snippet source))
172 (boot url-fetch)) 172 (origin (inherit source)
173 (else orig-method))) 173 (method (if (eq? orig-method url-fetch)
174 (patch-guile %bootstrap-guile) 174 (boot url-fetch)
175 (patch-inputs %bootstrap-patch-inputs) 175 orig-method))
176 176 (patch-guile %bootstrap-guile)
177 ;; Patches can be origins as well, so process them. 177 (patch-inputs %bootstrap-patch-inputs)
178 (patches (map (match-lambda 178
179 ((? origin? patch) 179 ;; Patches can be origins as well, so process them.
180 (bootstrap-origin patch)) 180 (patches (map (match-lambda
181 (patch patch)) 181 ((? origin? patch)
182 (origin-patches source)))))) 182 (bootstrap-origin patch))
183 (patch patch))
184 (origin-patches source))))
185 source)))
183 186
184(define* (package-from-tarball name source program-to-test description 187(define* (package-from-tarball name source program-to-test description
185 #:key snippet) 188 #:key snippet)