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

Require only Visual C++ Build Tools 2015, not the bigger Visual Studio 2015, for -msvc targets #337

Closed
briansmith opened this issue Nov 8, 2016 · 6 comments

Comments

@briansmith
Copy link
Owner

From #335 (comment):

On my laptop, I figured I wouldn't need the whole Visual Studio, and as rustup suggests (https://github.com/rust-lang-nursery/rustup.rs/#other-installation-methods), I installed only the Visual C++ Build Tools 2015, which took long enough and 3GB ...
The ring build failed because it couldn't find Microsoft.Cpp.Default.props, which is in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.Cpp.Default.props on my installation. It turned out that some registry keys were missing, which I copied over from my desktop PC:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
"VCTargetsPath10"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath10)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath12"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath12)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\'))"
"VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\10.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\'))"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\11.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath10"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath10)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\12.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\'))"
"VCTargetsPath10"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath10)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath12"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath12)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\'))"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\14.0]
"VCTargetsPath"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
"VCTargetsPath10"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath10)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\'))"
"VCTargetsPath11"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath11)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V110\'))"
"VCTargetsPath12"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath12)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\'))"
"VCTargetsPath14"="$([MSBuild]::ValueOrDefault('$(VCTargetsPath14)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V140\'))"
While this is ultimately a MSBuild bug (probably), one might come accross this when installing rustup and MSBuild for ring (or other Rust projects that use the msvc toolchain). ring can't fix this, but maybe the rustup documentation (which references the Visual C++ Build Tools 2015) could hint at this (not sure where exactly to report that) and ring could then point at them.

@briansmith
Copy link
Owner Author

I imagine that removing all the MSBuild stuff completely will probably fix this, so let's revisit this after #340.

@Philipp91
Copy link
Contributor

That would have been my suggestion, too, especially after discovering that the "solution" from my comment above doesn't actually solve the whole problem. There are more things that can't be found later in the build process. So focus on #340 and ignore the Visual C++ Build Tools 2015.

@briansmith
Copy link
Owner Author

@Philipp91 I think maybe you ran msbuild on its own before running cargo build? If so, you should delete all the generated stuff and just run cargo build.

Are you building from git? If so, see https://github.com/briansmith/ring/blob/master/BUILDING.md, which explains that you need Yasm and Perl to build from Git.

If you're building a packaged release—i.e. you have an application that you've added a ring = "0.5" dependency to—then if you've installed Visual Studio 2015 then cargo build should just work. If not, please let me know.

@Philipp91
Copy link
Contributor

Philipp91 commented Nov 9, 2016

I hadn't used msbuild before on that machine. And I am building from Git, but I installed yasm and Perl as recommended, and in the same way as I did on my other machine where everything worked fine.

And yes, you're right: now that I installed Visual Studio, it works (just like on my first machine). It just didn't work with Visual C++ Build Tools before (now I don't have that anymore, so I can't try any other ideas).

@briansmith briansmith added this to the 0.7 milestone Nov 15, 2016
@briansmith briansmith modified the milestones: 0.7, 0.7.n Feb 18, 2017
@briansmith
Copy link
Owner Author

#340 is done and ring doesn't use MSBuild anymore. It's a PITA to create a new Windows VM that doesn't have Visual Studio installed and I don't think we have anybody who can verify that the MS Build Tools are sufficient for building ring, so let's be uncharacteristically optimistic and assume everything is OK. Please shout if you find out otherwise.

@yupi2
Copy link

yupi2 commented Mar 19, 2017

@briansmith ring successfully builds and passes tests with only the 2015 build tools installed in my Windows 10 x64 VM. (notes: strawberry perl, yasm 1.3 in path, master branch, rust stable)

@briansmith briansmith modified the milestones: 0.7.n, 0.7.3 Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants