classification
Title: build with --prefix=/dev/null and zlib enabled in Modules/Setup failed
Type: compile error Stage: needs patch
Components: Build Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, georg.brandl, loewis, petri.lehtinen, pitrou, r.david.murray, ysj.ray
Priority: normal Keywords:

Created on 2011-04-27 10:09 by ysj.ray, last changed 2013-10-13 18:35 by georg.brandl. This issue is now closed.

Messages (9)
msg134544 - (view) Author: ysj.ray (ysj.ray) Date: 2011-04-27 10:09
The development guide(http://docs.python.org/devguide/setup.html) suggested that one can build with "--prefix=/dev/null" in order to avoid accidentally install it. But in the Modules/Setup.dist the zlib module is defined as:

zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

So configure with "--prefix=/dev/null " and enable zlib in Module/Setup and then make results in such error: (debian 5)

cc1: error: /dev/null/include: Not a directory


Not sure if this is really a problem. But I need to modify the Module/Setup zlib line to
"""
zlib zlibmodule.c -L$(exec_prefix)/lib -lz
"""
instead of just uncomment it to make my build process success. I think it's better to be improved.
msg137456 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-06-01 19:20
Well, IIUC the Setup lines indicate where to find the system version of the libraries (otherwise the included zlib is used).  So I'm not at all sure that there is a bug here.  If you change Setup, you need to change it correctly for your intended installation.
msg137651 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-04 15:42
Isn’t zlib built by setup.py anyway?
msg138316 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-06-14 14:34
Well, using $(prefix)/include to fetch development headers sounds like the wrong strategy anyway. Just because you e.g. install into /usr/local doesn't mean your zlib is inside /usr/local too.

And if that makes people use our own zlib headers by mistake, then it's doubly wrong IMO.
msg138359 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-06-15 08:17
FWIW, I recall that I built 2.7 a while back with --prefix=/home/user/something and it also failed to find zlib. Due to lack of time, I didn't debug it very deeply then, though.
msg138370 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-06-15 13:45
I normally build using --prefix, often with --prefix=/dev/null, and I can't recall any version not building zlib.  Of course, I don't uncomment the zlib entry in Modules/Setup.

As far as I can see the zlib entry is unique in Setup in using prefix, so it probably is a bug (or, rather, a holdover from when there were various issues with the platform zlib).
msg138379 - (view) Author: ysj.ray (ysj.ray) Date: 2011-06-15 14:47
Isn’t zlib built by setup.py anyway?


If can be build by Modules/Setup first as a builtin module, then the setup.py woun't build it.
msg141049 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-07-24 18:09
ysj.ray:

As you're on Debian, the real cause of this might be issue 11715. The Modules/Setup.dist line for zlib is commented out, so it's only an example of how to enable zlib if it's not found automatically.

Can you try again now that issue 11715 has been fixed?
msg199759 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2013-10-13 18:35
Closing due to lack of feedback.
History
Date User Action Args
2013-10-13 18:35:01georg.brandlsetstatus: pending -> closed

nosy: + georg.brandl
messages: + msg199759

resolution: works for me
2011-07-24 18:09:21petri.lehtinensetstatus: open -> pending

messages: + msg141049
2011-06-15 14:47:06ysj.raysetmessages: + msg138379
2011-06-15 13:45:34r.david.murraysetmessages: + msg138370
versions: - Python 2.6, Python 3.1
2011-06-15 08:17:43petri.lehtinensetmessages: + msg138359
2011-06-14 14:34:08pitrousetnosy: + pitrou, loewis

messages: + msg138316
stage: needs patch
2011-06-14 06:27:16petri.lehtinensetnosy: + petri.lehtinen
2011-06-04 15:42:40eric.araujosetstatus: pending -> open

nosy: + eric.araujo
messages: + msg137651

resolution: not a bug -> (no value)
2011-06-01 19:20:35r.david.murraysetstatus: open -> pending

nosy: + r.david.murray
messages: + msg137456

resolution: not a bug
2011-06-01 06:31:55terry.reedysetversions: - Python 2.5
2011-04-27 10:09:31ysj.raycreate