microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.93k stars 28.77k forks source link

Support for VS2017 #27788

Closed MikeGitb closed 6 years ago

MikeGitb commented 7 years ago

First of all thanks for this great piece of software.

As far as I can tell from the docs (https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source) and my failed attempt to build VSCode with only a VS 2017 installation, VSCode needs a genuine VS2015 installation in order to be compiled.

Am I correct? And if so, are there any plans to change that in the near future (like in the comming 1-2 months)?

sandy081 commented 7 years ago

@bpasero Not sure who owns the setup related issues. Feel free to re-assign to the right person. Thanks.

bpasero commented 7 years ago

@MikeGitb what error do you see with VS 2017?

MikeGitb commented 7 years ago

Sorry, didn't find the time to create a repo, but will do over the weekend. Are you saying that building with VS2017 should work / does work on your PC?

bpasero commented 7 years ago

@MikeGitb no, I did not try so far.

MikeGitb commented 7 years ago

Sorry for the delay, here comes the repo:

From a normal windows command prompt:

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\michael\Documents\repos>git --version
git version 2.10.0.windows.1

C:\Users\michael\Documents\repos>node --version
v6.10.3

C:\Users\michael\Documents\repos>python --version
Python 2.7.13

C:\Users\michael\Documents\repos>echo %PYTHON%
C:\xDev\Python27\python.exe

C:\Users\michael\Documents\repos>npm --version
3.10.10

C:\Users\michael\Documents\repos>git clone https://github.com/microsoft/vscode
Cloning into 'vscode'...
remote: Counting objects: 282430, done.
remote: Compressing objects: 100% (129/129), done.
remote: Total 282430 (delta 84), reused 106 (delta 53), pack-reused 282243
Receiving objects: 100% (282430/282430), 80.68 MiB | 2.64 MiB/s, done.
Resolving deltas: 100% (183311/183311), done.
Checking out files: 100% (7008/7008), done.

C:\Users\michael\Documents\repos>cd vscode

C:\Users\michael\Documents\repos\vscode>scripts\npm.bat install
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.2.12: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade

> code-oss-dev@1.14.0 preinstall C:\Users\michael\Documents\repos\vscode
> node build/npm/preinstall.js

> typechecker@2.0.8 preinstall C:\Users\michael\Documents\repos\vscode\node_modules\.staging\typechecker-a0cbdb61
> node ./cyclic.js

npm WARN prefer global js-beautify@1.5.10 should be installed with -g

> oniguruma@6.1.1 install C:\Users\michael\Documents\repos\vscode\node_modules\oniguruma
> node-gyp rebuild

