0

I tried building Ninja from source. I did:

$ git clone git://github.com/martine/ninja.git && cd ninja
$ git checkout release

Then in a Visual Studio command line I ran configure.py with Python:

$ C:\Python27\python.exe configure.py --bootstrap

But here I get the following error:

C:\ninja>C:\Python27\python.exe configure.py --bootstrap
bootstrapping ninja...
Traceback (most recent call last):
  File "configure.py", line 320, in <module>
    if platform.msvc_needs_fs():
  File "configure.py", line 84, in msvc_needs_fs
    stderr=subprocess.PIPE)
  File "C:\Python27\Lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "C:\Python27\Lib\subprocess.py", line 640, in _execute_chi
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

After reading this answer, I added shell=True to all call() and check_call() occurrences in configure.py. But that still doesn't help.

Any ideas what to do?

Rohan Saxena
  • 3,133
  • 2
  • 16
  • 34

1 Answers1

0

Looking at the code in question, it's trying to run cl, which is part of Microsoft Visual C++.

Do you have MSVC installed and in your PATH? I.e. does just running cl on the command line work?

AKX
  • 152,115
  • 15
  • 115
  • 172
  • 2
    Just running `cl` on command line doesn't work, although I have Microsoft Visual C++ installed. – Rohan Saxena Jun 05 '17 at 10:54
  • 1
    So that likely means it's not on the PATH. See https://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx :) – AKX Jun 05 '17 at 10:55
  • 2
    I scoured my entire C:\ drive but couldn't find the path to Microsoft Visual C++. However, I do see it in the list of installed applications (in Programs and Features in Control Panel). – Rohan Saxena Jun 05 '17 at 13:05