dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.37k stars 189 forks source link

Ninja not found error! #2486

Closed sajjadarashhh closed 6 months ago

sajjadarashhh commented 6 months ago

when i trying to build project i give this error:

 [vcvarsall.bat] Environment initialized for: 'x64'
  BUILD: Regenerating the Visual Studio solution
  Calling "D:\Projects\Users\sajja\Documents\GitHub\runtimelab\eng\native\gen-buildsys.cmd" "D:\Projects\Users\sajja\Documents\GitHub\runtimelab\src\coreclr" "D:\Projects\Users\sajja\Documents\GitHub\runtimelab
  \artifacts\obj\coreclr\browser.wasm.Debug" vs2022 wasm browser "-DRUNTIME_FLAVOR=CoreCLR" "-DCMAKE_BUILD_TYPE=Debug" "-DCLR_CMAKE_KEEP_NATIVE_SYMBOLS=1" "-DCLR_CMAKE_TARGET_ARCH=wasm" "-DCLR_CMAKE_TARGET_OS=e
  mscripten" "-DCLI_CMAKE_FALLBACK_OS=browser" "-DCLR_CMAKE_PGO_INSTRUMENT=0" "-DCLR_CMAKE_OPTDATA_PATH=" "-DCLR_CMAKE_PGO_OPTIMIZE=0" "-DCMAKE_ICU_DIR=C:\Users\sajja\.nuget\packages\microsoft.netcore.runtime.i
  cu.transport\9.0.0-alpha.1.23611.1/runtimes/browser-wasm/native"
  embuilder:INFO: building zlib
  embuilder:INFO: ...success. Took (0.00s)
  configure: "D:\Program Files (x86)\CMake\bin\cmake.exe" -DCMAKE_INSTALL_PREFIX=D:/Projects/Users/sajja/Documents/GitHub/runtimelab/artifacts/bin/coreclr/browser.wasm.Debug -DCLR_CMAKE_HOST_ARCH=wasm -DCMAKE_T
  OOLCHAIN_FILE=D:\ProgrammingTools\emsdk\upstream\emscripten/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DRUNTIME_FLAVOR=CoreCLR -DCMAKE_BUILD_TYPE=Debug -DCLR_CMAKE_KEEP_NATIVE_SYMBOLS=1 -DCL
  R_CMAKE_TARGET_ARCH=wasm -DCLR_CMAKE_TARGET_OS=emscripten -DCLI_CMAKE_FALLBACK_OS=browser -DCLR_CMAKE_PGO_INSTRUMENT=0 -DCLR_CMAKE_OPTDATA_PATH= -DCLR_CMAKE_PGO_OPTIMIZE=0 -DCMAKE_ICU_DIR=C:\Users\sajja\.nuge
  t\packages\microsoft.netcore.runtime.icu.transport\9.0.0-alpha.1.23611.1/runtimes/browser-wasm/native --no-warn-unused-cli -G Ninja -B D:\Projects\Users\sajja\Documents\GitHub\runtimelab\artifacts\obj\coreclr
  \browser.wasm.Debug -S D:\Projects\Users\sajja\Documents\GitHub\runtimelab\src\coreclr -DCMAKE_CROSSCOMPILING_EMULATOR=D:/ProgrammingTools/emsdk/node/16.20.0_64bit/bin/node.exe
  Not searching for unused variables given on the command line.
  CMake Error at D:/Program Files (x86)/CMake/share/cmake-3.28/Modules/CMakeDetermineSystem.cmake:176 (message):
    Could not find toolchain file:
    D:\ProgrammingTools\emsdk\upstream\emscripten/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
  Call Stack (most recent call first):
    CMakeLists.txt:4 (project)

  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
  CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
  -- Configuring incomplete, errors occurred!
  emcmake: error: '"D:\Program Files (x86)\CMake\bin\cmake.exe" -DCMAKE_INSTALL_PREFIX=D:/Projects/Users/sajja/Documents/GitHub/runtimelab/artifacts/bin/coreclr/browser.wasm.Debug -DCLR_CMAKE_HOST_ARCH=wasm -DC
  MAKE_TOOLCHAIN_FILE=D:\ProgrammingTools\emsdk\upstream\emscripten/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DRUNTIME_FLAVOR=CoreCLR -DCMAKE_BUILD_TYPE=Debug -DCLR_CMAKE_KEEP_NATIVE_SYMBOLS=
  1 -DCLR_CMAKE_TARGET_ARCH=wasm -DCLR_CMAKE_TARGET_OS=emscripten -DCLI_CMAKE_FALLBACK_OS=browser -DCLR_CMAKE_PGO_INSTRUMENT=0 -DCLR_CMAKE_OPTDATA_PATH= -DCLR_CMAKE_PGO_OPTIMIZE=0 -DCMAKE_ICU_DIR=C:\Users\sajja
  \.nuget\packages\microsoft.netcore.runtime.icu.transport\9.0.0-alpha.1.23611.1/runtimes/browser-wasm/native --no-warn-unused-cli -G Ninja -B D:\Projects\Users\sajja\Documents\GitHub\runtimelab\artifacts\obj\c
  oreclr\browser.wasm.Debug -S D:\Projects\Users\sajja\Documents\GitHub\runtimelab\src\coreclr -DCMAKE_CROSSCOMPILING_EMULATOR=D:/ProgrammingTools/emsdk/node/16.20.0_64bit/bin/node.exe' failed (returned 1)
  running "D:\Program Files (x86)\CMake\bin\cmake.exe" --build D:\Projects\Users\sajja\Documents\GitHub\runtimelab\artifacts\obj\coreclr\browser.wasm.Debug --target  nativeaot --config Debug --
  no such file or directory
  CMake Error: Generator: execution of make failed. Make command was:  nativeaot
  BUILD: Error: native component build failed. Refer to the build log files for details.
      "D:\Projects\Users\sajja\Documents\GitHub\runtimelab\artifacts\log\Debug\CoreCLR_browser__wasm__Debug__wasm.log"
      "D:\Projects\Users\sajja\Documents\GitHub\runtimelab\artifacts\log\Debug\CoreCLR_browser__wasm__Debug__wasm.wrn"
      "D:\Projects\Users\sajja\Documents\GitHub\runtimelab\artifacts\log\Debug\CoreCLR_browser__wasm__Debug__wasm.err"
