GNU bug report logs - #68835
Resolving package inheritance issue

Previous Next

Package: guix;

Reported by: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Date: Wed, 31 Jan 2024 01:03:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Sharlatan Hellseher <sharlatanus <at> gmail.com>, 68835 <at> debbugs.gnu.org
Cc: dev <at> jpoiret.xyz, othacehe <at> gnu.org, ludo <at> gnu.org, me <at> tobias.gr, rekado <at> elephly.net, guix <at> cbaines.net
Subject: bug#68835: Resolving package inheritance issue
Date: Thu, 01 Feb 2024 14:27:24 +0100
Hi,

On Wed, 31 Jan 2024 at 01:01, Sharlatan Hellseher <sharlatanus <at> gmail.com> wrote:

> My rational was to keep golang module in (gnu packages golang-web) and
> the new inherited package providing executable in (gnu packages web)
> which introduced the regression.

As said by Josselin, the manual provides some explanations for this kind
of situations.

    https://guix.gnu.org/manual/devel/en/guix.html#Cyclic-Module-Dependencies

Roughly speaking, your proposal for Go language packages breaks because
more or less « Because the ‘inherit’ field is not delayed (thunked), it
is evaluated at the top level at load time, which is problematic in the
presence of module dependency cycles. »

The “fix” would to wrap it using a procedure; as explained in the
manual.  Something like:

    (define (make-minify)
      (package
        (inherit go-github-com-tdewolff-minify-v2)
        (name "minify")
        (arguments
         (substitute-keyword-arguments
             (package-arguments go-github-com-tdewolff-minify-v2)
           ((#:install-source? _ #t) #f)
           ((#:import-path _ "github.com/tdewolff/minify/v2")
            "github.com/tdewolff/minify/cmd/minify"))))
         
Well, then it is not clear for me how the user would access to this
package but somehow that’s another story. :-)x

As Josselin, I would suggest to keep in the same Guile module the
original package and its variants created using ’inherit’; well as the
general rule.

Cheers,
simon





This bug report was last modified 1 year and 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.