Skip to content
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

windows builds: devenv freetype /update appears not to have an effect #16243

Closed
eric-wieser opened this issue Jan 16, 2020 · 4 comments · Fixed by #16401
Closed

windows builds: devenv freetype /update appears not to have an effect #16243

eric-wieser opened this issue Jan 16, 2020 · 4 comments · Fixed by #16401

Comments

@eric-wieser
Copy link
Contributor

Despite attempting to upgrade the freetype sln file with /upgrade, when building using the 2017 msbuild as part of setup.py I get the following failure:

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    Build started 2020-01-16 14:46:40.
    Project "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.sln" on node 1 (Clean;Build target(s)).
    ValidateSolutionConfiguration:
      Building solution configuration "Release|x64".
    Project "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.sln" (1) is building "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.vcxproj" (2) on node 1 (Clean target(s)).
    CoreClean:
      Creating directory ".\..\..\..\objs\vc2010\x64\Release\".
    Done Building Project "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.vcxproj" (Clean target(s)).
    Project "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.sln" (1) is building "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.vcxproj" (2:2) on node 1 (default targets).
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.vcxproj]
    Done Building Project "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.vcxproj" (default targets) -- FAILED.
    Done Building Project "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.sln" (Clean;Build target(s)) -- FAILED.

    Build FAILED.

    "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.sln" (Clean;Build target) (1) ->
    "C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.vcxproj" (default target) (2:2) ->
    (PlatformPrepareForBuild target) ->
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\Users\wiese\Repos\numeric-python\matplotlib\build\freetype-2.6.1\builds\windows\vc2010\freetype.vcxproj]
@eric-wieser
Copy link
Contributor Author

eric-wieser commented Jan 16, 2020

Making the following change appears to fix the issue for me on 3.8:

--- matplotlib\setupext.py	Thu Jan 16 14:56:25 2020
+++ matplotlib\setupext.py	Thu Jan 16 14:58:44 2020
@@ -566,8 +566,7 @@
             # cc.spawn(["devenv", str(sln_path), "/upgrade"])
             cc.spawn(["msbuild", str(sln_path),
                       "/t:Clean;Build",
-                      f"/p:Configuration=Release;Platform={msbuild_platform}"])
+                      f"/p:Configuration=Release;Platform={msbuild_platform}",
+                      "/p:PlatformToolset=v140"])
             # Move to the corresponding Unix build path.
             (src_path / "objs" / ".libs").mkdir()
             # Be robust against change of FreeType version.

but I'm not sure how ideal hard-coding v140 is. It's better than falling back on v100 at least...

@anntzer
Copy link
Contributor

anntzer commented Jan 16, 2020

We may be able to reuse https://github.com/python/cpython/blob/9baf242fc733ab8a52a0b6201d95c6fdb8251745/PCbuild/python.props#L7-L21? (by patching the relevant file in the freetype build script)

@Kojoley
Copy link
Member

Kojoley commented Feb 11, 2020

@eric-wieser could you please check if #16401 fixes the issue?

@eric-wieser
Copy link
Contributor Author

Yes, that seemed to do the trick

@QuLogic QuLogic added this to the v3.3.0 milestone Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants