all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org, Mathieu Othacehe <othacehe@gnu.org>
Subject: Re: 04/07: inferior: Break cached-channel-instance into two procedures.
Date: Wed, 10 Mar 2021 10:57:56 +0100	[thread overview]
Message-ID: <871rcn72l7.fsf@gnu.org> (raw)
In-Reply-To: <20210310075020.83E6A211CF@vcs0.savannah.gnu.org> (guix-commits@gnu.org's message of "Wed, 10 Mar 2021 02:50:20 -0500 (EST)")

Hi Mathieu!

guix-commits@gnu.org skribis:

> commit 7d63b775513e7049047222dbe403a4181f63828d
> Author: Mathieu Othacehe <othacehe@gnu.org>
> AuthorDate: Fri Mar 5 09:51:42 2021 +0100
>
>     inferior: Break cached-channel-instance into two procedures.
>     
>     Break cached-channel-instance into two different procedures:
>     channels->cached-profile and instances->cached-profile operating respectively
>     on channels and channels instances.
>     
>     * guix/inferior.scm (cached-channel-instance): Rename it into ...
>     (cached-profile): ... this new procedure.
>     (channels->cached-profile, instances->cached-profile): New procedures.
>     * guix/scripts/time-machine.scm (guix-time-machine): Adapt accordingly.

[...]

> -(define* (cached-channel-instance store
> -                                  channels
> -                                  #:key
> -                                  (authenticate? #t)
> -                                  (cache-directory (%inferior-cache-directory))
> -                                  (ttl (* 3600 24 30)))
> -  "Return a directory containing a guix filetree defined by CHANNELS, a list of channels.
> -The directory is a subdirectory of CACHE-DIRECTORY, where entries can be reclaimed after TTL seconds.
> -This procedure opens a new connection to the build daemon.  AUTHENTICATE?
> -determines whether CHANNELS are authenticated."
> -  (define commits
> -    ;; Since computing the instances of CHANNELS is I/O-intensive, use a
> -    ;; cheaper way to get the commit list of CHANNELS.  This limits overhead
> -    ;; to the minimum in case of a cache hit.
> -    (map channel-full-commit channels))
> -
> +(define* (cached-profile store instances
> +                         #:key
> +                         cache-directory
> +                         commits ttl)
> +  "Return a directory containing a guix filetree defined by INSTANCES, a
> +procedure returning a list of channel instances.  The directory is a
> +subdirectory of CACHE-DIRECTORY, where entries can be reclaimed after TTL
> +seconds.  This procedure opens a new connection to the build daemon."

We need to keep ‘cached-channel-instance’ because it’s part of the
public API and used outside Guix (in Guix-Jupyter at least).  We can use
‘define-deprecated’.

Also, I think ‘cached-profile’ doesn’t quite capture what this is
about.  :-)  The docstring should mention what COMMITS is.  The fact
that INSTANCES is a thunk is a bit awkward and IMO not great for a
public interface.

WDYT?

Thanks,
Ludo’.


  parent reply	other threads:[~2021-03-10 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210310075017.12619.72665@vcs0.savannah.gnu.org>
     [not found] ` <20210310075020.CC605211CF@vcs0.savannah.gnu.org>
2021-03-10  9:48   ` 05/07: inferior: Fix concurrent cached-profile calls Ludovic Courtès
2021-03-10 12:13     ` Mathieu Othacehe
     [not found] ` <20210310075020.83E6A211CF@vcs0.savannah.gnu.org>
2021-03-10  9:57   ` Ludovic Courtès [this message]
2021-03-10 12:14     ` 04/07: inferior: Break cached-channel-instance into two procedures Mathieu Othacehe

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rcn72l7.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=othacehe@gnu.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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.