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.

Author mloskot
Recipients mloskot
Date 2014-05-08.09:03:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399539822.8.0.0455279031899.issue21452@psf.upfronthosting.co.za>
In-reply-to
Content
While building Python 3.2 or Python 3.4 with Visual Studio 2013 on Windows 8.1, pythoncore.vcxproj fails to build due to illformed pre-link event command.
(FYI, I have upgraded all .vcxproj files to VS2013 locally.)

Here is the command and the error:

<pre>
1>PreLinkEvent:
1>  Description: Generate build information...
1>  cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL -D_DEBUG -MDd ..\Modules\getbuildinfo.c -Fo"D:\tmp\Python-3.4.0-vs2013\PCbuild\Win32-temp-Debug\pythoncore" \getbuildinfo.o" -I..\Include -I..\PC
1>  getbuildinfo.c
1>..\Modules\getbuildinfo.c(1): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
</pre>


Notice the superfluous double quote followed by whitespace in the following argument:

<pre>
-Fo"D:\tmp\Python-3.4.0-vs2013\PCbuild\Win32-temp-Debug\pythoncore" \getbuildinfo.o"
</pre>

The problem is somewhat known as there is related comment in the make_buildinfo.c file about the custom commands arguments parsing:

<pre>
/* Hack fix for bad command line:  If the command is issued like this:
 * $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)"
 * we will get a trailing quote because IntDir ends with a backslash that then
 * escapes the final ".  To simplify the life for developers, catch that problem
 * here by cutting it off.
 * The proper command line, btw is:
 * $(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)\"
 * Hooray for command line parsing on windows.
 */
</pre>

There are two solutions possible:

1) Correct the PreLinkEvent command in make_buildinfo.vcxproj according to the comment above:

<pre>
$(SolutionDir)make_buildinfo.exe" Debug "$(IntDir)\"
</pre>

2) Patch make_buildinfo.c (attached).

Then, the cl.exe command is correct:

<pre>
1>  cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL -D_DEBUG -MDd ..\Modules\getbuildinfo.c -Fo"F:\V81-VS2013.win32\Librarie
s\External\Source\Python\Debug\PCbuild\Win32-temp-Debug\pythoncore\getbuildinfo.o" -I..\Include -I..\PC
1>  getbuildinfo.c
</pre>


I'm not sure why this problems leaks while building with VS2013.
I have been building Python 3.2 with VS2012 for long time w/o any issues.
Perhaps, it is related to combination of VS2013 and Windows 8.1.
Although, I'm not observing this problem while building with VS2012 on Windows 8.1,
it would be helpful if someone else who uses VS2012 or VS2013 could confirm my results.
History
Date User Action Args
2014-05-08 09:03:43mloskotsetrecipients: + mloskot
2014-05-08 09:03:42mloskotsetmessageid: <1399539822.8.0.0455279031899.issue21452@psf.upfronthosting.co.za>
2014-05-08 09:03:42mloskotlinkissue21452 messages
2014-05-08 09:03:39mloskotcreate