Opened 5 days ago
Last modified 4 days ago
#836 new defect
export PYTHONOPTIMIZE=2 breaks make install
Reported by: | Дилян Палаузов | Owned by: | Richard Boulton |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.27 |
Component: | Xapian-bindings (Python) | Version: | 1.4.26 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Operating System: | All |
Description
In my chroot/virtualenv I use only PYTHONOPTIMIZE=2
, so I want to utilize it also when installing xapian-bindings for python3. Calling
export PYTHONOPTIMIZE=2 ./configure --with-python3 --prefix=/home/mailmanweb PYTHON3_LIB=/home/mailmanweb/lib/python3.10/site-packages make install
fails with
/usr/bin/mkdir -p '/home/mailmanweb/lib/python3.10/site-packages/xapian' /usr/bin/install -c -m 644 xapian/__init__.py ../../python3/xapian/__pycache__/__init__.cpython-310.pyc xapian/__pycache__/__init__.cpython-310.opt-2.pyc '/home/mailmanweb/lib/python3.10/site-packages/xapian' /usr/bin/install: cannot stat '../../python3/xapian/__pycache__/__init__.cpython-310.pyc': No such file or directory make[4]: *** [Makefile:822: install-pkgpylibDATA] Error 1
Indeed, make
has created python3/xapian/__pycache__/__init__.cpython-310.opt-2.pyc
and there is no python3/xapian/__pycache__/__init__.cpython-310.pyc
file.
Change History (2)
comment:1 by , 4 days ago
Milestone: | → 1.4.27 |
---|---|
Version: | → 1.4.26 |
comment:2 by , 4 days ago
The simplest fix is probably for us to override PYTHONOPTIMIZE for that command.
I want to install __pycache__/__init__.cpython-310.opt-2.pyc
and not to create or install __pycache__/__init__.cpython-310.pyc
.
Note:
See TracTickets
for help on using tickets.
It looks like the problem here is that forcing
PYTHONOPTIMIZE=2
also affects the command which is trying to generate an unoptimised.pyc
and we instead generatexapian/__pycache__/__init__.cpython-312.opt-2.pyc
twice.The simplest fix is probably for us to override
PYTHONOPTIMIZE
for that command.If you want a workaround for current releases then not setting
PYTHONOPTIMIZE=2
and doingsed -i 's/$(PYTHON3) -O/&2/' python3/Makefile
afterconfigure
but beforemake
should work.