Date: Tue, 13 Dec 2016 22:36:53 +1100 From: Kubilay Kocak <koobs@FreeBSD.org> To: "Vlad K." <vlad-fbsd@acheronmedia.com>, freebsd-python@freebsd.org Subject: Re: lang/python3* ports, __pycache__ included Message-ID: <e1794d8c-9dd0-80b5-e045-3953cd7af8aa@FreeBSD.org> In-Reply-To: <f2f8f2765108cafb3f0c1b931e6314a1@acheronmedia.com> References: <CACNAnaEueRdkEuuf9MmZwqqaz8HB6hSW14a_VmqZ9%2B8ub3235g@mail.gmail.com> <ema74d97cd-d111-4740-909d-419a4d12c8a6@hora> <CACNAnaF1=D-P0ZTbZP7Wt=BBoWwmDnwe=-mRmz%2Bga_H__zk4-g@mail.gmail.com> <fef69799-bee5-d836-70cf-d928707ccfdb@FreeBSD.org> <f2f8f2765108cafb3f0c1b931e6314a1@acheronmedia.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 13/12/2016 10:08 PM, Vlad K. wrote: > On 2016-12-13 11:59, Kubilay Kocak wrote: >> >> Note that they will be re-created on import unless one overrides >> the default for the interpreter to produce these optimization >> files. > > Depends. Those modules are installed in a root owned directory, and > the bytecode cache will get created only if you run (import is enough > as you say) those modules as root, because the cache is written in > the module package directory. > > So pre-packaging the bytecode is a form of optimization, as the > bytecode will be there when you run it as an unprivileged user. > > > I left out "... if the thing you're running can write to site-packages" because the second law of thermodynamics (or rather the proclivity of python software and users to use root) basically guarantees that *if* they can be generated, they eventually *will* be generated. My main point was that if disk utilisation is something one wants to minimise (at deployment), that one would need to be able to turn the optimization knob off each time (or system-wide) and that that would be a handy thing to know and do. Said another way, even if we (FreeBSD) de-packaged optimization files which we want to do, that that *by itself* that would only save package repository size and bandwidth, not deployment size. ./koobs
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e1794d8c-9dd0-80b5-e045-3953cd7af8aa>