unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: Tanguy Le Carrour <tanguy@bioneland.org>
Cc: guix-devel@gnu.org
Subject: Re: Problem with `direnv` package definition
Date: Sun, 21 Apr 2019 10:54:19 +0100	[thread overview]
Message-ID: <87mukju1is.fsf@cbaines.net> (raw)
In-Reply-To: <20190421083426.6snly2v4xmlneb32@melmoth>

[-- Attachment #1: Type: text/plain, Size: 3885 bytes --]


Tanguy Le Carrour <tanguy@bioneland.org> writes:

> Le 04/20, Christopher Baines a écrit :
>> Tanguy Le Carrour <tanguy@bioneland.org> writes:
>> > However, in the package definition [2], 3 Go packages are listed as
>> > "inputs" whereas they should be listed as "native-inputs". Is this
>> > correct?
>> That sounds right to me, although there have been issues with binaries
>> generated with Go […]
>> There's also an important aspect of cross-compilation to these fields,
>> which you can read about here:
>>
>>   https://www.gnu.org/software/guix/manual/en/html_node/package-Reference.html
>
> Thanks for the link.
>
> I do realize that, so close to the release of Guix System 1.0,
> this can sound trivial, but I find it a little annoying to have
> `guix size direnv` reporting 594 MiB when the actual binary size is
> 2.9M. :-(

So, in contrast to some other package management systems, the runtime
dependencies, or references of the output(s) in the case of Guix are not
explicitly set in the package definition.

This is still something I have a little difficulty understanding, but
the inputs/native-inputs distinction is more about architecture than
runtime references.

That's not to say that making the inputs, native-inputs in this case is
wrong, quite the opposite. But, to reduce the size of the package, all
that's required is to remove the reference from the direnv binary to the
go compiler.

It turns out that there's a specific phase of the go-build-system in
Guix that does this. Currently the direnv package is using the
gnu-build-system, as it's one of the older go packages in Guix, however
it does now pull in some phases from the go-build-system.

I've just pushed a commit that pulls in the relevant phase, and makes
the inputs, native-inputs [1]. With that change, the size of the package
does drop [2].

1: http://git.savannah.gnu.org/cgit/guix.git/commit/?id=9729b6ea2fe89d5b8cfd180ef2dfca367c7417e5
2:
→ guix size /gnu/store/64m1v6smprhzmsbdvrwvd5gsrc5lirr5-direnv-2.15.2
store item                                                       total    self
/gnu/store/64m1v6smprhzmsbdvrwvd5gsrc5lirr5-direnv-2.15.2            4.9     2.9  59.0%
/gnu/store/izyk3kppj42pa8i2cq29bw3bnr1607ps-tzdata-2018i             2.0     2.0  41.0%
total: 4.9 MiB

>> > As I said, I'm still learning. But I've tried, and here is what I've
>> > done so far […]
>>
>> I tried changing the inputs to native-inputs, and the package built for
>> me. Could you share the exact changes you made?
>
> I haven't done much:
>
> --- a/gnu/packages/shellutils.scm
> +++ b/gnu/packages/shellutils.scm
> @@ -129,12 +129,11 @@ are already there.")
>           ;; Help the build scripts find the Go language dependencies.
>           (add-before 'unpack 'setup-go-environment
>             (assoc-ref go:%standard-phases 'setup-go-environment)))))
> -    (inputs
> -     `(("go" ,go)
> -       ("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
> -       ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)))
>      (native-inputs
> -      `(("which" ,which)))
> +      `(("go" ,go)
> +        ("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
> +        ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)
> +        ("which" ,which)))
>      (home-page "https://direnv.net/")
>      (synopsis "Environment switcher for the shell")
>      (description
>
>
> Thanks again for your time!

What you've put above looks ok, I'm unsure why that wouldn't work...

Anyway, while the size of direnv should now be improved, there's still
more improvements to be made to the direnv package if you're interested!

I think it would be better to switch to using the go build system, and
the package in Guix is quite a few versions behind.

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

  reply	other threads:[~2019-04-21  9:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-20 13:20 Problem with `direnv` package definition Tanguy Le Carrour
2019-04-20 17:02 ` Christopher Baines
2019-04-21  8:34   ` Tanguy Le Carrour
2019-04-21  9:54     ` Christopher Baines [this message]
2019-04-23  7:59       ` Christopher Baines
2019-04-23 20:34       ` Tanguy Le Carrour

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=87mukju1is.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=guix-devel@gnu.org \
    --cc=tanguy@bioneland.org \
    /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).