Skip to content

[2.7] bpo-30342: Fix sysconfig.is_python_build() on VS9.0 #1544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2017
Merged

[2.7] bpo-30342: Fix sysconfig.is_python_build() on VS9.0 #1544

merged 1 commit into from
May 12, 2017

Conversation

vstinner
Copy link
Member

Fix sysconfig.is_python_build() if Python is built with Visual Studio 2008 (VS 9.0).

@vstinner vstinner changed the title bpo-30342: Fix sysconfig.is_python_build() on VS9.0 [2.7] bpo-30342: Fix sysconfig.is_python_build() on VS9.0 May 11, 2017
Lib/sysconfig.py Outdated
# PC/VS9.0/amd64
if (os.name == "nt"
and os.path.basename(os.path.dirname(os.path.dirname(_PROJECT_BASE))).lower() == "pc"
and os.path.basename(os.path.dirname(_PROJECT_BASE)).lower().startswith("vs")):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the .startswith("vs") part, maybe I should replace it with == "vs9.0". What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not indent it under the previous check and just do "\\pc\\vs9.0" in _PROJECT_BASE[-10:].lower() (double check that, but I'm assuming the previous condition is okay).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do exactly that, but it's wrong :-) It seems like VS7.1 used python(d_).exe in PC/VS7.1/python(_d).exe, whereas VS 9.0 uses python(_d).exe in PC/VS9.0/{amd64,x86}/python(_d).exe: one more subdirectory!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. This is fine then - I have very little interest in doing much work to support the old build files (as they are explicitly unsupported).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"I have very little interest in doing much work to support the old build files (as they are explicitly unsupported)."

Wait wait wait... I fail to follow progress on the Windows build system, so I rely on the devguide which I expect to be up to date, and the guide says:

https://docs.python.org/devguide/setup.html#windows-compiling

"Python 2.7 uses Microsoft Visual Studio 2008, which is most easily obtained through an MSDN subscription."

I have a MSDN account, but after 30 min, I failed to get my MSDN number and I don't know my subscription is still valid or not (well, I guess that, it's expired). It took me 1 hour to find an old ISO of Visual Studio 2008, and not from microsoft.com :-(

I didn't want to install VS 2008, but I just followed the devguide.

... Do you mean that VS 2010 must now be used and the devguide is just outdated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, moreover: we do have a buildbot using VS 2008. I'm now trying to fix all buildbots, so I had to fix issues on this VS 2008 buildbot too: http://bugs.python.org/issue30313

But I guess that it's ok to have a buildbot on a system not officially fully supported.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created http://bugs.python.org/issue30350 to discuss the devguide.

@vstinner vstinner requested review from zooba and zware May 11, 2017 14:33
@vstinner
Copy link
Member Author

cc @jkloth

Fix sysconfig.is_python_build() if Python is built with Visual Studio
2008 (VS 9.0).
@vstinner
Copy link
Member Author

I replaced .startswith("vs") with == "vs9.0" to only modify the behaviour on VS 2008 since I'm unable to test older VS versions. I only care of VS 2008.

@vstinner vstinner merged commit f2e894c into python:2.7 May 12, 2017
@vstinner vstinner deleted the is_python_build_27 branch May 12, 2017 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants