[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
142/184: gnu: make-bootstrap: Memoize GCC variant.
From: |
guix-commits |
Subject: |
142/184: gnu: make-bootstrap: Memoize GCC variant. |
Date: |
Wed, 27 Nov 2019 14:37:16 -0500 (EST) |
kkebreau pushed a commit to branch wip-gnome-updates
in repository guix.
commit 0f5eae8ce67bb30e4d04fe2888ad3c4c5568f5be
Author: Ludovic Courtès <address@hidden>
Date: Sat Nov 9 22:22:39 2019 +0100
gnu: make-bootstrap: Memoize GCC variant.
This reduces the number of nodes in "guix graph guile-static-stripped"
from 165 to 150. Likewise, the hit rate in the 'add-data-to-store'
cache for "guix build guile-static-stripped -nd" goes from 24% to 12%.
* gnu/packages/make-bootstrap.scm (gcc-for-bootstrap): New procedure.
(package-with-relocatable-glibc): Use it.
---
gnu/packages/make-bootstrap.scm | 62 ++++++++++++++++++++++-------------------
1 file changed, 34 insertions(+), 28 deletions(-)
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 4b8387a..4e6be32 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -88,6 +88,39 @@ for `sh' in $PATH, and without nscd, and with static NSS
modules."
;; contain store file names, so the CRC changes at every rebuild.)
(outputs (delete "debug" (package-outputs base))))))
+(define gcc-for-bootstrap
+ (mlambdaq (glibc)
+ "Return a variant of GCC that uses the bootstrap variant of GLIBC."
+ (package
+ (inherit gcc)
+ (outputs '("out")) ;all in one so libgcc_s is easily found
+ (native-search-paths
+ ;; Set CPLUS_INCLUDE_PATH so GCC is able to find the libc
+ ;; C++ headers.
+ (cons (search-path-specification
+ (variable "CPLUS_INCLUDE_PATH")
+ (files '("include")))
+ (package-native-search-paths gcc)))
+ (inputs
+ `( ;; Distinguish the name so we can refer to it below.
+ ("bootstrap-libc" ,(glibc-for-bootstrap glibc))
+ ("libc:static" ,(glibc-for-bootstrap glibc) "static")
+ ,@(package-inputs gcc)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments gcc)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'configure 'treat-glibc-as-system-header
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((libc (assoc-ref inputs "bootstrap-libc")))
+ ;; GCCs build processes requires that the libc
+ ;; we're building against is on the system header
+ ;; search path.
+ (for-each (lambda (var)
+ (setenv var (string-append libc "/include")))
+ '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"))
+ #t))))))))))
+
(define (package-with-relocatable-glibc p)
"Return a variant of P that uses the libc as defined by
`glibc-for-bootstrap'."
@@ -127,34 +160,7 @@ for `sh' in $PATH, and without nscd, and with static NSS
modules."
,@(%final-inputs)))
`(("libc" ,(glibc-for-bootstrap glibc))
("libc:static" ,(glibc-for-bootstrap glibc) "static")
- ("gcc" ,(package (inherit gcc)
- (outputs '("out")) ;all in one so libgcc_s is easily found
- (native-search-paths
- ;; Set CPLUS_INCLUDE_PATH so GCC is able to find the libc
- ;; C++ headers.
- (cons (search-path-specification
- (variable "CPLUS_INCLUDE_PATH")
- (files '("include")))
- (package-native-search-paths gcc)))
- (inputs
- `(;; Distinguish the name so we can refer to it below.
- ("bootstrap-libc" ,(glibc-for-bootstrap glibc))
- ("libc:static" ,(glibc-for-bootstrap glibc) "static")
- ,@(package-inputs gcc)))
- (arguments
- (substitute-keyword-arguments (package-arguments gcc)
- ((#:phases phases)
- `(modify-phases ,phases
- (add-before 'configure 'treat-glibc-as-system-header
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((libc (assoc-ref inputs
"bootstrap-libc")))
- ;; GCCs build processes requires that the libc
- ;; we're building against is on the system
header
- ;; search path.
- (for-each (lambda (var)
- (setenv var (string-append libc
"/include")))
- '("C_INCLUDE_PATH"
"CPLUS_INCLUDE_PATH"))
- #t)))))))))
+ ("gcc" ,(gcc-for-bootstrap glibc))
,@(fold alist-delete (%final-inputs) '("libc" "gcc")))))
(package-with-explicit-inputs p inputs
- 128/184: gnu: miniupnpc: Don't use NAME in source URI., (continued)
- 128/184: gnu: miniupnpc: Don't use NAME in source URI., guix-commits, 2019/11/27
- 148/184: gnu: qtractor: Update to 0.9.11., guix-commits, 2019/11/27
- 147/184: gnu: youtube-dl: Update to 2019.11.05., guix-commits, 2019/11/27
- 124/184: build: Warn about etc/indent-code.el when Emacs is absent., guix-commits, 2019/11/27
- 138/184: services: hpcguix-web: Explicitly import (guix build utils)., guix-commits, 2019/11/27
- 136/184: gnu: perl-class-inspector: Update to 1.36., guix-commits, 2019/11/27
- 125/184: gnu: Add homebank., guix-commits, 2019/11/27
- 135/184: gnu: parcimonie: Update to 0.11.0., guix-commits, 2019/11/27
- 133/184: gnu: fribidi: Fix CVE-2019-18397., guix-commits, 2019/11/27
- 149/184: gnu: fvwm: Don't use NAME in source URI., guix-commits, 2019/11/27
- 142/184: gnu: make-bootstrap: Memoize GCC variant.,
guix-commits <=
- 146/184: gnu: Add artyfx, guix-commits, 2019/11/27
- 140/184: tests: Update references to the now-deprecated 'guile-json' variable., guix-commits, 2019/11/27
- 139/184: services: hpcguix-web: Delete lock files during activation., guix-commits, 2019/11/27
- 152/184: gnu: gegl: Add source URIs., guix-commits, 2019/11/27
- 162/184: gnu: monero: Update to 0.15.0.0., guix-commits, 2019/11/27
- 154/184: gnu: gimp: Update to 2.10.14., guix-commits, 2019/11/27
- 157/184: gnu: faad2: Update to 2.8.6., guix-commits, 2019/11/27
- 161/184: gnu: Remove monero-miniupnpc., guix-commits, 2019/11/27
- 177/184: gnu: qemu: Add upstream patch for failing test., guix-commits, 2019/11/27
- 176/184: gnu: Move numix-theme to gnome-xyz.scm., guix-commits, 2019/11/27