Subject: Re: [bug#67822] [PATCH v3] gnu: maths: petsc: Reduce closure size.

From: Ludovic Courtès <[email-masked]>
Date: Fri, 05 Jan 2024 12:08:40 +0100

Hi Lars,

Lars Bilke <[email-masked]> skribis:

> Reduces closure size by around 350 MB by removing refernces to build dependencies (e.g. gcc).

Woow, nice!

> +          (add-after 'clean-install 'clear-reference-to-compiler
> +            (lambda* (#:key inputs outputs #:allow-other-keys)
> +              ;; Do not retain a reference to GCC and other build only inputs.
> +              (let ((out (assoc-ref outputs "out")))
> +              (substitute* (string-append out "/lib/petsc/conf/petscvariables")
> +                (("/gnu/store/.*/bin/gcc") "gcc")
> +                (("/gnu/store/.*/bin/g\\+\\+") "g++")
> +                (("/gnu/store/.*/bin/make") "make")
> +                (("/gnu/store/.*/bin/diff") "diff")
> +                (("/gnu/store/.*/bin/sed") "sed")

Can we instead patch the thing that creates ‘petscvariables’ in the
first place?

The reason I’m suggesting it is because in general we avoid hardcoding
/gnu/store in substitution patterns because it’s possible to configure
Guix with a different store directory.

Thanks, and apologies for the delay!

Ludo’.