VS code build error - ninja: error: loading 'build.ninja':

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VS code build error - ninja: error: loading 'build.ninja':

Jump to solution
1,291 Views
dan_ash
NXP Employee
NXP Employee

I was happily using VS Code building RT700 code using mcuxsdk repo 25.12.00. 

All the sudden my projects would not build and I saw message: 

Workspace is /c:/projects/mcuxsdk/mcuxsdk/examples/demo_apps/hello_world
build task started....
"C:\Program Files\CMake\bin\cmake.EXE" --build C:/projects/mcuxsdk/mcuxsdk/examples/demo_apps/hello_world/debug --target all --
ninja: error: loading 'build.ninja': The system cannot find the file specified.

I am sure I did something.

I removed the repo and re-cloned. Reimported core0 hello world. 

Any ideas? Thank you.

Still same.

I saw community post: https://community.nxp.com/t5/i-MX-Processors/I-have-a-problem-to-run-a-project-and-gave-me-an-Error-...

The post states the files need the following variables set properly

1) mcux_include.json - ARMGCC_DIR

My file: "ARMGCC_DIR"
: "C:/NXP/MCUXpressoIDE_25.6.136/ide/tools"

2) .vscode\mcuxpresso-tools.json - toolchainPath

My file: "toolchainPath": "C:/NXP/MCUXpressoIDE_25.6.136/ide/tools"

 

0 Kudos
Reply
1 Solution
1,246 Views
dan_ash
NXP Employee
NXP Employee

After chatting with Jason, I realized I had not seen the first error which was missing yaml.

What happened was I had some other issue and installed Python (3.13) from VS Code (extensions), but I already had a working 3.14 I installed in Windows, which had yaml. I had also copied west.exe to that Python folder. And my path had the 3.14 folder.

Once I uninstalled (Windows settings apps uninstall) the 3.13 I installed from VS code everything worked again.

Long story, 3.13 did not have yaml, but I decided to simply remove it and rely on the original 3.14 I had.

Sorry I went back more in the build and found

-- Ninja version: 1.13.1

CMake Error at C:/projects/mcuxsdk/mcuxsdk/cmake/extension/mcux_module.cmake:74 (message):

Traceback (most recent call last):

File "C:\projects\mcuxsdk\mcuxsdk\scripts\misc\mcux_module.py", line 28, in <module>

import yaml

ModuleNotFoundError: No module named 'yaml'

Call Stack (most recent call first):

c:/projects/mcuxsdk/mcuxsdk/cmake/extension/mcux.cmake:279 (include)

CMakeLists.txt:5 (project)


-- Configuring incomplete, errors occurred!

Configure finished with return code 1

* The terminal process terminated with exit code: 1.

* Terminal will be reused by tasks, press any key to close it.

* Executing task: CMake: build

Workspace is /c:/projects/mcuxsdk/mcuxsdk/examples/demo_apps/hello_world

build task started....

"C:\Program Files\CMake\bin\cmake.EXE" --build C:/projects/mcuxsdk/mcuxsdk/examples/demo_apps/hello_world/debug --target all --

ninja: error: loading 'build.ninja': The system cannot find the file specified.

build finished with error(s).

 

View solution in original post

3 Replies
1,261 Views
fsl_jason_yu
NXP Employee
NXP Employee

Hi @dan_ash ,

I didn't see this issue before. Could you please confirm:

1. The new cloned repo is clean.

2. The imported project folder is clean.

3. When you see the error, does the file "ninja.build" exist? 

fsl_jason_yu_0-1762741557665.png

 

0 Kudos
Reply
1,257 Views
dan_ash
NXP Employee
NXP Employee

@fsl_jason_yu ,

This is all I see.

dan_ash_0-1762742293975.png

No ninja.build, but it was there before when things works.

 

 

 

 

 

0 Kudos
Reply
1,247 Views
dan_ash
NXP Employee
NXP Employee

After chatting with Jason, I realized I had not seen the first error which was missing yaml.

What happened was I had some other issue and installed Python (3.13) from VS Code (extensions), but I already had a working 3.14 I installed in Windows, which had yaml. I had also copied west.exe to that Python folder. And my path had the 3.14 folder.

Once I uninstalled (Windows settings apps uninstall) the 3.13 I installed from VS code everything worked again.

Long story, 3.13 did not have yaml, but I decided to simply remove it and rely on the original 3.14 I had.

Sorry I went back more in the build and found

-- Ninja version: 1.13.1

CMake Error at C:/projects/mcuxsdk/mcuxsdk/cmake/extension/mcux_module.cmake:74 (message):

Traceback (most recent call last):

File "C:\projects\mcuxsdk\mcuxsdk\scripts\misc\mcux_module.py", line 28, in <module>

import yaml

ModuleNotFoundError: No module named 'yaml'

Call Stack (most recent call first):

c:/projects/mcuxsdk/mcuxsdk/cmake/extension/mcux.cmake:279 (include)

CMakeLists.txt:5 (project)


-- Configuring incomplete, errors occurred!

Configure finished with return code 1

* The terminal process terminated with exit code: 1.

* Terminal will be reused by tasks, press any key to close it.

* Executing task: CMake: build

Workspace is /c:/projects/mcuxsdk/mcuxsdk/examples/demo_apps/hello_world

build task started....

"C:\Program Files\CMake\bin\cmake.EXE" --build C:/projects/mcuxsdk/mcuxsdk/examples/demo_apps/hello_world/debug --target all --

ninja: error: loading 'build.ninja': The system cannot find the file specified.

build finished with error(s).

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2201285%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EVS%20code%20build%20error%20-%20ninja%3A%20error%3A%20loading%20'build.ninja'%3A%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201285%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20was%20happily%20using%20VS%20Code%20building%20RT700%20code%20using%20mcuxsdk%20repo%2025.12.00.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAll%20the%20sudden%20my%20projects%20would%20not%20build%20and%20I%20saw%20message%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWorkspace%20is%20%2Fc%3A%2Fprojects%2Fmcuxsdk%2Fmcuxsdk%2Fexamples%2Fdemo_apps%2Fhello_world%3CBR%20%2F%3Ebuild%20task%20started....%3CBR%20%2F%3E%22C%3A%5CProgram%20Files%5CCMake%5Cbin%5Ccmake.EXE%22%20--build%20C%3A%2Fprojects%2Fmcuxsdk%2Fmcuxsdk%2Fexamples%2Fdemo_apps%2Fhello_world%2Fdebug%20--target%20all%20--%3CBR%20%2F%3Eninja%3A%20error%3A%20loading%20'build.ninja'%3A%20The%20system%20cannot%20find%20the%20file%20specified.%3C%2FP%3E%0A%3CP%3EI%20am%20sure%20I%20did%20something.%3C%2FP%3E%0A%3CP%3EI%20removed%20the%20repo%20and%20re-cloned.%20Reimported%20core0%20hello%20world.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAny%20ideas%3F%20Thank%20you.%3C%2FP%3E%0A%3CP%3EStill%20same.%3C%2FP%3E%0A%3CP%3EI%20saw%20community%20post%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors%2FI-have-a-problem-to-run-a-project-and-gave-me-an-Error-to-build%2Fm-p%2F2068732%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors%2FI-have-a-problem-to-run-a-project-and-gave-me-an-Error-to-build%2Fm-p%2F2068732%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EThe%20post%20states%20the%20files%20need%20the%20following%20variables%20set%20properly%3CBR%20%2F%3E%3CBR%20%2F%3E1)%26nbsp%3Bmcux_include.json%20-%26nbsp%3B%3CSPAN%3EARMGCC_DIR%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3E%3CBR%20%2F%3EMy%20file%3A%20%22ARMGCC_DIR%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22C%3A%2FNXP%2FMCUXpressoIDE_25.6.136%2Fide%2Ftools%22%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E2)%26nbsp%3B.vscode%5Cmcuxpresso-tools.json%20-%26nbsp%3B%3CSPAN%3EtoolchainPath%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EMy%20file%3A%20%22toolchainPath%22%3C%2FSPAN%3E%3CSPAN%3E%3A%20%3C%2FSPAN%3E%3CSPAN%3E%22C%3A%2FNXP%2FMCUXpressoIDE_25.6.136%2Fide%2Ftools%22%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201426%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20VS%20code%20build%20error%20-%20ninja%3A%20error%3A%20loading%20'build.ninja'%3A%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201426%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAfter%20chatting%20with%20Jason%2C%20I%20realized%20I%20had%20not%20seen%20the%20first%20error%20which%20was%20missing%20yaml.%3C%2FP%3E%0A%3CP%3EWhat%20happened%20was%20I%20had%20some%20other%20issue%20and%20installed%20Python%20(3.13)%20from%20VS%20Code%20(extensions)%2C%20but%20I%20already%20had%20a%20working%203.14%20I%20installed%20in%20Windows%2C%20which%20had%20yaml.%20I%20had%20also%20copied%20west.exe%20to%20that%20Python%20folder.%20And%20my%20path%20had%20the%203.14%20folder.%3C%2FP%3E%0A%3CP%3EOnce%20I%20uninstalled%20(Windows%20settings%20apps%20uninstall)%20the%203.13%20I%20installed%20from%20VS%20code%20everything%20worked%20again.%3C%2FP%3E%0A%3CP%3ELong%20story%2C%203.13%20did%20not%20have%20yaml%2C%20but%20I%20decided%20to%20simply%20remove%20it%20and%20rely%20on%20the%20original%203.14%20I%20had.%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3ESorry%20I%20went%20back%20more%20in%20the%20build%20and%20found%3CBR%20%2F%3E%3CBR%20%2F%3E--%20Ninja%20version%3A%201.13.1%3C%2FP%3E%0A%3CP%3ECMake%20Error%20at%20C%3A%2Fprojects%2Fmcuxsdk%2Fmcuxsdk%2Fcmake%2Fextension%2Fmcux_module.cmake%3A74%20(message)%3A%3C%2FP%3E%0A%3CP%3ETraceback%20(most%20recent%20call%20last)%3A%3CBR%20%2F%3E%3CBR%20%2F%3EFile%20%22C%3A%5Cprojects%5Cmcuxsdk%5Cmcuxsdk%5Cscripts%5Cmisc%5Cmcux_module.py%22%2C%20line%2028%2C%20in%20%3CMODULE%3E%3C%2FMODULE%3E%3C%2FP%3E%0A%3CP%3Eimport%20yaml%3CBR%20%2F%3E%3CBR%20%2F%3EModuleNotFoundError%3A%20No%20module%20named%20'yaml'%3CBR%20%2F%3E%3CBR%20%2F%3ECall%20Stack%20(most%20recent%20call%20first)%3A%3C%2FP%3E%0A%3CP%3Ec%3A%2Fprojects%2Fmcuxsdk%2Fmcuxsdk%2Fcmake%2Fextension%2Fmcux.cmake%3A279%20(include)%3C%2FP%3E%0A%3CP%3ECMakeLists.txt%3A5%20(project)%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E--%20Configuring%20incomplete%2C%20errors%20occurred!%3C%2FP%3E%0A%3CP%3EConfigure%20finished%20with%20return%20code%201%3CBR%20%2F%3E%3CBR%20%2F%3E*%20The%20terminal%20process%20terminated%20with%20exit%20code%3A%201.%3C%2FP%3E%0A%3CP%3E*%20Terminal%20will%20be%20reused%20by%20tasks%2C%20press%20any%20key%20to%20close%20it.%3CBR%20%2F%3E%3CBR%20%2F%3E*%20Executing%20task%3A%20CMake%3A%20build%3CBR%20%2F%3E%3CBR%20%2F%3EWorkspace%20is%20%2Fc%3A%2Fprojects%2Fmcuxsdk%2Fmcuxsdk%2Fexamples%2Fdemo_apps%2Fhello_world%3C%2FP%3E%0A%3CP%3Ebuild%20task%20started....%3C%2FP%3E%0A%3CP%3E%22C%3A%5CProgram%20Files%5CCMake%5Cbin%5Ccmake.EXE%22%20--build%20C%3A%2Fprojects%2Fmcuxsdk%2Fmcuxsdk%2Fexamples%2Fdemo_apps%2Fhello_world%2Fdebug%20--target%20all%20--%3C%2FP%3E%0A%3CP%3Eninja%3A%20error%3A%20loading%20'build.ninja'%3A%20The%20system%20cannot%20find%20the%20file%20specified.%3CBR%20%2F%3E%3CBR%20%2F%3Ebuild%20finished%20with%20error(s).%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3C%2FBLOCKQUOTE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201374%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20VS%20code%20build%20error%20-%20ninja%3A%20error%3A%20loading%20'build.ninja'%3A%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201374%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F57117%22%20target%3D%22_blank%22%3E%40fsl_jason_yu%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThis%20is%20all%20I%20see.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22dan_ash_0-1762742293975.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dan_ash_0-1762742293975.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364551i74405B9B58F69154%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22dan_ash_0-1762742293975.png%22%20alt%3D%22dan_ash_0-1762742293975.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ENo%20ninja.build%2C%20but%20it%20was%20there%20before%20when%20things%20works.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2201360%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20VS%20code%20build%20error%20-%20ninja%3A%20error%3A%20loading%20'build.ninja'%3A%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2201360%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F204615%22%20target%3D%22_blank%22%3E%40dan_ash%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EI%20didn't%20see%20this%20issue%20before.%20Could%20you%20please%20confirm%3A%3C%2FP%3E%0A%3CP%3E1.%20The%20new%20cloned%20repo%20is%20clean.%3C%2FP%3E%0A%3CP%3E2.%20The%20imported%20project%20folder%20is%20clean.%3C%2FP%3E%0A%3CP%3E3.%20When%20you%20see%20the%20error%2C%20does%20the%20file%20%22ninja.build%22%20exist%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22fsl_jason_yu_0-1762741557665.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22fsl_jason_yu_0-1762741557665.png%22%20style%3D%22width%3A%20347px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F364544i7C363F9C79CC7B37%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22fsl_jason_yu_0-1762741557665.png%22%20alt%3D%22fsl_jason_yu_0-1762741557665.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E