guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#73833] [PATCH v2 1/5] guix: import: utils: Add function git->origin


From: Ludovic Courtès
Subject: [bug#73833] [PATCH v2 1/5] guix: import: utils: Add function git->origin.
Date: Fri, 29 Nov 2024 14:05:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi,

Nicolas Graves <ngraves@ngraves.fr> skribis:

> On 2024-11-06 16:16, Ludovic Courtès wrote:

[...]

>>> -  ;; Use a custom cache to avoid cluttering the default one under
>>> -  ;; ~/.cache/guix, but choose one under /tmp so that it's persistent 
>>> across
>>> -  ;; subsequent "guix import" invocations.
>>> -  (mkdir-p cache)
>>> -  (chmod cache #o700)
>>> -  (let-values (((checkout commit _)
>>> -                (parameterize ((%repository-cache-directory cache))
>>> -                  (update-cached-checkout url
>>
>> Looks like this bit and its rationale in (guix import go) gets lost
>> here: ‘git->origin’ unconditionally uses ~/.cache, which means that
>> ‘guix import go -r …’ would fill that directory.
>>
>> Could we restore that behavior, probably as an option to
>> ‘git->origin’?
>
> Yes, we can.  However, IIRC my rationale was that the alternative used in
> every other import module was to use the store (and not ~/.cache IIRC,
> since it uses latest-repository-commit instead of
> update-cached-checkout) as a cache.  Since we often import/update to
> build after that, it seemed quite natural to let the store handle the
> cache instead of managing a custom cache for that.
>
> So yes, we loose a bit of functionality, but I think it's more
> maintainable this way, if the original author doesn't disagree too much
> on that.  WDYT?

‘latest-repository-commit’ calls ‘update-cached-checkout’ to first get a
copy of the repo under ~/.cache, and then import it into the store.

So I think the functionality remains relevant.

I’ve just used “guix import go -r code.forgejo.org/forgejo” and it ran
out of disk space after filling /tmp with repos (!).  The fact that it’s
in /tmp means I can easily remove it; otherwise I’d have to wipe all of
~/.cache/guix/checkouts, but that’d be inconvenient (my next
pull/time-machine would have to re-clone the Guix repo, for instance).

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]