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: Build problem on Windows with MSVC++ Express 2008
Type: compile error Stage:
Components: Build Versions: Python 3.2
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, eli.bendersky, georg.brandl, gz, kristjan.jonsson, loewis
Priority: high Keywords: patch

Created on 2011-01-28 07:37 by eli.bendersky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue11034.patch gz, 2011-01-28 10:39 review
Messages (15)
msg127249 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-28 07:37
On a clean checkout of py3k, I try to open PCBuild/pcbuild.sln with my MSVC++ Express 2008. When opening, a message box pops saying:

  Solution folders are not supported in this version of the application.
  Solution folder "Solution Items" will be displayed as unavailable.

I go on building following instructions (F7, leaving the default Debug win32 configuration). I get a bunch of LNK1181 errors:

  27> LINK : fatal error LNK1181: cannot open input file '.\python32_d.lib'

When I try to build the pythoncore project only, I get:

  1>c1 : fatal error C1083: Cannot open source file: 'D:\eli\python-py3k-trunk\PCbuild\Win32-temp-Debug\pythoncore\\getbuildinfo2.c': No such file or directory

Maybe there's some problem with the make_buildinfo call in the pre-build event?
msg127250 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-28 07:42
I tried running make_buildinfo.exe manually from a VC command prompt, and I get an error for invoking subwcrev.exe:

D:\eli\python-py3k-trunk\PCbuild>make_buildinfo.exe Debug Win32-temp-Debug
"C:\Program Files\TortoiseSVN\bin\subwcrev.exe" .. ..\Modules\getbuildinfo.c "Win32-temp-Debug\getbuildinfo2.c"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
msg127252 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-28 08:02
After some investigation of running make_buildinfo standalone, it boils down to this:

When it executes the path with quotes around the last argument:

"C:\Program Files\TortoiseSVN\bin\subwcrev.exe" .. ..\Modules\getbuildinfo.c "Win32-temp-Debug\getbuildinfo2.c"

I see the error about 'C:\Program' being unrecognized.

When it executes without quotes around the last argument:

"C:\Program Files\TortoiseSVN\bin\subwcrev.exe" .. ..\Modules\getbuildinfo.c Win32-temp-Debug\getbuildinfo2.c

It works just fine.

Could this be some bizzarre bug in the quote parser of cmd.exe? I run Win XP Home SP3.
msg127253 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-01-28 08:10
> Could this be some bizzarre bug in the quote parser of cmd.exe?
Yes, this is even documented with "cmd /?":
"""
[...]If you specify /c or /k, cmd processes the remainder of string and quotation marks are preserved only if all of the following conditions are met:
[...]- You use exactly one set of quotation marks.
"""
msg127254 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-28 08:13
Amaury, seems like it - thanks. So I suppose the fix would be just to remove the quotes in make_buildinfo.c

I wonder why it worked for others & buildbots?
msg127256 - (view) Author: Martin (gz) * Date: 2011-01-28 08:52
Removing the quotes rebreaks the case where tmppath contains a space.

Instead, either:
* Call subwcrev.exe  directly without going through COMSPEC: switch 'system' to 'CreateProcess'.
* More quotes! Change `"A" .. "B"` to `""A" .. "B""` which when it hits case 2 from what Amuary was quoting, does what's intended.

"""
1.  If all of the following conditions are met...
"""
... they aren't...
"""
2.  Otherwise, old behavior is to see if the first character is a quote character and if so, strip the leading character and remove the last quote character on the command line, preserving any text after the last quote character.
"""
msg127258 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2011-01-28 09:07
Bizarre indeed.
I think more quotes is the answer, since it is simpler to implement.
But the question remains, why has it worked until now?
msg127259 - (view) Author: Martin (gz) * Date: 2011-01-28 09:23
This bug only hits people who:
1) Have TortoiseSVN installed (buildbots won't, I don't)
2) ...on a path that needs quoting.
msg127269 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-28 10:03
Martin,

This makes sense, but keep in mind that:

