From cc6a4b03867bc18baf30c0239c3c6dbf0709de7a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Dec 2017 17:16:40 +0100 Subject: pull: Add (guix profiling) to the build environment. Reported by Ricardo Wurmus. * build-aux/build-self.scm (build): Add (guix profiling). --- build-aux/build-self.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'build-aux') diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 6415978839..17d947bec1 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -267,6 +267,7 @@ Please upgrade to an intermediate version first, for instance with: ;; Closure of (guix modules). (guix modules) (guix memoization) + (guix profiling) (guix sets)) ;; Arrange so that our own (guix build …) modules are -- cgit v1.2.3 From 34797d8afc3c5f1211a4baf1161de640fc630a2e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Dec 2017 15:01:07 +0100 Subject: hydra: Invalidate derivation caches after each architecture evaluation. This reduces max RSS from 1.3G to 1.0G. * guix/derivations.scm (invalidate-derivation-caches!): New procedure. * build-aux/hydra/gnu-system.scm (hydra-jobs): Use it. Add 'format' call. --- build-aux/hydra/gnu-system.scm | 7 +++++++ guix/derivations.scm | 10 ++++++++++ 2 files changed, 17 insertions(+) (limited to 'build-aux') diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm index d9b9c55d9c..5aaac5220f 100644 --- a/build-aux/hydra/gnu-system.scm +++ b/build-aux/hydra/gnu-system.scm @@ -334,6 +334,13 @@ valid." (parameterize ((%graft? #f)) ;; Return one job for each package, except bootstrap packages. (append-map (lambda (system) + (format (current-error-port) + "evaluating for '~a' (heap size: ~a MiB)...~%" + system + (round + (/ (assoc-ref (gc-stats) 'heap-size) + (expt 2. 20)))) + (invalidate-derivation-caches!) (case subset ((all) ;; Build everything, including replacements. diff --git a/guix/derivations.scm b/guix/derivations.scm index 38cefb6100..97f96d99c1 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -90,6 +90,7 @@ derivation-path->output-paths derivation raw-derivation + invalidate-derivation-caches! map-derivation @@ -841,6 +842,15 @@ output should not be used." (hash-set! %derivation-cache file drv*) drv*))) +(define (invalidate-derivation-caches!) + "Invalidate internal derivation caches. This is mostly useful for +long-running processes that know what they're doing. Use with care!" + ;; Typically this is meant to be used by Cuirass and Hydra, which can clear + ;; caches when they start evaluating packages for another architecture. + (invalidate-memoization! derivation->bytevector) + (invalidate-memoization! derivation-path->base16-hash) + (hash-clear! %derivation-cache)) + (define* (map-derivation store drv mapping #:key (system (%current-system))) "Given MAPPING, a list of pairs of derivations, return a derivation based on -- cgit v1.2.3 From e2e6e9ebf00d1e37a614a5915019a836def07d99 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 13 Dec 2017 23:09:27 +0100 Subject: hydra: Pre-load the compiler. Starting from Guile 2.2.3, '%fresh-auto-compile' does what it says and would auto-compile everything, including the compiler (see ). * build-aux/hydra/gnu-system.scm: Call 'compile'. --- build-aux/hydra/gnu-system.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'build-aux') diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm index 5aaac5220f..04845a3e1f 100644 --- a/build-aux/hydra/gnu-system.scm +++ b/build-aux/hydra/gnu-system.scm @@ -22,12 +22,14 @@ ;;; tool. ;;; -;; Attempt to use our very own Guix modules. +(use-modules (system base compile)) + (eval-when (compile load eval) - ;; Ignore any available .go, and force recompilation. This is because our - ;; checkout in the store has mtime set to the epoch, and thus .go files look - ;; newer, even though they may not correspond. + ;; Pre-load the compiler so we don't end up auto-compiling it. + (compile #t) + + ;; Use our very own Guix modules. (set! %fresh-auto-compile #t) (and=> (assoc-ref (current-source-location) 'filename) -- cgit v1.2.3