unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 73163@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludovic.courtes@inria.fr>, romain.garbage@inria.fr
Subject: [bug#73163] [PATCH] gnu: openpmix: Do not keep a reference to GCC and other build tools.
Date: Tue, 10 Sep 2024 10:38:07 +0200	[thread overview]
Message-ID: <f670a16f38c31ab3792a8027d61896218d2e103e.1725957459.git.ludo@gnu.org> (raw)

From: Ludovic Courtès <ludovic.courtes@inria.fr>

This reduces the closure of ‘openpmix’ from 297 MiB to 93 MiB.

* gnu/packages/parallel.scm (openpmix)[arguments]: Add #:phases
and #:disallowed-references.

Change-Id: I231c550743e2854e431b8100584bd464695de695
---
 gnu/packages/parallel.scm | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index d5a55a8641..d3ff363cd5 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -52,6 +52,7 @@ (define-module (gnu packages parallel)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages freeipmi)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages maths)
@@ -646,7 +647,28 @@ (define-public openpmix
    (arguments
     (list #:configure-flags
           #~(list (string-append "--with-hwloc="
-                                 (ungexp (this-package-input "hwloc") "lib")))))
+                                 (ungexp (this-package-input "hwloc") "lib")))
+
+          ;; Don't keep a reference to GCC.
+          #:disallowed-references (and (not (%current-target-system))
+                                       (list (canonical-package gcc)))
+
+          #:phases
+          #~(modify-phases %standard-phases
+              (add-before 'configure 'strip-pmix-config-header
+                (lambda _
+                  ;; The 'pmix_info' program prints the 'configure' command
+                  ;; line, compiler absolute file name, etc., which causes it
+                  ;; to keep references to many build-time packages.  Scrub
+                  ;; these.
+                  (substitute* "src/include/pmix_config.h.in"
+                    (("#define PMIX_CONFIGURE_CLI .*")
+                     "#define PMIX_CONFIGURE_CLI \"[scrubbed]\"\n"))
+
+                  (substitute* "configure"
+                    (("PMIX_CC_ABSOLUTE=\"(.*)\"" _ cc)
+                     (string-append "PMIX_CC_ABSOLUTE=\"$(basename \""
+                                    cc "\")\"\n"))))))))
    (inputs (list libevent `(,hwloc "lib")))
    (native-inputs (list perl python))
    (synopsis "PMIx library")

base-commit: 637ca78f513fac15284403c0d3af64492ea832a1
-- 
2.46.0





             reply	other threads:[~2024-09-10  8:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  8:38 Ludovic Courtès [this message]
2024-09-10  8:48 ` [bug#73163] [PATCH v2] gnu: openpmix: Do not keep a reference to GCC and other build tools Ludovic Courtès
2024-09-16  9:17   ` bug#73163: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f670a16f38c31ab3792a8027d61896218d2e103e.1725957459.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=73163@debbugs.gnu.org \
    --cc=ludovic.courtes@inria.fr \
    --cc=romain.garbage@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).