This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail
Type: compile error Stage: resolved
Components: Build, Windows Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder: Cygwin is unsupported - close all open issues and list them here.
View: 45537
Assigned To: jlt63 Nosy List: jlt63, rpetrov
Priority: low Keywords: patch

Created on 2008-03-04 17:47 by jlt63, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python.patch jlt63, 2008-03-04 17:47 Remove extra slashes Makefile.pre.in patch
Makefile.pre.in.diff jlt63, 2009-01-08 15:00
py-issue-2233.patch rpetrov, 2009-01-13 22:12 shell based solution review
Makefile.pre.in.v2.diff jlt63, 2009-01-14 15:42
Messages (12)
msg63256 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2008-03-04 17:47
Makefile.pre.in contains extra slash before $(DESTDIR) in two locations
as in the following:

sharedinstall:
    $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
        --prefix=$(prefix) \
        --install-scripts=$(BINDIR) \
        --install-platlib=$(DESTSHARED) \
        --root=/$(DESTDIR)

This causes Cygwin builds to fail if DESTDIR is set as follows:

creating //tmp
error: could not create '//tmp': No such host or network path

The following Open Group Specification:

http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html

indicates the following:

4.11 Pathanme Resolution 

[snip]

A pathname that begins with two successive slashes may be interpreted
in an implementation-defined manner,...

IMO, these extra slashes should be removed as indicated in the
attached patch.  OK to commit?  If so, to which branches?
msg78715 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-01-01 18:30
I would like to confirm issue for trunk.
msg78725 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-01-01 20:11
I'm not sure that installation work if slash is removed and DESTDIR is
not specified. What about to replace "slash before $(DESTDIR)" with "/./" ?
msg79413 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2009-01-08 15:00
Sorry for the delay, but I was on vacation and then recovering from 
vacation...

You are correct that my initial patch does not handle the case when 
DESTDIR is not specified.  Your suggestion will work, but seems hacky.

What about adding the defaulting of DESTDIR to "/" to my initial 
patch?  This seems cleaner.  See my second patch for the details.

If this approach is acceptable, then feel free to move the defaulting 
of DESTDIR to a more appropriate place in Makefile.pre.in.  I wasn't 
sure where to put this change.
msg79567 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-01-10 18:17
Jason, did you test what is result is DESTDIR default to "/".

This variable(macro) is used with specific syntax by example (from
Makefile):
  $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
where $$b is absolute path.
msg79704 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2009-01-12 21:47
Obviously not... :,(

It seems like we might have to go with your "/./" workaround, but let 
me see if I can come up with another approach.
msg79855 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2009-01-14 15:42
Your latest patch is on the right track, but see my latest one, 
Makefile.pre.in.v2.diff, for an optimization.  I tested make install 
with and without DESTDIR defined on the command line and both cases 
behaved as expected.
msg79874 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-01-14 20:37
Hi Jason,
quick review without tests - I expect $${DESTDIR:-/} to work without :
in expression, i.e. just $${DESTDIR-/}.

The ":" in expression is not so portable (some shells fail on this).
Please see "Shell Substitutions" in autoconf manual.
msg79877 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2009-01-14 21:58
I guess you mean the following:

${var:-value} 
Old BSD shells, including the Ultrix sh, don't accept the colon for 
any shell substitution, and complain and die.

If so, should we just go forward without the colon?  The bash manpage 
indicates the following:

In each of the cases below, ... bash tests for a parameter that is 
unset or null; omitting the colon results in a test only for a 
parameter that is unset.

So, if a user executes "make DESTDIR= install", then the build will 
fail. Or, maybe we shouldn't worry about that corner case.

What do you think?
msg80350 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-01-21 21:55
No response from py-dev list :( . May be solution has to work in all cases.
msg222604 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-09 07:33
Is this still a problem with cygwin?
msg222658 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2014-07-10 12:10
AFAICT, yes.
History
Date User Action Args
2022-04-11 14:56:31adminsetgithub: 46486
2021-10-21 09:56:42iritkatrielsetresolution: duplicate -> wont fix
2021-10-20 12:19:58iritkatrielsetstatus: open -> closed
superseder: Cygwin is unsupported - close all open issues and list them here.
resolution: duplicate
stage: resolved
2019-04-26 18:48:13BreamoreBoysetnosy: - BreamoreBoy
2014-07-10 12:10:52jlt63setmessages: + msg222658
2014-07-09 07:33:09BreamoreBoysetnosy: + BreamoreBoy

messages: + msg222604
versions: + Python 3.4, Python 3.5, - Python 3.1, Python 3.2
2010-08-10 11:40:21floxsetkeywords: patch, patch
components: + Windows
2010-08-04 23:31:34terry.reedysetkeywords: patch, patch
versions: + Python 3.2, - Python 2.6, Python 2.5, Python 3.0
2009-01-21 21:55:43rpetrovsetmessages: + msg80350
2009-01-14 21:58:36jlt63setkeywords: patch, patch
messages: + msg79877
2009-01-14 20:37:27rpetrovsetmessages: + msg79874
2009-01-14 15:42:16jlt63setkeywords: patch, patch
files: + Makefile.pre.in.v2.diff
messages: + msg79855
2009-01-13 22:12:52rpetrovsetfiles: + py-issue-2233.patch
2009-01-12 21:47:16jlt63setkeywords: patch, patch
messages: + msg79704
2009-01-10 18:17:37rpetrovsetmessages: + msg79567
2009-01-08 15:00:05jlt63setkeywords: patch, patch
files: + Makefile.pre.in.diff
messages: + msg79413
2009-01-01 20:11:54rpetrovsetmessages: + msg78725
2009-01-01 18:30:54rpetrovsetnosy: + rpetrov
messages: + msg78715
versions: + Python 2.6, Python 3.0, Python 3.1, Python 2.7
2008-03-04 19:23:09jlt63setkeywords: patch, patch
2008-03-04 17:47:50jlt63create