From owner-freebsd-ports@FreeBSD.ORG Mon Jul 29 12:05:52 2013 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B9718F24; Mon, 29 Jul 2013 12:05:52 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2214227D; Mon, 29 Jul 2013 12:05:51 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id p58so3831423wes.40 for ; Mon, 29 Jul 2013 05:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=0gft/+cb977FPxqcLHsAeCM2M9tVK1l7XLlGnZ7dBW0=; b=oarzRFzee93+GvzGiamT/49JllgPg7TlOd9HSRvFL3G0BqZc5sYFvKlmYUj8q37Q+z KGcBfH2G9g4ZN4eEER/kiRWw165au/jYs8V/PvFlk6Bq+YVnaSzx3e2Sy/AV6pPCe9R0 cg2nmWJXm0dIopWshTzF1zx1+gHTiRkCDfWozM4nTlHwxlttKR90ssOa7U5i6AuKJsc/ +pNkvSLR+38dC2C1EX87levbWjOtFFVfn3xI2KQAQA4TB9vt20deWFbUJjoX3ZzVku0i eIBXURi2ho1SN1WZhUi/R4WXBOox7n3mVt0WfPw4RJI4T5svn4kHzhuq44ybysuBscCz KwKQ== X-Received: by 10.180.36.74 with SMTP id o10mr6872068wij.23.1375099550014; Mon, 29 Jul 2013 05:05:50 -0700 (PDT) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id u9sm22030537wif.6.2013.07.29.05.05.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 29 Jul 2013 05:05:49 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 29 Jul 2013 14:05:47 +0200 From: Baptiste Daroussin To: Marcus von Appen Subject: Re: python 2 and 3 modules Message-ID: <20130729120546.GR98542@ithaqua.etoilebsd.net> References: <20130729110145.Horde.vaUlaCnJ-q1VD1He43pO6Q8@webmail.df.eu> <20130729122624.Horde.SUzy4e5lddiAJOw5KSFogg6@webmail.df.eu> <20130729104417.GQ98542@ithaqua.etoilebsd.net> <20130729130540.Horde.o5sGDeiJhdhILNomjoUYyw5@webmail.df.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/Isdj7O9hWi8F9Bn" Content-Disposition: inline In-Reply-To: <20130729130540.Horde.o5sGDeiJhdhILNomjoUYyw5@webmail.df.eu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: David Demelier , ports@freebsd.org, python@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 12:05:52 -0000 --/Isdj7O9hWi8F9Bn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 29, 2013 at 01:05:40PM +0200, Marcus von Appen wrote: >=20 > Baptiste Daroussin : >=20 > > On Mon, Jul 29, 2013 at 12:26:24PM +0200, Marcus von Appen wrote: > >> David Demelier : > >> > >> > 2013/7/29 Marcus von Appen : > >> >> David Demelier : > >> >> > >> >> > >> >>> 2013/7/28 Daniel Braniss : > >> >>>> > >> >>>> Hi, > >> >>>> I need to be able to have both (2.7 and 3.2) modules. > >> >>>> setting PYTHON_VERSION=3D3.2 in /etc/make.conf compiles properly, > >> >>>> but make install, insists that that the 2.7 version is installed! > >> >>>> after deinstalling, it will install the 3.2 version in the correct > >> >>>> directory: > >> >>>> /usr/local/lib/python3.2/site-path > >> >>>> but now I lost the 2.7 version. > >> >>>> > >> >>>> the same happens if I try to install the 2.7 version, it will com= plain > >> >>>> that the 3,2 version is installed. > >> >>>> > >> >>>> BTW, the comments in ports/Mk/bsd.python.mk are very confusing and > >> >>>> some are wrong: > >> >>>> # PYTHON_VERSION - Version of the python binary in your ${= PATH}, > >> >>>> in the > >> >>>> # format "python2.0". =20 > >> Set this in > >> >>>> your > >> >>>> makefile in case you > >> >>>> # want to build extension= s with > >> >>>> an > >> >>>> older binary. > >> >>>> # default: depends on =20 > >> the version > >> >>>> of > >> >>>> your python binary > >> >>>> > >> >>>> setting it to "python3.2" produces errors in the make, while 3.2 = is ok > >> >>>> > >> >>>> is there any fix? > >> >>>> > >> >>>> thanks, > >> >>>> danny > >> >>>> > >> >>> > >> >>> For the moment its pretty difficult to install python 2.7 and 3.3 = at > >> >>> the same time. However, if you plan to install python 3.3, you nee= d to > >> >>> set PYTHON_DEFAULT_VERSION to "python3.3" and not PYTHON_VERSION. > >> >> > >> >> > >> >> No, it is not. > >> >> > >> >> cd /usr/ports/lang/python27 && make install clean > >> >> cd /usr/ports/lang/python32 && make install clean > >> >> cd /usr/ports/lang/python33 && make install clean > >> >> > >> >> works like a charm. If you however want to use Python modules, it m= ight > >> >> become > >> >> more difficult. It was discussed some time ago on the =20 > >> freebsd-python mailing > >> >> list > >> >> without an applicable result. > >> >> > >> >> If you need to have the same Python module for different =20 > >> versions around, I > >> >> would > >> >> recommend to use virtualenv in favour of the ports infrastructure, = since > >> >> > >> >> make -DPYTHON_DEFAULT_VERSION=3Dxxx - or - > >> >> make -DPYTHON_VERSION=3Dxxx - or - > >> >> make -DPYTHON3_DEFAULT_VERSION=3Dxxx > >> >> > >> >> might mess up previous installations for a different python version. > >> >> > >> >> Cheers > >> >> Marcus > >> >> > >> > > >> > Of course from ports it will work. I've told about binary packages. > >> > > >> > When you bulk build a package for python 2.7 and python 3.3 the > >> > /usr/local/bin/python will be included in both versions. Because bulk > >> > building python 3 modules will requires to set PYTHON_DEFAULT_VERSION > >> > and PYTHON3_DEFAULT_VERSION to the python 3.3 interpreter. > >> > > >> > Then the poudriere bulk will generate python 2.7 and python 3.3 > >> > pkg-plist including for both /usr/local/bin/python and all of the > >> > non-versioned files I've already told above. > >> > > >> > You may now think "who cares? it build from ports". I would say no, > >> > binary packages will be used more and more in the future. > >> > >> I would not, either. This however is a problem with the package builder > >> and ports infrastructure, which would need some install hooks to allow > >> a check at installation time. > >> > > That is totally wrong, that is a python bug (python is not the only =20 > > one in that > > case). >=20 > It is not wrong. You just misunderstood me. >=20 > > The ports have only be design for source installation, problem is =20 > > when you are > > buidling packages properly each packages are being done in a cleanroom = aka a > > jail without anything installed in it that makes python 3.3 port think = it is > > becoming the default because no other python are installed at that time. > > > > This result in all python port defining bin/python, and thus they =20 > > _do_ conflict > > with each other. While this was/is silent with pkg_install, pkgng =20 > > yell about it. >=20 > On the port level, yes, with the IF_DEFAULT conditional. > We have lang/python, which acts as wrapper; what conditional in > the package builder triggers either port of lang/pythonXX to install itse= lf > as default (except for the current default version defined in bsd.python.= mk, > which uses _PYTHON_PORTBRANCH for that)? If I closely follow the port log= ic, > only lang/python27 should be picked as default, if no specific flags are > provided. Or I'm missing something obvious in the bsd.python.mk logic. >=20 > > > > A fun thing you can do with pkg_install (in binary mode only no =20 > > compilation from > > sources and with packages built in a cleanroom) > > # pkg_add -r python27 > > default is now python27 > > # pkg_add -r python33 > > default is now python33 > > # pkg_delete python27 > > hey I have no default python anymore. >=20 > If that is really the case (I can only confirm that for lang/python27), > let's get it fixed on the bsd.python.mk and lang/pythonXX level and let > lang/python do the magic, which it is supposed to do. >=20 > > Java is solving the problem by using a javawrapper. There is 3 =20 > > possible way to > > solve the situation with python, move the symlink dancing into a post i= nstall > > script. Have a javawrapper like thing. >=20 > The post-install script is what I was talking about above. So we both =20 > mean the same. > Anyways, we have lang/python, which would be the best place in my opinion. My appologies, I was remembering the old time and this has been fixed since. I have been able to properly install python33 along with python27 from bina= ries without any conflicts. I was speaking of an old time, this has been fixed f= or a while now, sorry about the noise, and thanks for the fix. regards, Bapt --/Isdj7O9hWi8F9Bn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlH2WpoACgkQ8kTtMUmk6Ew/sACgwxzjrH0/HDFKqcXAwCZY2+Ys PnQAoLkfVO/kq7KghPfqUzLLIkI8YUOM =p5QE -----END PGP SIGNATURE----- --/Isdj7O9hWi8F9Bn--