Build configuration stale AGAIN (unrecoverable)

This happens quite often, I simply has to create a new build configuration and in worse cases simply a new application and copy all my sourcefiles over to the new project.

This time I have a little info on what actually happened.

I have been working on this project for the last days, without any problem. Everything is latest version SDK, toolchain, VS code etc.

My project is under git control so I can see what is changed!

 - I did a small mistake when modifying the device tree which is in a seperate boards directory and also in git. This caused the application project to not build because of DTS problem.

 - I immediately fixed the problem but when trying to build my application VS Code terminal kept telling me that a build was already active so I could not start a build. I waited, tried to clean the build configuration and other things for 30 minutes. Unable to get out of the state that the system thought there was an active build in progress. 

 - So finally I exited VS Code and restarted.

 - Now it opens with "The build configuration is stale. Run a prestine build". But this is not possible i get the following:

.... <next message>

For some reason it is impossible to get my project back in working condition.

I can see that there is a CMake warning followed by the error that configuration is incomplete!

There are no changes to my code or makefiles for the project.

This must be something in the build directory (that is excluded from git...) and it happens caused by a build error.

I am reporting this in the hope that Nordic some day will look at the unstable environment issue. This is something that happens way too often and I see others writing about it also. This is propably just an example of what can go wrong. In this case I think that making a new build configuration will solve the problem, but it is not nice. I have projects with many "dead" build configurations and I loose development time, every time it happens.

  • Lets say it was a syntax error in the DTS file. So create a syntax error in a DTS file for the board. Make a prestine build, the build will fail. And the build will be STALE. If you fix you syntax error in the board DTS the problem should be fixed, but the build is no longer available.

    But as Turbo J is writing, it should be easy to reproduce, just kill the build process early. 

  • Create a project from scratch based on hello_world.

    Selected nrf9151dk/nrf9151dk as board.

    Build the project.

    Now add a devicetree overlay called error.dts. Put some garbage in the file.

    In the build configuration select Generate and Build and close the view.

    Now you get a build error: 

    -- Configuring incomplete, errors occurred!
    See also "D:/Workspaces/hello_world_5/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: 'D:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.EXE' -DWEST_PYTHON=D:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe '-Bd:\Workspaces\hello_world_5\build' -GNinja -DBOARD=nrf9151dk/nrf9151/ns -DDTC_OVERLAY_FILE=error.dts -DBOARD_ROOT=d:/nrfboards '-SD:\ncs\v3.0.2\zephyr\share\sysbuild' '-DAPP_DIR:PATH=d:\Workspaces\hello_world_5'

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

    The build configuration is gone:


    This is of course not how it happens normally, it would be a real board DTS and it would be a real project.

    You are unable to get the build configuration back, and will have to create a new one.

  • Hi,

    Turbo J said:

    The problem is trivial to reproduce: Just kill the build process early during initial or pristine build. 

    Result is a build dir thats completely unusable in VS code (and won't even be detected when you restart the IDE).

    Can you elaborate how build folder is unusable in VS Code? 
    I have tried canceling build process while it was running but the build was detected after restarting VS Code.

    Thomas said:

    Now add a devicetree overlay called error.dts. Put some garbage in the file.

    In the build configuration select Generate and Build and close the view.

    How did you include error.dts in your build when you got build error?

    Best regards,
    Dejan

  • I included an dummy error.dts with garbage in the build setup as extra device tree overlay.

  • Normally the build simply dissapears from the menu (APPLICATIONS). This means you are no longer able to select the build and rebuild the project.

Related