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))
(define (instance->derivation instance)
(mcached (if (eq? instance core-instance)
(build-channel-instance instance)
(mlet %store-monad ((core (instance->derivation core-instance))
(deps (mapm %store-monad instance->derivation
(edges instance))))
(build-channel-instance instance core deps)))
instance))
(mlet %store-monad ((system (current-system)))
(mcached (if (eq? instance core-instance)
(build-channel-instance instance)
(mlet %store-monad ((core (instance->derivation core-instance))
(deps (mapm %store-monad instance->derivation
(edges instance))))
(build-channel-instance instance core deps)))
instance
system)))
(unless core-instance
(let ((loc (and=> (any (compose channel-location channel-instance-channel)