D:\Projects\Users\sajja\Documents\GitHub\runtimelab\src\coreclr\runtime.proj(96,5): error MSB3073: The command ""D:\Projects\Users\sajja\Documents\GitHub\runtimelab\src\coreclr\build-runtime.cmd" -wasm -debug -
os browser -outputrid browser-wasm -component nativeaot -cmakeargs "-DCMAKE_ICU_DIR=C:\Users\sajja\.nuget\packages\microsoft.netcore.runtime.icu.transport\9.0.0-alpha.1.23611.1/runtimes/browser-wasm/native"" ex
ited with code 1.

Build FAILED.

D:\Projects\Users\sajja\Documents\GitHub\runtimelab\src\coreclr\runtime.proj(96,5): error MSB3073: The command ""D:\Projects\Users\sajja\Documents\GitHub\runtimelab\src\coreclr\build-runtime.cmd" -wasm -debug -
os browser -outputrid browser-wasm -component nativeaot -cmakeargs "-DCMAKE_ICU_DIR=C:\Users\sajja\.nuget\packages\microsoft.netcore.runtime.icu.transport\9.0.0-alpha.1.23611.1/runtimes/browser-wasm/native"" ex
ited with code 1.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:01:32.62
Build failed with exit code 1. Check errors above.
Some builds failed:
        Configuration: Debug, Architecture: wasm
sajjadarashhh commented 6 months ago

cmake,ninja,emscripten are configured just like everything that i understand from this document

yowl commented 6 months ago

Did you run emsdk_env.bat, or set EMSDK manually?

sajjadarashhh commented 6 months ago

Yes i set that manually

yowl commented 6 months ago

Try using the script, emsdk_env.bat . It will set EMSDK with forward slashes

EMSDK=C:/github/emsdk