channels: Key cached channel derivations by system.

Previously, the channel instance to derivation mapping would be
independent of the system.  Thus, building the same channel instance for
several different systems would always return the derivation that was
first computed.

This is a followup to c3ab921eed.

* guix/channels.scm (channel-instance-derivations)[instance->derivation]:
Pass the current system as a third argument to 'mcached'.
This commit is contained in:
Ludovic Courtès 2019-07-08 10:53:41 +02:00
parent c7b757c46c
commit cdf689471a
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 9 additions and 7 deletions

View File

@ -349,13 +349,15 @@ INSTANCES."
(resolve-dependencies instances)) (resolve-dependencies instances))
(define (instance->derivation instance) (define (instance->derivation instance)
(mcached (if (eq? instance core-instance) (mlet %store-monad ((system (current-system)))
(build-channel-instance instance) (mcached (if (eq? instance core-instance)
(mlet %store-monad ((core (instance->derivation core-instance)) (build-channel-instance instance)
(deps (mapm %store-monad instance->derivation (mlet %store-monad ((core (instance->derivation core-instance))
(edges instance)))) (deps (mapm %store-monad instance->derivation
(build-channel-instance instance core deps))) (edges instance))))
instance)) (build-channel-instance instance core deps)))
instance
system)))
(unless core-instance (unless core-instance
(let ((loc (and=> (any (compose channel-location channel-instance-channel) (let ((loc (and=> (any (compose channel-location channel-instance-channel)