New issue
Advanced search Search tips

Issue 811209 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

tools/clang/update.py bootstrap broken on Windows when trying to locally build refactoring tools with vcvarsall

Reported by claudiom...@gmail.com, Feb 12 2018

Issue description

On Windows (tested on both Win7 and Win2016), running the VS2017 Community, update.py breaks just after checking out all SVN repositories for bootstrap.

The CMake command call on this line breaks the update:

https://cs.chromium.org/chromium/src/tools/clang/scripts/update.py?l=545&rcl=ef424e1366a9d5d6f1e700e87dee745bc32624d9

As the output on the terminal shows, CMake fails to identify the compiler/link available. Output below:

Running ['C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat', 'amd64', '&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', '-DLLVM_ENABLE_ASSERTIONS=ON', '-DLLVM_USE_CRT_RELEASE=MT', '-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64', '-DCMAKE_INSTALL_PREFIX=C:\\google\\src\\third_party\\llvm-bootstrap-install', '-DCMAKE_C_FLAGS=', '-DCMAKE_CXX_FLAGS=', 'C:\\google\\src\\third_party\\llvm']
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.5.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: C:/google/src/third_party/llvm-bootstrap-install/bin/clang-cl.exe
CMake Error at CMakeLists.txt:50 (project):
  The CMAKE_C_COMPILER:

    C:/google/src/third_party/llvm-bootstrap-install/bin/clang-cl.exe

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:50 (project):
  The CMAKE_CXX_COMPILER:

    C:/google/src/third_party/llvm-bootstrap-install/bin/clang-cl.exe

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:50 (project):
  The CMAKE_ASM_COMPILER:

    C:/google/src/third_party/llvm-bootstrap-install/bin/clang-cl.exe

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!
See also "C:/Users/ClaudioJunior/source/CMakeFiles/CMakeOutput.log".
See also "C:/Users/ClaudioJunior/source/CMakeFiles/CMakeError.log".
Failed.
 
Owner: thakis@chromium.org
Status: Assigned (was: Unconfirmed)
thakis: ptal? you are the only clang person I know :)

Comment 2 by thakis@chromium.org, Feb 12 2018

All bots use update.py, and it's working fine. Something on your machine is configured weirdly.

update.py is supposed to download a prebuilt binary; the cmake bits should only run on certain bots.

Were there any error messages further up?

Does starting over anew help?
I have started over anew in two different computers... It checks out the code from SVN, and then when it comes to compiling the code just checked out, that happens.
I'm doing update.py --bootstrap --force-local-build --extra-tools

Comment 5 by thakis@chromium.org, Feb 12 2018

Why are you doing this? If you don't pass any of these flags, it'll work. Since you are passing this, you're probably trying to do something more than just building chrome. What's your goal?
I want to build empty_string, and possibly change it a bit. I have been following the instructions provided in https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tool_refactoring.md

Comment 7 by thakis@chromium.org, Feb 12 2018

Cc: dcheng@chromium.org
Summary: tools/clang/update.py bootstrap broken on Windows when trying to locally build refactoring tools (was: tools/clang/update.py bootstrap broken on Windows)
Thanks, that's good to know :-) I think dcheng had this building on Windows at some point, and the clang packaging bots also run this code path, so it's possible to get it to work somehow, we just need to figure out what's different on your system.

Here's the output of a recent working run: https://logs.chromium.org/v/?s=chromium%2Fbb%2Ftryserver.chromium.win%2Fwin_upload_clang%2F286%2F%2B%2Frecipes%2Fsteps%2Fpackage_clang%2F0%2Fstdout

Can you compare if that looks similar to what you're seeing locally? Are there any differences?
I can spot a few differences right away:

The bot is using C:\\b\\rr\\tmp_8mrxd\\w\\src\\third_party\\depot_tools\\win_toolchain\\vs_files\\1180cb75833ea365097e279efb2d5d7a42dee4b0\\win_sdk\\Bin\\SetEnv.Cmd

The computers I've tried are using: C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat

The bot is target x64 while the computer I'm using is targeting amd64 (not sure if that's a problem)

SetEnv works ok in the bot, and it prints:
-- The C compiler identification is MSVC 19.11.25507.1
-- The CXX compiler identification is MSVC 19.11.25507.1
-- The ASM compiler identification is MSVC


On my computer, vcvarsall.bat print:
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.5.6
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown

I think that's that I can spot from the output.

Comment 9 by thakis@chromium.org, Feb 12 2018

Summary: tools/clang/update.py bootstrap broken on Windows when trying to locally build refactoring tools with vcvarsall (was: tools/clang/update.py bootstrap broken on Windows when trying to locally build refactoring tools)
I think x64 and amd64 morally mean the same thing.

If you add something like

    if msvc_arch == 'x64':
      msvc_arch = 'amd64'

here https://cs.chromium.org/chromium/src/tools/clang/scripts/update.py?q=update.py&sq=package:chromium&dr=C&l=206 , does that change anything?
just bear with me some minutes... checking the code out.
That doesn't work because amd64 is not supported by MSVSVersion.py

  File "C:\google\src\tools\gyp\pylib\gyp\MSVSVersion.py", line 82, in _SetupScriptInternal
    assert target_arch in ('x86', 'x64'), "target_arch not supported"
AssertionError: target_arch not supported

Shouldn't vcvarsall.bat be called with x64, since amd64 is not supported?
Hm, looking at https://cs.chromium.org/chromium/src/tools/gyp/pylib/gyp/MSVSVersion.py?dr=C&q=SetupScript&sq=package:chromium&l=93 I suppose it's supposed to do the right thing if you're in a 64-bit msvc shell. That env var is set over here:

C:\src\llvm-build-goma10>set | findstr PROCESSOR_ARCH
PROCESSOR_ARCHITECTURE=AMD64


I think if you want this config to work, I'm afraid you'll have to debug it a bit yourself :-/
I'm not sure if you noticed, but it tries to use the compiler that's about to be built as the toolset for the bootstrap. Here's what the log says:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: Y:/dev/chromium/src/third_party/llvm-bootstrap-install/bin/clang-cl.exe 

This is the path set as LLVM_BOOTSTRAP_INSTALL_DIR, to be used as the install path for this run. I'm not sure what is leading CMake to try to run the compiler at that path.

Sign in to add a comment