Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2013 19:28:26 +0100
From:      Marcus von Appen <mva@FreeBSD.org>
To:        python@FreeBSD.org
Subject:   Re: bsd.python.mk: python3 plist shim
Message-ID:  <20130123182826.GB1978@medusa.sysfault.org>
In-Reply-To: <5100273E.6010300@yandex.ru>
References:  <50FFD7C0.9060208@yandex.ru> <20130123165053.GA1978@medusa.sysfault.org> <5100273E.6010300@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--IrhDeMKUP4DT/M7F
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

On, Wed Jan 23, 2013, Ruslan Makhmatkhanov wrote:

> Marcus von Appen wrote on 23.01.2013 20:50:
> > Hi,
> >
> > On, Wed Jan 23, 2013, Ruslan Makhmatkhanov wrote:
> >
> >>
> >> Hello,
> >>
> >> I'm planning to apply this patch to Mk/bsd.python.mk soon. It's an
> >> nivit's solution from devel/py-virtualenv for changes, introduced in PEP
> >> 3147 [1]. It will not affect default packages build, because packages
> >> are not yet building for python3 on cluster, but it will affect python
> >> ports, built with python3, that already has fix like that applied
> >> locally. I tested it with dozen of ports and everything seems fine.
> >> Local fixes will be removed right after this change. Please tell me if
> >> there is any objections or suggestions on this. Thanks.
> >
> > [...]
> >
> > I still do not get what the patch should exactly do and I am too lazy to
> > refresh my awk skills and try it out myself. If that patch is just about
> > the [INSERT cpython-correct-XX].pyc stuff, there is no need for it in my
> > opinion.
> > Can you please provide details on what the patch does?
> >
> > Cheers
> > Marcus
>
> Yes, it does just that by adding __pycache__ directories with compiled
> and optimized bytecode into pkg-plist. This allows us to make packages
> for python 3.2+ successfully.
>
> I can't explain more than that, because I treat that as some magic
> sequence for fixing py3 packages and that already applied locally in
> many ports, so it's time to just stop duplicating this pattern over the
> tree.
[...]

Okay, understood. If we have a pkg-plist with a file entry

/path/foo.pyc

it changes the file path in .TMPPLIST to

/path/__pycache__/foo<magicno>.pyc

without the need for us to fix up hundreds of plist files, correct?

Is that automated patch safe for pkg usage? As far as I remember, pkg
picks up .TMPPLIST rather than pkg-plist or anything else, so I assume
it to be safe and working without any problem, but we should follow up
on that with the pkg@ team, if you did not verify that already.

Also, we have to bear in mind existing python3.2+ ports within the ports
tree, for which the pkg-plist files might need a cleanup regarding the
already existing __pycache__ entries (or does the patch deal with them
properly?).

And just to throw in something else: we really, really should support
$PYTHONDONTWRITECODE (or the -B flag), remove all the pyc/pyo stuff
completely from the pkg-plist files and move the logic conditionally
into bsd.python.mk (somewhat similar to your patch)[0].

Would it make sense to merge that idea[0] with your patch?

[0] https://wiki.freebsd.org/Ports/Python/CompiledPackages
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/168640

Cheers
Marcus

--IrhDeMKUP4DT/M7F
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlEAK8oACgkQi68/ErJnpkd0oQCfXxlcYuAG6SRcHyWUso9VygXk
UWAAmgIEm9QyFI8Xj9dZcvQsHjBRKyPs
=4l3M
-----END PGP SIGNATURE-----

--IrhDeMKUP4DT/M7F--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130123182826.GB1978>