From owner-freebsd-ports@FreeBSD.ORG Mon Jul 29 10:44:23 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 B7D2A936; Mon, 29 Jul 2013 10:44:23 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13F7D2C88; Mon, 29 Jul 2013 10:44:22 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id hi8so911343wib.3 for ; Mon, 29 Jul 2013 03:44:21 -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=8hHL2LaxQVszSw5M0TtEVIQhu8iHhLh3/uPf4SxXCQQ=; b=z5p0Sbn+izsyqKb20t+0GQkoJHbaHARIQKmdcVsQa9HTta/3wG7UqXTcefDNMmJWCt cEHxDnwHpg83nlOExk8n3z6jnscWNvErnZjC4SRRxXw3NESONDaQjV2FzXUxPMGdCi5r p1YqtDCvrl8wp+7VakaOfwMaP2DrANG0h+GWhRak6yqPKQ8SbWWrMWBDCsLCbGt3S69n UdaTqBN0X52zwfbv/5ot7E4LxSdWdVKGsljYv8qpA+6uS8KU5rIvPqpj6YYl0uJjEJ7g 5liLANNcY4A/BJRkCqgx+ZMQeQta4HbemnpN9J+jjeBNNh8D5msiBBogCBnn3r6MyiCn 3PCA== X-Received: by 10.180.11.6 with SMTP id m6mr9542765wib.0.1375094661200; Mon, 29 Jul 2013 03:44:21 -0700 (PDT) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id i1sm21596307wiz.6.2013.07.29.03.44.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 29 Jul 2013 03:44:20 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 29 Jul 2013 12:44:17 +0200 From: Baptiste Daroussin To: Marcus von Appen Subject: Re: python 2 and 3 modules Message-ID: <20130729104417.GQ98542@ithaqua.etoilebsd.net> References: <20130729110145.Horde.vaUlaCnJ-q1VD1He43pO6Q8@webmail.df.eu> <20130729122624.Horde.SUzy4e5lddiAJOw5KSFogg6@webmail.df.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gblAvmLjk8yGG9If" Content-Disposition: inline In-Reply-To: <20130729122624.Horde.SUzy4e5lddiAJOw5KSFogg6@webmail.df.eu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: David Demelier , ports@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 10:44:23 -0000 --gblAvmLjk8yGG9If Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 29, 2013 at 12:26:24PM +0200, Marcus von Appen wrote: > David Demelier : >=20 > > 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 compla= in > >>>> 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 ${PAT= H}, > >>>> in the > >>>> # format "python2.0". Set th= is in > >>>> your > >>>> makefile in case you > >>>> # want to build extensions w= ith > >>>> an > >>>> older binary. > >>>> # default: depends on the ve= rsion > >>>> 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 need 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 might > >> become > >> more difficult. It was discussed some time ago on the freebsd-python m= ailing > >> list > >> without an applicable result. > >> > >> If you need to have the same Python module for different versions arou= nd, I > >> would > >> recommend to use virtualenv in favour of the ports infrastructure, sin= ce > >> > >> 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. >=20 > 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. >=20 That is totally wrong, that is a python bug (python is not the only one in = that case). The ports have only be design for source installation, problem is 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 _do_ conf= lict with each other. While this was/is silent with pkg_install, pkgng yell abou= t it. =20 A fun thing you can do with pkg_install (in binary mode only no 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. Java is solving the problem by using a javawrapper. There is 3 possible way= to solve the situation with python, move the symlink dancing into a post insta= ll script. Have a javawrapper like thing. I would love to see a generic alternative/eselect/javawrapper-like thing ap= pear that can handle all of this what ever the kind of port is. To be back to the subject this is really a ports problem, because noone was until now really using the binary only packages, and the one doing it have = never analyzed what they really do once installed. regards, Bapt --gblAvmLjk8yGG9If Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlH2R4EACgkQ8kTtMUmk6ExG2wCghZultwxJHVbc25eDlEckWJS7 CBsAn2A01cAQJrSbb+tI0fO3ViVKg+bY =c6k3 -----END PGP SIGNATURE----- --gblAvmLjk8yGG9If--