New issue
Advanced search Search tips

Issue 700524 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 683729



Sign in to add a comment

"Updating clang" part of gclient sync fails when GYP_MSVS_VERSION=2017 or VS 2015 not installed

Project Member Reported by bunge...@chromium.org, Mar 10 2017

Issue description

I got a new machine and now have only Visual Studio 2017 installed. I am able to fetch chromium and checkout dependencies, but fail to run hooks. The relevant output is

________ running 'C:\python_27_amd64\files\python.exe src/tools/clang/scripts/update.py --if-needed' in 'C:\src\chromium'
Updating Clang to 296321-1...
Creating directory C:\src\chromium\src\third_party\llvm-build
Downloading prebuilt clang
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Win/clang-296321-1.tgz .......... Done.
Creating directory C:\src\chromium\src\third_party\llvm-build\Release+Asserts
clang 296321-1 unpacked
Traceback (most recent call last):
  File "src/tools/clang/scripts/update.py", line 908, in <module>
    sys.exit(main())
  File "src/tools/clang/scripts/update.py", line 904, in main
    return UpdateClang(args)
  File "src/tools/clang/scripts/update.py", line 429, in UpdateClang
    CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin'))
  File "src/tools/clang/scripts/update.py", line 374, in CopyDiaDllTo
    dia_path = os.path.join(GetVSVersion().Path(), 'DIA SDK', 'bin', 'amd64')
  File "src/tools/clang/scripts/update.py", line 368, in GetVSVersion
    vs_toolchain.GetVisualStudioVersion())
  File "C:\src\chromium\src\tools\gyp\pylib\gyp\MSVSVersion.py", line 442, in SelectVisualStudioVersion
    return _CreateVersion(msvs_version, override_path, sdk_based=True)
  File "C:\src\chromium\src\tools\gyp\pylib\gyp\MSVSVersion.py", line 333, in _CreateVersion
    return versions[str(name)]
KeyError: '2017'
Error: Command 'C:\\python_27_amd64\\files\\python.exe src/tools/clang/scripts/update.py --if-needed' returned non-zero exit status 1 in C:\src\chromium

The issue here is that update.py is looking for a msdiaxxx.dll but it depends on gyp(!?) to know where to find it. Gyp knows I want 2017 because GYP_MSVS_VERSION=2017 is set, but since gyp doesn't support vs2017 yet it dies.
 
Labels: OS-Windows
I'm currently working around this with a combination of

GYP_MSVS_OVERRIDE_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
GYP_MSVS_VERSION=2017

Copy-pasting bits of gyp's MSVSVersion.py's _CreateVersion that say 2015 and inserting 2017.

Adding 2017 to tools/clang/scripts/update.py's DIA_DLL in update.py (it's the same as 2015, they didn't bump the version number).
Owner: brucedaw...@chromium.org
Status: Started (was: Untriaged)
Thanks, I'll grab this.

I saw this once (despite having VS 2015 installed) so I suspect the description is not quite right, but it's still a bug. I'll look into it.
The reason that I saw encountered bug and then it "went away" is because I did a VS 2015 build which downloaded clang and set third_party\llvm-build\cr_build_revision. This meant that from that point forward the clang update step was skipped (until the next clang revision came along). The python call stack in this bug report was helpful for letting me reproduce the problem.

The change at https://chromium-review.googlesource.com/c/433540/ will add the necessary gyp support.

Until then I've created a temporary patch that can be applied to the Chromium repo whenever the bug is hit:

https://codereview.chromium.org/2748523002

Once the gyp change lands and rolls the only part of the fix that will be needed is the addition of '2017': 'msdia140.dll'.

If we can actually rely on GYP_MSVS_OVERRIDE_PATH being set then the gyp dependency would be fairly easy to work around.
Blocking: 683729
Summary: "Updating clang" part of gclient sync fails when GYP_MSVS_VERSION=2017 or VS 2015 not installed (was: gclient sync fails when only Visual Studio 2017 is installed.)
Updating title to be slightly more accurate.

This is waiting on https://chromium-review.googlesource.com/c/453201/. After that the fix is a gyp roll and then a one-line addition to tools/clang/scripts/update.py to add '2017': 'msdia140.dll', to the DIA_DLL list.

The simplest repro for the bug, BTW, is these three commands:

