From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: 46776@debbugs.gnu.org
Subject: [bug#46776] [PATCH] inferior: Extend cached-channel-instance scope.
Date: Mon, 01 Mar 2021 15:47:19 +0100 [thread overview]
Message-ID: <87blc3rkw8.fsf@gnu.org> (raw)
In-Reply-To: <20210225172048.22398-1-othacehe@gnu.org> (Mathieu Othacehe's message of "Thu, 25 Feb 2021 18:20:48 +0100")
Hi,
Mathieu Othacehe <othacehe@gnu.org> skribis:
> * guix/inferior.scm (cached-channel-instance): Turn channels argument into
> channels-or-instances. Adapt the rest of the procedure.
[...]
> (define* (cached-channel-instance store
> - channels
> + channels-or-instances
> #: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."
> + "Return a directory containing a guix filetree defined by
> +CHANNELS-OR-INSTANCES, a list of channels or 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.
> +AUTHENTICATE? determines whether CHANNELS are authenticated."
> + ;; Determine if we are dealing with channels or channel instances.
> + (define channels?
> + (match (pk channels-or-instances)
> + (((? channel? c) rest ...)
> + #t)
> + (else #f)))
> +
> (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))
> + (if channels?
> + (map channel-full-commit channels-or-instances)
> + (map channel-instance-commit channels-or-instances)))
This would only accept homogeneous lists, which is kinda weird.
Could we instead have a separate procedure taking channel instances, and
arrange to factorize common code in a third procedure?
Thanks,
Ludo’.
next prev parent reply other threads:[~2021-03-01 14:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-25 17:20 [bug#46776] [PATCH] inferior: Extend cached-channel-instance scope Mathieu Othacehe
2021-03-01 14:47 ` Ludovic Courtès [this message]
2021-03-26 9:54 ` bug#46776: " 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=87blc3rkw8.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=46776@debbugs.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.