mirror of
git://git.savannah.gnu.org/guix.git
synced 2023-12-14 03:33:07 +01:00
gnu: Go 1.11: Avoid unnecessary store references.
This shrinks the closure of Go 1.11 from 1379 MiB to 581 MiB. Fixes <https://bugs.gnu.org/32949>. * gnu/packages/golang.scm (go-1.11)[arguments]: Add a 'delete-extraneous-files' phase.
This commit is contained in:
parent
7571ec3576
commit
b3325eb306
|
@ -510,12 +510,23 @@ in the style of communicating sequential processes (@dfn{CSP}).")
|
||||||
(substitute* (find-files "cmd" "\\.go")
|
(substitute* (find-files "cmd" "\\.go")
|
||||||
(("/lib(64)?/ld-linux.*\\.so\\.[0-9]") loader))
|
(("/lib(64)?/ld-linux.*\\.so\\.[0-9]") loader))
|
||||||
#t)))
|
#t)))
|
||||||
|
;; Prevent installation of the build cache, which contains store
|
||||||
|
;; references to most of the tools used to build Go and would
|
||||||
|
;; unnecessarily increase the size of Go's closure if it was
|
||||||
|
;; installed.
|
||||||
|
;; TODO This should be moved into the 'install' phase when Go 1.9 is
|
||||||
|
;; removed.
|
||||||
|
(add-before 'install 'delete-extraneous-files
|
||||||
|
(lambda _
|
||||||
|
(delete-file-recursively "../pkg/obj")
|
||||||
|
#t))
|
||||||
(replace 'set-bootstrap-variables
|
(replace 'set-bootstrap-variables
|
||||||
(lambda* (#:key outputs inputs #:allow-other-keys)
|
(lambda* (#:key outputs inputs #:allow-other-keys)
|
||||||
;; Tell the build system where to find the bootstrap Go.
|
;; Tell the build system where to find the bootstrap Go.
|
||||||
(let ((go (assoc-ref inputs "go")))
|
(let ((go (assoc-ref inputs "go")))
|
||||||
(setenv "GOROOT_BOOTSTRAP" go)
|
(setenv "GOROOT_BOOTSTRAP" go)
|
||||||
(setenv "GOGC" "400"))))))))))
|
(setenv "GOGC" "400")
|
||||||
|
#t)))))))))
|
||||||
|
|
||||||
(define-public go go-1.9)
|
(define-public go go-1.9)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue