zephyr: ninja: error: loading 'build.ninja': No such file or directory
If a pristine build fails during CMake configure, it leaves a build folder that breaks incremental building. The telltale log message is ninja: error: loading 'build.ninja': No such file or directory. This problem does not appear in vanilla non-Zephyr CMake.
To Reproduce Steps to reproduce the behavior:
- Start with the hello world sample.
- Make sure there is no build folder yet.
- Add some error to CMakeLists.txt. E.g. append
this_is_not_defined(). - Run
west build -b native_posix. (Selected board is irrelevant.) - Observe CMake error.
- Fix error in CMakeLists.txt.
- Run
west buildfor incremental build. - Observe bug
ninja: error: loading 'build.ninja': No such file or directory.
The workaround is to delete the build folder.
Impact User confusion, major annoyance.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 17 (14 by maintainers)
I did not say it was a west issue. I added the “area: Build System” label. @thedjnK changed it to “area: West”. This is a DX issue that should be addressed, so I’ll reopen this.
I still think it’s a
west buildfailure. If it was really a “convenient wrapper” it would:build.ninjajust runninja buildbuild.ninja, do a cmake run beforeDoesn’t seem like rocket science to me, and would solve this UX issue.
and just to make it clear, from
west help build: