classification
Title: make install DESTDIR=/home/blah fails when the prefix specified is /
Type: behavior Stage: test needed
Components: Distutils, Distutils2 Versions: Python 3.3, Python 3.2, Python 2.7, 3rd party
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, anacrolix, eric.araujo, mailtome, r.david.murray, rpetrov, tarek
Priority: normal Keywords: patch

Created on 2010-08-24 19:19 by mailtome, last changed 2011-06-15 14:23 by eric.araujo.

Files
File name Uploaded Description Edit
python-destdir.patch mailtome, 2010-08-24 19:19
fix-root-prefix.patch anacrolix, 2011-06-14 05:37
Messages (11)
msg114804 - (view) Author: aj (mailtome) Date: 2010-08-24 19:19
I tried to install python with make install DESTDIR=/home/blah 
./python -E ./setup.py install \ 
                --prefix=/ \ 
                --install-scripts=//bin \ 
                --install-platlib=//lib/python2.6/lib-dynload \ 
                --root=//home/blah 
running install 
running build 
running build_ext 
INFO: Can't locate Tcl/Tk libs and/or headers 
Failed to find the necessary bits to build these modules: 
_tkinter           bsddb185           dl 
imageop            sunaudiodev 
To find the necessary bits, look in setup.py in detect_modules() for 
the module's name. 
running build_scripts 
running install_lib 
creating /lib/python2.6 
error: could not create '/lib/python2.6': Permission denied 
make: *** [sharedinstall] Error 1 

I asked for help on the mailing list http://groups.google.com/group/comp.lang.python/browse_thread/thread/a0b0e49f7b8153d1#, and according to Martin v. Loewis  	
"If you have / as the prefix, you get two leading slashes, e.g. for 
//lib/python2.x. Any other prefix would have given you only a single 
slash: e.g. if it had been /usr, then you end up with /usr/lib/python2.x. 
Now, the code strips the first character to make it a relative path name 
(so that join can be used), which fails to work correctly if there are 
two leading slashes. "

I have attached the patch provided by him.
msg114851 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-24 23:37
Thank you for the report. I’m not sure I understand the bug.

1) On my linux-based system, doing something on //dir is the same thing as /dir. Is this a cosmetic bug (IOW, you’d like to see /dir and not //dir)?

2) Since I’m not root, creating /lib/python2.6 fails, as it should. (Note that distutils only prints one slash, which is nice.) What is the bug?

3) It’s not clear in your past whether you ran with DESTDIR=/ or  DESTDIR=/home/blah. Can you tell what you want to do and what is the bug?

Thanks again for the report.
msg114853 - (view) Author: aj (mailtome) Date: 2010-08-25 00:13
I ran
./configure --prefix=/
make
make install DESTDIR=/home/blah 
The installation tries to install at /lib/python2.6 which fails because I am not root. It should not try to install anything at / because I specified DESTDIR as /home/blah.
msg114854 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-25 00:24
Thanks for the clarification. Can you test the bug with the versions that are still open for bug fixes, that is 2.7, 3.1 and 3.2?

I’ll add tests and apply the original patch in distutils2. (distutils is frozen except for bug fixes, which this minor cosmetic change is not.)

I’m not a configure or make expert, so I’ll request help from other developers when we have more information.
msg114857 - (view) Author: aj (mailtome) Date: 2010-08-25 00:44
Thanks for the reply Eric. It is not a cosmetic thing. It's a bug for sure in python-2.6 disutils. I will try out python-2.7, 3.1, 3.2 and update the bug.
msg114861 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-25 00:57
I have no certitude, but a strong intuition that distutils is not guilty at all here, but the makefile is. When I talk about the cosmetic bug, I refer to the double slash thing.
msg114903 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-08-25 13:33
See also issue1676135.  Seems that the posters were wrong in concluding that the double slashes wouldn't bother anyone using prefix=/ :)
msg117679 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-30 00:25
Re-adding distutils since we’re not sure the bug does not apply there.

aj, have you add time to test it?
msg138291 - (view) Author: Matt Joiner (anacrolix) Date: 2011-06-14 05:08
Just ran into this bug myself with 3.2. Apparently this patch works: http://groups.google.com/group/comp.lang.python/msg/bd8818ab9d4af8d7
msg138292 - (view) Author: Matt Joiner (anacrolix) Date: 2011-06-14 05:37
Attached a patch that fixes it, only the line numbers have changed from Martin v. Loewis's patch. Used on 3.2.
msg138374 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-15 14:23
Thanks.  Have you run the test suite to make sure this doesn’t add bugs?
History
Date User Action Args
2011-06-15 14:23:33eric.araujosetversions: + Python 3.3, - Python 3.1
messages: + msg138374

assignee: tarek -> eric.araujo
components: - Build, Installation, Library (Lib)
type: compile error -> behavior
stage: test needed
2011-06-14 05:38:29anacrolixsetnosy: + alexis
type: behavior -> compile error
components: + Build, Library (Lib)
2011-06-14 05:37:15anacrolixsetfiles: + fix-root-prefix.patch

messages: + msg138292
2011-06-14 05:08:52anacrolixsetnosy: + anacrolix
messages: + msg138291
2010-09-30 00:25:05eric.araujosetversions: + 3rd party
nosy: tarek, eric.araujo, rpetrov, r.david.murray, mailtome
messages: + msg117679

assignee: tarek
components: + Distutils
2010-08-25 15:35:26rpetrovsetnosy: + rpetrov
2010-08-25 13:33:26r.david.murraysetnosy: + r.david.murray
messages: + msg114903
2010-08-25 00:57:37eric.araujosetmessages: + msg114861
2010-08-25 00:44:56mailtomesetmessages: + msg114857
2010-08-25 00:24:27eric.araujosetassignee: tarek -> (no value)
messages: + msg114854
components: - Distutils
nosy: tarek, eric.araujo, mailtome
2010-08-25 00:15:14mailtomesettitle: make install DESTDIR=/ fails -> make install DESTDIR=/home/blah fails when the prefix specified is /
2010-08-25 00:14:00mailtomesetmessages: + msg114853
2010-08-24 23:37:20eric.araujosetnosy: + eric.araujo, tarek
versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
messages: + msg114851

assignee: tarek
components: + Distutils, Distutils2
type: compile error -> behavior
2010-08-24 19:19:45mailtomecreate