[Patches] [ python-Patches-718049 ] Setting exe_extension for cygwin

SourceForge.net noreply@sourceforge.net
Mon, 14 Apr 2003 06:00:57 -0700


Patches item #718049, was opened at 2003-04-08 23:45
Message generated for change (Comment added) made by jlt63
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=718049&group_id=5470

Category: Distutils and setup.py
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Michiel de Hoon (mdehoon)
Assigned to: Jason Tishler (jlt63)
Summary: Setting exe_extension for cygwin

Initial Comment:
On cygwin, the setup.py script uses unixccompiler.py
for compiling and linking C extensions. The
unixccompiler.py script assumes that executables do not
get special extensions, which makes sense for Unix.
However, on Cygwin, executables get an .exe extension.

This causes a problem during the configuration step
(python setup.py config), in which some temporary
executables may be generated. As unixccompiler.py does
not know about the .exe extension, distutils fails to
clean up after itself: it does not remove
_configtest.exe but tries to remove _configtest instead.

The attached patch to unixccompiler.py sets the correct
exe_extension for cygwin by checking if sys.platform is
'cygwin'. With this patch, distutils cleans up after
itself correctly.

Michiel de Hoon
University of Tokyo, Human Genome Center.

----------------------------------------------------------------------

>Comment By: Jason Tishler (jlt63)
Date: 2003-04-14 05:00

Message:
Logged In: YES 
user_id=86216

loewis> Jason, any opinion?

This patch seems fine to me -- at least, it does
not break the Cygwin Python build. I'm willing to
apply.

mdehoon> I don't know why unixccompiler is being
mdehoon> used,

>From my point of view, Cygwin is just another
Unix. So, it should use UnixCCompiler and not
CygwinCCompiler.

mdehoon> you'd have to ask the person who
mdehoon> wrote unixccompiler / cygwinccompiler.

IIRC, Rene Liebscher is the author of
CygwinCCompiler. Is he still around?

loewis> Can you explain wh unixccompiler is used?
loewis> cygwincompiler should be used instead...

See above. I always thought that CygwinCCompiler
and Mingw32CCompiler where used to build Win32
Python extensions with gcc. Although, I must admit
to never understanding the use for
CygwinCCompiler. I must be missing something...

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-04-12 03:30

Message:
Logged In: YES 
user_id=21627

Jason, any opinion?

----------------------------------------------------------------------

Comment By: Michiel de Hoon (mdehoon)
Date: 2003-04-12 03:16

Message:
Logged In: YES 
user_id=488897

I don't know why unixccompiler is being used, you'd have to
ask the person who wrote unixccompiler / cygwinccompiler.
If I use "python setup.py build" on cygwin, it uses
unixccompiler. I can force it to use cygwinccompiler by using
"python setup.py build --compiler=cygwin". (BTW, that
currently seems to be broken, the compilation fails during
the linking stage). My guess is that if unixccompiler works
on cygwin (which it does, except for the cleanup problem),
there is no reason to have a separate cygwinccompiler.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-04-12 02:40

Message:
Logged In: YES 
user_id=21627

Can you explain wh unixccompiler is used? cygwincompiler
should be used instead...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=718049&group_id=5470