set GYP_MSVS_VERSION=2017
del third_party\llvm-build\cr_build_revision
python tools/clang/scripts/update.py --if-needed

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/external/gyp/+/eb296f67da078ec01f5e3a9ea9cdc6d26d680161

commit eb296f67da078ec01f5e3a9ea9cdc6d26d680161
Author: Refael Ackermann <refack@gmail.com>
Date: Sat Apr 15 17:31:25 2017

[win] Add support for MS VS2017 (via Registry)

1) Be aware of Microsoft Visual Studio 2017 (ver 15.0 / toolset v141)
2) Try to detect from registry (not official but working)
3) Add compatible_sdks attribute to Version for setup and early fail
4) Add GYP_BUILD_TOOL env var for easy testing

BUG= 683729 
BUG= 700524 

Change-Id: I2f65d2bc393e00dae2baa9ee04a828ba1ad28476
Reviewed-on: https://chromium-review.googlesource.com/453201
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>

[modify] https://crrev.com/eb296f67da078ec01f5e3a9ea9cdc6d26d680161/pylib/gyp/MSVSVersion.py
[modify] https://crrev.com/eb296f67da078ec01f5e3a9ea9cdc6d26d680161/pylib/gyp/generator/msvs.py
[modify] https://crrev.com/eb296f67da078ec01f5e3a9ea9cdc6d26d680161/test/lib/TestGyp.py
[modify] https://crrev.com/eb296f67da078ec01f5e3a9ea9cdc6d26d680161/AUTHORS

Project Member

Comment 9 by bugdroid1@chromium.org, Apr 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/23bf5051cc684eacd9a3519470b28017b036335c

commit 23bf5051cc684eacd9a3519470b28017b036335c
Author: drbasic <drbasic@yandex-team.ru>
Date: Mon Apr 17 19:16:48 2017

Fix dia dll coping on VS++2017

R=scottmg@chromium.org
BUG= 700524 

Review-Url: https://codereview.chromium.org/2821823002
Cr-Commit-Position: refs/heads/master@{#464968}

[modify] https://crrev.com/23bf5051cc684eacd9a3519470b28017b036335c/tools/clang/scripts/update.py

Project Member

Comment 11 by bugdroid1@chromium.org, Apr 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ef0edc393def2cc4b97b2ca043b2182ba7f95ab5

commit ef0edc393def2cc4b97b2ca043b2182ba7f95ab5
Author: brucedawson <brucedawson@chromium.org>
Date: Mon Apr 17 19:52:26 2017

Roll src\tools\gyp e7079f0e0..eb296f67d (12 commits)

https://chromium.googlesource.com/external/gyp.git/+log/e7079f0e0e14..eb296f67da07

$ git log e7079f0e0..eb296f67d --date=short --no-merges --format='%ad %ae %s'
2017-04-15 refack [win] Add support for MS VS2017 (via Registry)
2017-03-12 refack [win-test] loosen win-driver-target-type test
2017-02-16 tandrii CQ config: add gerrit CQAbility verifier.
2017-01-20 agable Make Gerrit the default code review system for gyp
2017-01-20 agable Set up a CQ for gyp
2016-11-17 dpranke Update shared library extension on AIX to .a.
2016-11-05 dpranke msvs: Allow target platform version without WinRT
2016-10-13 addaleax Hash intermediate file name to avoid ENAMETOOLONG
2016-10-13 thechargingvolcano fix common "NameError"s
2016-08-10 jmaquieira Add new target type called windows_driver. * Modify GYP to set the PlatformToolset, the DriverType and the TargetVersion * Add msvs_target_version configuration
2016-08-05 ted.mielczarek Make the ninja backend transitively check for C++ sources to use the C++ compiler for linking
2016-08-04 marksc2222 Complete PBXCopyFilesBuildPhase TODO in xcodeproj_file.py.

Created with:
  roll-dep src\tools\gyp

R=dpranke@chromium.org
BUG= 700524 

Review-Url: https://codereview.chromium.org/2823933002
Cr-Commit-Position: refs/heads/master@{#464991}

[modify] https://crrev.com/ef0edc393def2cc4b97b2ca043b2182ba7f95ab5/DEPS

Status: Fixed (was: Started)
We had a two pairs of dueling CLs racing for the finish line but the net result is success. This is now fixed.

Sign in to add a comment