Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Issue 2738993003: Allow building with VS 2017 when VS 2013/2015 are in path (Closed)

Created:
3 years, 9 months ago by brucedawson
Modified:
3 years, 9 months ago
Reviewers:
scottmg
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow building with VS 2017 when VS 2013/2015 are in path The VS 2017 vcvarsall.bat file is quite fragile. It fails if vcvarsall.bat from a previous release has been run in the same command prompt, and this failure is not detected by setup_toolchain.py. The problem occurs because the new vcvarsall.bat won't overwrite an existing VSINSTALLDIR. The fix is to clear it from the environment if it is set. The main test was to try to build with VS 2017 after running the VS 2015 vcvarsall.bat. Trimmed output is shown here: > where cl C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\cl.exe C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe > set gyp GYP_MSVS_VERSION=2017 > gn clean out\release & gn gen out\release & ninja -v -C out\release ..\..\build\precompile.cc^^ Done. Made 5496 targets from 1254 files in 4078ms ninja: Entering directory `out\release' ... [15/15 0.439s] ... \Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64/cl.exe ... I also verified that I can switch between 2015 and 2017 builds with just a "gn gen" to reset the toolchain. > set GYP_MSVS_VERSION=2015 > gn gen out\release > ninja -v -C out\release ..\..\build\precompile.cc^^ ninja: Entering directory `out\release' [1/1 0.140s ] ... "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64/cl.exe" ... > set GYP_MSVS_VERSION=2017 > gn gen out\release Done. Made 5496 targets from 1254 files in 3768ms > ninja -v -C out\release ..\..\build\precompile.cc^^ ninja: Entering directory `out\release' [1/1 0.131s ] ... \Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64/cl.exe ... R=scottmg@chromium.org BUG=683729 Review-Url: https://codereview.chromium.org/2738993003 Cr-Commit-Position: refs/heads/master@{#455630} Committed: https://chromium.googlesource.com/chromium/src/+/1d57799fb3aa77b04cc79982dca0261d6b7d673e

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M build/toolchain/win/setup_toolchain.py View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (4 generated)
brucedawson
It's a hack, but not too bad a hack, and it makes things much better. ...
3 years, 9 months ago (2017-03-09 00:23:40 UTC) #2
scottmg
thanks lgtm
3 years, 9 months ago (2017-03-09 00:47:54 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2738993003/1
3 years, 9 months ago (2017-03-09 00:56:28 UTC) #5
commit-bot: I haz the power
3 years, 9 months ago (2017-03-09 01:43:58 UTC) #8
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/1d57799fb3aa77b04cc79982dca0...

Powered by Google App Engine
This is Rietveld 408576698