C:\Users\michael\Documents\repos\vscode\node_modules\oniguruma>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
MSBUILD : error MSB1025: Interner Fehler beim Ausführen von MSBuild.
Microsoft.Build.BuildEngine.InvalidToolsetDefinitionException: MSBuildToolsPath ist für die bei "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" definierte ToolsVersion "14.0" nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet.
   bei Microsoft.Build.BuildEngine.InvalidToolsetDefinitionException.Throw(Exception innerException, String resourceName, Object[] args)
   bei Microsoft.Build.BuildEngine.ToolsetReader.ReadToolset(PropertyDefinition toolsVersion, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, Boolean accumulateProperties)
   bei Microsoft.Build.BuildEngine.ToolsetReader.ReadEachToolset(ToolsetCollection toolsets, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, Boolean accumulateProperties)
   bei Microsoft.Build.BuildEngine.ToolsetReader.ReadToolsets(ToolsetCollection toolsets, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, Boolean accumulateProperties)
   bei Microsoft.Build.BuildEngine.ToolsetReader.ReadAllToolsets(ToolsetCollection toolsets, ToolsetRegistryReader registryReader, ToolsetConfigurationReader configurationReader, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, ToolsetDefinitionLocations locations)
   bei Microsoft.Build.BuildEngine.Engine.PopulateToolsetStateMap(ToolsetDefinitionLocations locations)
   bei Microsoft.Build.BuildEngine.Engine..ctor(Int32 numberOfCpus, Boolean isChildNode, Int32 parentNodeId, String localNodeProviderParameters, BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations)
   bei Microsoft.Build.BuildEngine.Engine.get_GlobalEngine()
   bei Microsoft.Build.BuildEngine.Project..ctor(Engine engine, String toolsVersion)
   bei Microsoft.Build.BuildEngine.SolutionWrapperProject.Generate(String solutionPath, String toolsVersionOverride, BuildEventContext projectBuildEventContext)
   bei Microsoft.Build.Execution.ProjectInstance.GenerateSolutionWrapperUsingOldOM(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ProjectRootElementCache projectRootElementCache, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext projectBuildEventContext, Boolean isExplicitlyLoaded)
   bei Microsoft.Build.Execution.ProjectInstance.LoadSolutionForBuild(String projectFile, PropertyDictionary`1 globalPropertiesInstances, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext projectBuildEventContext, Boolean isExplicitlyLoaded)
   bei Microsoft.Build.Execution.BuildManager.LoadSolutionIntoConfiguration(BuildRequestConfiguration config, BuildEventContext buildEventContext)
   bei Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
   bei Microsoft.Build.Execution.BuildManager.IssueRequestToScheduler(BuildSubmission submission, Boolean allowMainThreadBuild, BuildRequestBlocker blocker)
   bei Microsoft.Build.Execution.BuildManager.<>c__DisplayClass60_1.<ExecuteSubmission>b__0()

MSBUILD : error MSB1025: Interner Fehler beim Ausführen von MSBuild.
Microsoft.Build.BuildEngine.InvalidToolsetDefinitionException: MSBuildToolsPath ist für die bei "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" definierte ToolsVersion "14.0" nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet.
   bei Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detailedSummary)
   bei Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)

Unbehandelte Ausnahme: Microsoft.Build.BuildEngine.InvalidToolsetDefinitionException: MSBuildToolsPath ist für die bei "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" definierte ToolsVersion "14.0" nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet.
   bei Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Boolean needToValidateProject, String schemaFile, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean debugger, Boolean detailedSummary)
   bei Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
   bei Microsoft.Build.CommandLine.MSBuildApp.Main()
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 3762504530
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\michael\Documents\repos\vscode\node_modules\oniguruma
gyp ERR! node -v v6.10.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
code-oss-dev@1.14.0 C:\Users\michael\Documents\repos\vscode
+-- 7zip@0.0.6
+-- @types/minimist@1.2.0
+-- @types/mocha@2.2.41
+-- @types/semver@5.3.31
+-- @types/sinon@1.16.36
+-- @types/winreg@1.2.30
+-- agent-base@1.0.2
+-- anymatch@1.3.0
+-- applicationinsights@0.17.1
+-- arr-diff@2.0.0
+-- arr-flatten@1.0.1
+-- array-unique@0.2.1
+-- arrify@1.0.1
+-- async-each@1.0.1
+-- azure-storage@0.3.3
| +-- extend@1.2.1
| +-- node-uuid@1.4.8

[... Snipp ... a pretty long tree]

| `-- bindings@1.2.1
+-- winreg@1.2.0
+-- xterm@2.6.0  (git+https://github.com/Tyriar/xterm.js.git#32c9eac8ee5a958093d126a06c1c06a7cd6052bf)
`-- yauzl@2.3.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@0.3.8 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@0.3.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! oniguruma@6.1.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oniguruma@6.1.1 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the oniguruma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs oniguruma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls oniguruma
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\michael\Documents\repos\vscode\npm-debug.log

For some reason I'm unable to upload the mentioned log file, even when I rename it to txt. Maybe it is too long.

Here is also the top of the VS-Developer Command promt:

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26430.12
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

If there is anything else you need I'd be happy to provide it.

What little I can read from the error log aboove is that something is looking for a VS 14.0 isntallation in the registry. IIRC, finding the current VS2017 installation works differently from VS2017 - that might be a reason for the problem.

MikeGitb commented 7 years ago

@bpasero: I just realized that parts of the error message are in German. If this is a problem I can switch languages and post it again. Is there anything else you need?

bpasero commented 7 years ago

No, but up for a PR if someone wants to chime in (even if its just docs).

rianadon commented 7 years ago

I believe the newest version of node-gyp should work with VS 2017 (I set the msvs_version npm config option to 2017 and VS Code compiled). However, I also had VS 2015 on my system too so despite the npm flag it might still be compiling with 2015.

Upgrading npm (npm install -g npm) may bring node-gyp up to a version compatible with VS 2017. Since your npm version is a bit old, @MikeGitb, this may fix the error (or may not).

Hopefully this helps.

radu-v commented 7 years ago

Can confirm that upgrading npm, as @rianadon stated, helped - only VS2017 Enterprise installed

MikeGitb commented 7 years ago

@rianadon: Thank you very much. I can confirm that the build works after the upgrade, although I get a lot of warnings but none of them seems to be related to VS.

Keeping this open for now, until docs get updated

rianadon commented 7 years ago

Glad to help! The docs should also include some of the other options for Windows build tools listed on the node-gyp readme as some are easier than installing another IDE (I've tested with the windows-build-tools npm package and it works great).

MikeGitb commented 7 years ago

Unfortunately, I'm a complete novice when it comes to JS and npm (I was just interested in testing out the 64 bit Version of VSCode and had VS2017 already installed). So someone else needs to take care of updating the instructions.

vvs commented 7 years ago

@rianadon Thanks for the tip to use windows-build-tools, simplified the whole thing for me, since I didn't want to download and install the whole Visual Studio IDE.

Using windows-build-tools worked like a charm. It would be really nice to update the README to list this option.