From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: bug#22437: Fixing package-with-python2 Date: Sun, 7 Feb 2016 10:17:20 +0200 Message-ID: <20160207101720.4a3be103__34381.4306230799$1454833105$gmane$org@debian-netbook> References: <87vb68nkyb.fsf@gnu.org> <87twlqxjsc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/97JWleCq__OuzYvnEWllUCb"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSKXn-0001yO-66 for bug-guix@gnu.org; Sun, 07 Feb 2016 03:18:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSKXi-0004y0-6K for bug-guix@gnu.org; Sun, 07 Feb 2016 03:18:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:56101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSKXi-0004xw-2u for bug-guix@gnu.org; Sun, 07 Feb 2016 03:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aSKXh-0002Sh-Uq for bug-guix@gnu.org; Sun, 07 Feb 2016 03:18:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87twlqxjsc.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: guix-devel , 22437@debbugs.gnu.org --Sig_/97JWleCq__OuzYvnEWllUCb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 03 Feb 2016 09:47:15 +0100 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > ludo@gnu.org (Ludovic Court=C3=A8s) skribis: >=20 > > An idea I haven=E2=80=99t taken the time to test yet would be to use > > =E2=80=98properties=E2=80=99: > > > > (define python-foobar ;with Python 3 > > (package > > (name "foobar") > > ;; Specify which Python 2 variant to use. > > (properties `((python2-variant . ,(delay python2-foobar)))))) This part I don't get. What's the period for? > > (define python2-foobar > > (package (inherit python-foobar) > > ;; =E2=80=A6 stuff beyond the mechanical python 2=E2=86=923 switc= h=E2=80=A6 > > )) > > > > =E2=80=98package-with-python2=E2=80=99 would honor this =E2=80=98python= 2-variant=E2=80=99 property. >=20 > Here=E2=80=99s a first stab at this. >=20 > As an example, I modified =E2=80=98python-matplotlib=E2=80=99 to use that= feature, so we > can test that =E2=80=98python2-scipy=E2=80=99 is using the right =E2=80= =98python2-matplotlib=E2=80=99: >=20 > --8<---------------cut here---------------start------------->8--- > $ ./pre-inst-env guix build python2-matplotlib -d 2>/dev/null > /gnu/store/07zr2pqg61b742czb2aqyisml2i90r4a-python2-matplotlib-1.4.3.drv > $ ./pre-inst-env guix build python2-scipy -d 2>/dev/null > /gnu/store/8yhxdbyjvx2xwynpqqcrj9ilksd2pb01-python2-scipy-0.16.0.drv > $ guix gc --references /gnu/store/8yhxdbyjvx2xwynpqqcrj9ilksd2pb01-python= 2-scipy-0.16.0.drv | grep python2-matplotlib > /gnu/store/07zr2pqg61b742czb2aqyisml2i90r4a-python2-matplotlib-1.4.3.drv > --8<---------------cut here---------------end--------------->8--- >=20 > This will trigger rebuilds (but with an identical result) because in > manually-written variants we would use =E2=80=9Cpython2-foo=E2=80=9D as t= he label of > inputs, whereas the automatic transformations keeps the original > =E2=80=9Cpython-foo=E2=80=9D label. rebuilds python-foo and python2-foo, or just the python2- variants? > What do people think? I like it. It keeps the logic in the build-system. In terms of a speed test when figuring out the build/dependancy graph, how does it affect the time of `guix graph python2-scipy python2-matplotlib`? > I can apply this patch of the approach sounds good to you. I think we > should probably do one commit per rewrite for clarity. >=20 > We should probably start with the lowest level, like python2-pycairo and > python2-pygobject and even python itself, because if we fix them then > some of the higher-level stuff won=E2=80=99t even need their own > =E2=80=98python2-variant=E2=80=99 property. For instance, if python, pyc= airo, and > pygobject have their =E2=80=98python2-variant=E2=80=99 set, then we no lo= nger need this: >=20 > --8<---------------cut here---------------start------------->8--- > (define-public python2-matplotlib > (let ((matplotlib (package-with-python2 %python-matplotlib))) > (package (inherit matplotlib) > ;; Make sure to use special packages for Python 2 instead > ;; of those automatically rewritten by package-with-python2. > (propagated-inputs > `(("python2-pycairo" ,python2-pycairo) > ("python2-pygobject-2" ,python2-pygobject-2) > ("python2-tkinter" ,python-2 "tk") > ,@(fold alist-delete (package-propagated-inputs matplotlib) > '("python-pycairo" "python-pygobject" "python-tkinter"))= ))))) > --8<---------------cut here---------------end--------------->8--- >=20 > =E2=80=A6 and as a consequence, we don=E2=80=99t need a =E2=80=98python2-= variant=E2=80=99 in > =E2=80=98python-matplotlib=E2=80=99. >=20 > Does that make sense? Any takers? (This can be done incrementally.) It fits our "one change per commit" policy, and if we don't start at the ba= se of the pyramid we'll be modifying and then removing the special variants. I don't mind doing the conversion process. > Thanks, > Ludo=E2=80=99. >=20 Thinking aloud, I think for the time being we should keep the python-setuptools that are already part of the python- variants where they are and save that for another time. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --Sig_/97JWleCq__OuzYvnEWllUCb Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJWtv2RAAoJEPTB05F+rO6TFoAP/jZ0bJcD6ujr0rWOShC3t78o GdVvzfAapEqtIEkOp9psu4hQ141+LmCA0ATDfUDoW9s6iIP0TOIhFya4GAb+JXEK RufE4jIWGWm922dVZupHPm6SOUjQN9rWyyiUQvG0tQ57vlTnHQ87IrrqPTm9EWua SBc+hpZzxfcFfvyxrPhMAgQwenHjQFwkzDedPEhpYsQkQLnLC3arj9uS3kBFK6rl VNnMrefT6Mra305Tf81vyTz0MD3OlNkYenAukslSH/2JAqX4GVMqC/LIBpuqYTlp ZUlH7ZyFbtkRSBzjcMJ49Evn7ytPV0wEBS4nsQahECsPDGYEqDkNFlRsq6VRBaXs oRglFxn+iediihotkjuR+q84VF7jay6fUqOtUaJ803KZXVQhk6kyXJ4PyzEOOIcL VIfFIj6dpXi3+6wXdXO9UNFTSV95Pk65DYlDQmJ+dmScLcOa27dAyHaglKPJm+Zx iWwLmhgtMoppFWZ1KV/Xf+RsouxVrnWHgf3K2f7K6HAloatPgaGMA+iH8mfDNsj8 wV/aKxBA481nXVY3TMgLwIDFEZJWy7GGFWiK2n5b21J9YoxhHnO8rFntkdDopMkZ SbN5irAzzTaPqBTa0hzqIoIKRYPNZQwgbaNK0pWoGIQCjneNG4nnN1pOPSeNiiYh +HyzxeiA4xDlLDMDPrqt =py3R -----END PGP SIGNATURE----- --Sig_/97JWleCq__OuzYvnEWllUCb--