1) Many, if indeed not *most* Windows SVN users use TortoiseSVN (and our dev guide recommends it, IIRC)
2) When TortoiseSVN *is* installed, it almost always goes into "Program Files" (its default installation path)

So the Windows buildbots don't represent one of the most common (IMHO) usage cases of building on Windows. Is it hard to implement? [i.e. use TortoiseSVN instead of cmd-line SVN on one of the Windows bots?]

Kristján - will you submit a patch for review? (this issue seems like a release blocker to me - but I'll leave it to Georg to decide on setting its priority)
msg127270 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-01-28 10:13
> Kristján - will you submit a patch for review? (this issue seems like
> a release blocker to me - but I'll leave it to Georg to decide on
> setting its priority)

I wouldn't say it's a release blocker: I can build Python just fine,
so the release isn't really blocked by this. For the bug, there is
an easy work-around: just create a file no_subwcrev, or avoid paths
with spaces in them.
msg127276 - (view) Author: Martin (gz) * Date: 2011-01-28 10:39
Eli, was just answering your question about why this didn't fail for other people.

Try the attached patch to see if it fixes the problem for you.
msg127280 - (view) Author: Martin (gz) * Date: 2011-01-28 10:45
...and this apparently came up on the mailinglist as well with Prasun providing nearly exactly the same patch:

<http://mail.python.org/pipermail/python-dev/2011-January/107599.html>
msg127286 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-28 11:36
Martin, the patch fixed the problem for me and the code looks good.
msg134838 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-04-30 06:06
Can this be committed and closed? [it's still an annoying problem for some Windows users who want to compile Python]
msg134846 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-04-30 07:50
I'm closing it as rejected. Python doesn't use subversion anymore.
History
Date User Action Args
2022-04-11 14:57:11adminsetgithub: 55243
2011-04-30 07:50:41loewissetstatus: open -> closed
resolution: rejected
messages: + msg134846
2011-04-30 06:06:05eli.benderskysetmessages: + msg134838
2011-01-28 11:36:52eli.benderskysetnosy: loewis, georg.brandl, amaury.forgeotdarc, kristjan.jonsson, eli.bendersky, gz
messages: + msg127286
2011-01-28 10:45:35gzsetnosy: loewis, georg.brandl, amaury.forgeotdarc, kristjan.jonsson, eli.bendersky, gz
messages: + msg127280
2011-01-28 10:39:02gzsetfiles: + issue11034.patch

messages: + msg127276
keywords: + patch
nosy: loewis, georg.brandl, amaury.forgeotdarc, kristjan.jonsson, eli.bendersky, gz
2011-01-28 10:13:32loewissetnosy: loewis, georg.brandl, amaury.forgeotdarc, kristjan.jonsson, eli.bendersky, gz
messages: + msg127270
2011-01-28 10:03:08eli.benderskysetnosy: loewis, georg.brandl, amaury.forgeotdarc, kristjan.jonsson, eli.bendersky, gz
messages: + msg127269
2011-01-28 09:23:04gzsetnosy: loewis, georg.brandl, amaury.forgeotdarc, kristjan.jonsson, eli.bendersky, gz
messages: + msg127259
2011-01-28 09:07:48kristjan.jonssonsetnosy: loewis, georg.brandl, amaury.forgeotdarc, kristjan.jonsson, eli.bendersky, gz
messages: + msg127258
2011-01-28 08:52:03gzsetnosy: + gz
messages: + msg127256
2011-01-28 08:30:19eli.benderskysetnosy: + kristjan.jonsson
2011-01-28 08:26:05eli.benderskysetpriority: normal -> high
nosy: loewis, georg.brandl, amaury.forgeotdarc, eli.bendersky
2011-01-28 08:13:07eli.benderskysetnosy: loewis, georg.brandl, amaury.forgeotdarc, eli.bendersky
messages: + msg127254
2011-01-28 08:10:40amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg127253
2011-01-28 08:02:41eli.benderskysetmessages: + msg127252
2011-01-28 07:42:03eli.benderskysetnosy: + georg.brandl
messages: + msg127250
2011-01-28 07:37:35eli.benderskycreate