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: absolute paths cause problems for MSVC
Type: Stage:
Components: Distutils Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: eaj, loewis, mdehoon
Priority: normal Keywords: patch

Created on 2003-10-21 09:11 by eaj, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch.diff eaj, 2003-10-21 09:11
Messages (3)
msg44810 - (view) Author: eric jones (eaj) Date: 2003-10-21 09:11
When source files are given in the form:

c:\foo\bar.c

the object file is written to:

c:\foo\bar.o

instead of the build\temp.win32-2.3 directory.  This is 
because the object_filenames method doesn't chop off 
the drive name from source file name base before trying 
to concatenate the build directory with the base.  This 
results in the build directory being ignored.  The 
ccompiler.py object_filenames does it right, so I just 
copied its behavior.  
msg44811 - (view) Author: Michiel de Hoon (mdehoon) * Date: 2005-05-01 09:20
Logged In: YES 
user_id=488897

I have tested your patch and found that it works as intended.
I am a bit surprised about the approach taken in ccompiler.py:
1) Using absolute paths is not portable, so I'm not sure why
somebody would want to do that.
2) With this patch, If the source file is in c:\foo\bar.c,
then the object file is written to
build\temp.win32-2.3\Release\foo\bar.o. However, if the
source file is written with a relative patch ("bar.c"), the
object file is written to build\temp.win32-2.3\Release\bar.o
(so without "foo"). Hence, even though the source file bar.c
is in the exact same location in these two cases, the object
file ends up in a different location depending on whether
the path is specified as absolute or relative. Is that
really what we want?

But I agree that the behavior of msvccompiler.py and
ccompiler.py should be consistent.
msg44812 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-08-07 20:52
Logged In: YES 
user_id=21627

The original problem was apparently #668662, which caused
the introduction of support for absolute paths in
ccompiler.py. It's not clear in that report why anybody
would use absolute paths in setup.py, but apparently, f2py
would generate setup files that use absolute paths.

Integrating the entire path into the Release directory is
intentional, since the same source file name may occur
multiple times for the same project (in different directories).

Thanks for the patch and the review, committed as

msvccompiler.py 1.64.2.4
NEWS 1.1193.2.69
msvccompiler.py 1.69
NEWS 1.1330


History
Date User Action Args
2022-04-11 14:56:00adminsetgithub: 39436
2003-10-21 09:11:04eajcreate