Summary: | Mk/bsd.python.mk: PYTHONOPTIMIZE=1 in environ(7) breaks plist | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | swell.k <swell.k> |
Component: | Individual Port(s) | Assignee: | freebsd-python (Nobody) <python> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
swell.k
2010-05-25 09:10:00 UTC
Responsible Changed From-To: freebsd-ports-bugs->perky bsd.python.mk is perky territory (via the GNATS Auto Assign Tool) Responsible Changed From-To: perky->freebsd-python Currently maintained by python mailing list. Hi, When set PYTHONOPTIMIZE=1, that enable python use the optimize mode, just as run python with -O args. And when python run with -O args, it compile .py source file directly to .pyo file but without .pyc file. It will lead to the pkg-plist error that you mentioned. So it is not a bug in bsd.python.mk. Maybe we can resolve it by: 1) Add a pkg-plist variable PYTHONOPT in bsd.python.mk: PLIST_SUB+= PYTHONOPT=${PYTHONOPT} 2) set PYTHONOPT='' when PYTHONOPTIMIZE is not defined and set it to "@comment" when it is defined. 3) Add %%PYTHONOPT%% to all lines ended with .pyc in pkg-plist file But I do not think it is a good way to resolv it and currently I could not find a simple way to resolv it. Maybe the best way is just let it be? :) wen wen heping <wenheping@gmail.com> wrote: > Maybe we can resolve it by: > 1) Add a pkg-plist variable PYTHONOPT in bsd.python.mk: > PLIST_SUB+= PYTHONOPT=${PYTHONOPT} > 2) set PYTHONOPT='' when PYTHONOPTIMIZE is not defined and > set it to "@comment" when it is defined. > 3) Add %%PYTHONOPT%% to all lines ended with .pyc in pkg-plist file > > But I do not think it is a good way to resolv it and currently I could not > find a simple way to resolv it. Maybe the best way is just let it be? :) Why not simply remove PYTHONOPTIMIZE from the environment when it is set, or override it to be =""? Then you will always get the standard behaviour, i.e. both .pyc and .pyo will be created, and no change to the plist is necessary. If you want to make the creation of .pyc and/or .pyo files configurable, it should be done properly with the OPTIONS framework, with two settings, for example CREATE_PYC and CREATE_PYO, which should both default to ON. But I really don't think this is required ... I can't think of a reason why a user wouldn't want to have both installed. Disk space shouldn't be an issue nowadays. And on restricted hardware (such as small or embedded systems) you will probably create a hand-crafted installation anyway, omitting more than just the .pyc files which account for less than 25% of the size of the package. Anyawy, my point is that variables from the user's environment should not accidentally affect the contents of the package. Therefore I think that the Python ports makefile should unset or override the PYTHONOPTIMIZE variable. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs." -- Robert Firth mva 2012-06-17 12:28:19 UTC FreeBSD ports repository Modified files: Mk bsd.python.mk Log: - Ensure that PYTHONOPTIMIZE and PYTHONDONTWRITEBYTECODE are ignored on using PY_DISTUTILS to avoid plist corruptions PR: ports/146957 Reported by: swell.k@gmail.com On behalf of: python@ Revision Changes Path 1.147 +2 -2 ports/Mk/bsd.python.mk _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org" State Changed From-To: open->closed A fix has been applied. Thanks for noticing! |