GNU bug report logs - #61949
[PATCH] pack: Move common build code to (guix build pack).

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sat, 4 Mar 2023 03:16:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


Message #22 received at 61949-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 61949-done <at> debbugs.gnu.org, Christopher Baines <mail <at> cbaines.net>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Josselin Poiret <dev <at> jpoiret.xyz>,
 Ricardo Wurmus <rekado <at> elephly.net>
Subject: Re: bug#61949: [PATCH] pack: Move common build code to (guix build
 pack).
Date: Tue, 18 Jul 2023 17:13:44 -0400
Hi Ludo!

Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi Maxim and all,
>
> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> skribis:
>
>> The rationale is to reduce the number of derivations built per pack to ideally
>> one, to minimize storage requirements.  The number of derivations had gone up
>> with 68380db4 ("pack: Extract populate-profile-root from
>> self-contained-tarball/builder.") as a side effect to improving code reuse.
>>
>> * guix/scripts/pack.scm (guix): Add commentary comment.
>> (populate-profile-root, self-contained-tarball/builder): Extract to...
>> * guix/build/pack.scm (populate-profile-root): ... this, and...
>> (build-self-contained-tarball): ... that, adjusting for use on the build side.
>> (assert-utf8-locale): New procedure.
>> (self-contained-tarball, debian-archive, rpm-archive): Adjust accordingly.
>
> Sorry for dropping the ball!

Thanks for picking it up again :-)


[...]

>>    (gexp->derivation (string-append name ".tar"
>>                                     (compressor-extension compressor))
>> -    (self-contained-tarball/builder profile
>> -                                    #:profile-name profile-name
>> -                                    #:target target
>> -                                    #:localstatedir? localstatedir?
>> -                                    #:deduplicate? deduplicate?
>> -                                    #:symlinks symlinks
>> -                                    #:compressor compressor
>> -                                    #:archiver archiver)))
>> +    (with-extensions (list guile-gcrypt)
>> +      (with-imported-modules `(((guix config) => ,(make-config.scm))
>
> You can remove (guix config) here since it’s unused.

Done.

>> +                               ,@(source-module-closure
>> +                                  `((guix build pack)
>> +                                    (guix build utils))
>> +                                  #:select? not-config?))
>
> I figured that, to allow tests to run without an external store, we need
> to change it like this:
>
>   (gexp->derivation (string-append name ".tar"
>                                    (compressor-extension compressor))
>     (with-extensions (if deduplicate? (list guile-gcrypt) '())
>       (with-imported-modules (let ((lst (source-module-closure
>                                          `((guix build pack)
>                                            (guix build utils))
>                                          #:select? not-config?)))
>                                (if deduplicate?
>                                    lst
>                                    (delete '(guix store deduplication) lst)))
>         #~(begin
>             (use-modules (guix build pack)
>                          (guix build utils))
>             …))))
>
> Quite some boilerplate given that #:deduplicate? is always #f in practice.
> So maybe it’s not worth the trouble, after all.
>
> I’ll let you rebase and adjust as you see fit, but it LGTM!

Thanks for this!  I had to use it for tests/guix-pack.sh to pass, but it
still would work for the first test in tests/pack.scm (after modifying
it to use the test store as it used to), so I've left tests/pack.scm

The change is now installed, thanks for the review!

-- 
Thanks,
Maxim




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

Previous Next


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