Ninja cant find build.ninja

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Ninja cant find build.ninja

Postby josh65 » Wed Mar 04, 2020 10:33 am

ninja: error: loading 'build.ninja': The system cannot find the file specified.
ninja: Entering directory `out\Debug_GN_x86'
josh65
Newbie
 
Posts: 5
Joined: Mon Mar 02, 2020 3:43 pm

Re: Ninja cant find build.ninja

Postby ploni » Wed Aug 05, 2020 11:39 am

josh65 wrote:ninja: error: loading 'build.ninja': The system cannot find the file specified.
ninja: Entering directory `out\Debug_GN_x86'


I also have the same problem
ploni
Newbie
 
Posts: 5
Joined: Sun Jul 19, 2020 12:11 am

Re: Ninja cant find build.ninja

Postby magreenblatt » Wed Aug 05, 2020 11:50 am

Please provide complete details about what you are doing, and then maybe we will be able to assist you.
magreenblatt
Site Admin
 
Posts: 12384
Joined: Fri May 29, 2009 6:57 pm

Re: Ninja cant find build.ninja

Postby ploni » Thu Aug 06, 2020 7:25 am

magreenblatt wrote:Please provide complete details about what you are doing, and then maybe we will be able to assist you.



I am trying to compile CEF for the first time according to the guide
ploni
Newbie
 
Posts: 5
Joined: Sun Jul 19, 2020 12:11 am

Re: Ninja cant find build.ninja

Postby magreenblatt » Thu Aug 06, 2020 10:19 am

Which guide? What OS and CEF version?
magreenblatt
Site Admin
 
Posts: 12384
Joined: Fri May 29, 2009 6:57 pm

Re: Ninja cant find build.ninja

Postby tech5678 » Tue Nov 03, 2020 9:41 am

Having the same problem on Windows 10 64-bit pro. Source was downloaded on 10/30, so the version was whatever was posted on that day. However I just now ran update.bat, so presumably I'm on the latest version and still have the error.

I'm following the instructions at https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md

There's no build.ninja file in c:\code\chromium_git\chromium\src (or wherever it might be looking for it). I did a Windows file search inside c:\code for "build.ninja". The only match is here: C:\code\chromium_git\chromium\src\tools\binary_size\libsupersize\testdata\mock_source_directory\out\Release\build.ninja

So if it isn't where it should be, obviously something went wrong with its creation so I dug a little deeper.

Create.bat actually has an error in the output:
Code: Select all
Generating CEF project files...
Traceback (most recent call last):
  File "c:/code/chromium_git/chromium/src/build/vs_toolchain.py", line 588, in <module>
    sys.exit(main())
  File "c:/code/chromium_git/chromium/src/build/vs_toolchain.py", line 584, in main
    return commands[sys.argv[1]](*sys.argv[2:])
  File "c:/code/chromium_git/chromium/src/build/vs_toolchain.py", line 562, in GetToolchainDir
    win_sdk_dir = SetEnvironmentAndGetSDKDir()
  File "c:/code/chromium_git/chromium/src/build/vs_toolchain.py", line 555, in SetEnvironmentAndGetSDKDir
    return NormalizePath(os.environ['WINDOWSSDKDIR'])
  File "c:\code\depot_tools\bootstrap-3_8_0_chromium_8_bin\python\bin\lib\os.py", line 425, in __getitem__
    return self.data[key.upper()]
KeyError: 'WINDOWSSDKDIR'
ERROR at //build/config/win/visual_studio_version.gni:26:7: Script returned non-zero exit code.
      exec_script("../../vs_toolchain.py", [ "get_toolchain_dir" ], "scope")
      ^----------
Current dir: c:/code/chromium_git/chromium/src/out/Release_GN_x86/
Command: c:/code/depot_tools/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe c:/code/chromium_git/chromium/src/build/vs_toolchain.py get_toolchain_dir
Returned 1.
See //build/toolchain/win/midl.gni:7:1: whence it was imported.
import("//build/config/win/visual_studio_version.gni")
^----------------------------------------------------
See //ui/accessibility/BUILD.gn:19:3: whence it was imported.
  import("//build/toolchain/win/midl.gni")
  ^--------------------------------------
See //BUILD.gn:157:7: which caused the file to be included.
      "//ui/accessibility:accessibility_unittests",
      ^-------------------------------------------
Traceback (most recent call last):
  File "tools\gclient_hook.py", line 143, in <module>
    RunAction(src_dir, cmd)
  File "c:\code\chromium_git\chromium\src\cef\tools\gclient_util.py", line 36, in RunAction
    command, cwd=dir, always_show_header=True, print_stdout=True)
  File "c:\code\depot_tools\gclient_utils.py", line 674, in CheckCallAndFilter
    rv, args, kwargs.get('cwd', None), None, None)
subprocess2.CalledProcessError: Command 'gn gen out\\Release_GN_x86 --ide=vs2017 --sln=cef --filters=//cef/*' returned non-zero exit status 1 in c:\code\chromium_git\chromium\src

The problem would appear to be happening with get_toolchain_dir

I found this related error report: https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=17642. I am running in an Admin cmd window. My VS 2017 is not in the default location, but in E:\bin\Microsoft Visual Studio\2017\Community, if this matters.

I also found this https://bitbucket.org/chromiumembedded/cef/issues/2132/building-cef-by-following, which, in combination with the mention above of WINDOWSSDKDIR, I'm thinking I don't have the right SDK version. I checked my VS 2017 Build Tools and have 10.0.17763.0.

So I check here https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding and find that it states clearly that you need SDK version Win 10.0.19041. After installing 10.0.19041, I get the exact same error.

The SDK was installed at E:\Windows Kits. Thinking perhaps the non-standard directory was the issue, I created a symbolic link (directory type) from C:\Program Files (x86)\Windows Kits\10 to E:\Windows Kits\10 and the installation proceeded past where it had before. So there is clearly an issue with the builder not detecting the correct installation location of the windows kit.

LESSONS LEARNED:
1. Double check the prerequisites;
2. If your Windows SDK is in a non-standard location, just create a symbolic directory link.

If there's a better way to fix this, let me know, but at least I found a work-around.
tech5678
Techie
 
Posts: 10
Joined: Fri Aug 14, 2020 11:01 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 43 guests