From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMCsb-00040T-CB for guix-patches@gnu.org; Sat, 17 Jun 2017 08:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMCsY-0007hP-AR for guix-patches@gnu.org; Sat, 17 Jun 2017 08:31:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:49521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dMCsY-0007hE-6x for guix-patches@gnu.org; Sat, 17 Jun 2017 08:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dMCsX-0001G1-UG for guix-patches@gnu.org; Sat, 17 Jun 2017 08:31:01 -0400 Subject: [bug#27271] [PATCH 0/4] Catch collisions at profile creation time Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170607092242.20565-1-ludo@gnu.org> <878tl2djh8.fsf@elephly.net> <871sqtpkfo.fsf@gnu.org> <87shiz6k03.fsf@elephly.net> Date: Sat, 17 Jun 2017 14:30:03 +0200 In-Reply-To: <87shiz6k03.fsf@elephly.net> (Ricardo Wurmus's message of "Sat, 17 Jun 2017 11:28:28 +0200") Message-ID: <87poe2bxv8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 27271@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Ricardo Wurmus skribis: > I just tried it and I didn=E2=80=99t work the way I thought it would. > > Here=E2=80=99s what I did: > > # install old numpy > guix package -p /tmp/test -i /gnu/store/s02iw98l234ngkcnxqi7jz54vqqgx6h= j-python2-numpy-1.10.4 > > # install a package depending on a later version of numpy > guix package -p /tmp/test -i bamm > > It built bamm and then proceeded to build a profile, while spitting out > hundreds of lines about conflicts between python2-numpy-1.10.4 and > python2-numpy-1.12.0. Oops, good catch. This is fixed with the attached patch. Now I get: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix package -p /tmp/test -i bamm substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org= '... 100.0% The following package will be installed: bamm 1.7.3 /gnu/store/lcb2s2x3s50gmf24asl2mvv34jhx8n1x-bamm-1.7.3 guix package: error: profile contains conflicting entries for python2-numpy= :out guix package: error: first entry: python2-numpy@1.12.0:out /gnu/store/pzf= 5yszv5dlzmk71w7srdi2qdqh2j40a-python2-numpy-1.12.0 guix package: error: ... propagated from bamm@1.7.3 guix package: error: second entry: python2-numpy@1.10.4:out /gnu/store/py= kndifwj34mc1h7m78d1b6c03gb5zq1-python2-numpy-1.10.4 --8<---------------cut here---------------end--------------->8--- I=E2=80=99ll add a test case for this. > I also wonder if we should add a way to force Guix to build the profile > despite the detected conflict. Good question. I wouldn=E2=80=99t be hard to do, but maybe we can wait unt= il there=E2=80=99s demand so we can analyze the use case better? Thanks for testing! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/profiles.scm b/guix/profiles.scm index 980229ca7..52a8bd2ea 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -157,6 +157,19 @@ ;; Convenient alias, to avoid name clashes. (define make-manifest manifest) +(define (manifest-transitive-entries manifest) + "Return the entries of MANIFEST along with their propagated inputs, +recursively." + (let loop ((entries (manifest-entries manifest)) + (result '())) + (match entries + (() + (reverse result)) + ((head . tail) + (loop (append (manifest-entry-dependencies head) + tail) + (cons head result)))))) + (define-record-type* manifest-entry make-manifest-entry manifest-entry? @@ -250,7 +263,7 @@ file name." (#f ;no conflict (return result)))) #t - (manifest-entries manifest)))) + (manifest-transitive-entries manifest)))) (define* (package->manifest-entry package #:optional (output "out") #:key (parent (delay #f))) --=-=-=--