Subject: bug#43332: closed (Re: [bug#43332] [PATCH] build-system: linux-module: Delete some huge items that we probably don't need.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 14 Sep 2020 08:32:02 +0000

Your bug report

#43332: [PATCH] build-system: linux-module: Delete some huge items that we probably don't need.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
43332: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43332
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#43332] [PATCH] build-system: linux-module: Delete some huge items that we probably don't need.
From: Danny Milosavljevic <[email-masked]>
To: Ludovic Courtès <[email-masked]>
Cc: [email-masked]
Date: Mon, 14 Sep 2020 10:30:51 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Pushed v2 to guix master as commit 2be5c2652a5fd79089048905ff6be60d74244d7b.

Subject: [PATCH] build-system: linux-module: Delete some huge items that we probably don't need.
From: Danny Milosavljevic <[email-masked]>
To: [email-masked]
Cc: Danny Milosavljevic <[email-masked]>
Date: Fri, 11 Sep 2020 13:07:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* guix/build-system/linux-module.scm (make-linux-module-builder): Delete
some huge items that we probably don't need.
---
 guix/build-system/linux-module.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm
index 1077215671..ba47817596 100644
--- a/guix/build-system/linux-module.scm
+++ b/guix/build-system/linux-module.scm
@@ -68,9 +68,27 @@
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((out (assoc-ref outputs "out"))
                      (out-lib-build (string-append out "/lib/modules/build")))
+                ;; Delete some huge items that we probably don't need.
                 ;; TODO: Only preserve the minimum, i.e. [Kbuild], Kconfig,
                 ;; scripts, include, ".config".
                 (copy-recursively "." out-lib-build)
+                (for-each
+                 (lambda (name)
+                   (if (file-exists? name)
+                       (delete-file-recursively name)))
+                 (map
+                  (lambda (name)
+                    (string-append out-lib-build "/" name))
+                  '(;"arch" ; 137 MB ; Note: "scripts/dtc" depends on "arch".
+                    ;"tools" ; 44 MB ; Note: is built by our 'build phase.
+                    "tools/testing" ; 14 MB
+                    "tools/perf" ; 17 MB
+                    "drivers" ; 600 MB
+                    "Documentation" ; 52 MB
+                    "fs" ; 43 MB
+                    "net" ; 33 MB
+                    "samples" ; 2 MB
+                    "sound"))) ; 40 MB
                 (let* ((linux (assoc-ref inputs "linux")))
                   (install-file (string-append linux "/System.map")
                                 out-lib-build)