From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Channel dependencies Date: Sun, 14 Oct 2018 11:49:40 +0200 Message-ID: <871s8soo26.fsf@elephly.net> References: <877eimnxpq.fsf@mdc-berlin.de> <87k1ml8e7r.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBd2c-0004cp-JT for guix-devel@gnu.org; Sun, 14 Oct 2018 05:50:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBd2N-0007Ot-EN for guix-devel@gnu.org; Sun, 14 Oct 2018 05:50:23 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gBd2L-0007Mq-EL for guix-devel@gnu.org; Sun, 14 Oct 2018 05:50:14 -0400 In-reply-to: <87k1ml8e7r.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Chris Marusich Cc: guix-devel@gnu.org, Ricardo Wurmus Hi Chris, >> (define (latest-channel-instances store channels) >> "Return a list of channel instances corresponding to the latest check= outs of >> -CHANNELS." >> - (map (lambda (channel) >> - (format (current-error-port) >> - (G_ "Updating channel '~a' from Git repository at '~a'= ...~%") >> - (channel-name channel) >> - (channel-url channel)) >> - (let-values (((checkout commit) >> - (latest-repository-commit store (channel-url cha= nnel) >> - #:ref (channel-referen= ce >> - channel)))) >> - (channel-instance channel commit checkout))) >> - channels)) >> +CHANNELS and the channels on which they depend." >> + (append-map (lambda (channel) >> + (format (current-error-port) >> + (G_ "Updating channel '~a' from Git repository = at '~a'...~%") >> + (channel-name channel) >> + (channel-url channel)) >> + (let-values (((checkout commit) >> + (latest-repository-commit store (channel-= url channel) >> + #:ref (channel-= reference >> + channel)= ))) >> + (let ((instance (channel-instance channel commit chec= kout))) >> + (cons instance (latest-channel-instances >> + store >> + (channel-instance-dependencies inst= ance)))))) >> + channels)) > > What happens if the dependency list contains duplicate channels? This > might happen if two unrelated channels mutually depend upon a third > channel. > > What happens if the dependency list contains two channels that differ > only in their branch (or commit), and are the same in every other way? > This might happen if two unrelated channels mutually depend upon two > different versions of the same third channel. I was going to write an email about this just now. This is indeed a problem with this naive implementation. For reproducibility a user may want to pin all channels to a certain commit, but channels that are dependencies are exempt from that mechanism as they are added to the list of channels to be instantiated during the run of =E2=80=9Cguix pull=E2=80=9D. It should be possible to pin *all* channels, even if they are dependencies of other channels. One way is to treat all channels and their dependencies as a unique set where duplicates are replaced with the most specific description (e.g. those specifying a commit). This way users could fully specify dependencies, which would then be used instead of the channel=E2=80=99s declared dependency. This needs some more thought. -- Ricardo