guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: Go 1.11: Avoid unnecessary store references.


From: Leo Famulari
Subject: 01/01: gnu: Go 1.11: Avoid unnecessary store references.
Date: Thu, 1 Nov 2018 23:23:32 -0400 (EDT)

lfam pushed a commit to branch master
in repository guix.

commit b3325eb306b33541edcb343d75d8457624744375
Author: Leo Famulari <address@hidden>
Date:   Thu Nov 1 22:56:38 2018 -0400

    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.
---
 gnu/packages/golang.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 60d3ee7..82e8173 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -510,12 +510,23 @@ in the style of communicating sequential processes 
(@dfn{CSP}).")
                  (substitute* (find-files "cmd" "\\.go")
                    (("/lib(64)?/ld-linux.*\\.so\\.[0-9]") loader))
                  #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
              (lambda* (#:key outputs inputs #:allow-other-keys)
                ;; Tell the build system where to find the bootstrap Go.
                (let ((go  (assoc-ref inputs "go")))
                  (setenv "GOROOT_BOOTSTRAP" go)
-                 (setenv "GOGC" "400"))))))))))
+                 (setenv "GOGC" "400")
+                 #t)))))))))
 
 (define-public go go-1.9)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]