raspberrypi / pico-vscode

The official VS Code extension for Raspberry Pi Pico development. It includes several features to simplify project creation and deployment.
https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico
Mozilla Public License 2.0
131 stars 16 forks source link

Deleting the build folder. #98

Closed SaxonRah closed 1 month ago

SaxonRah commented 1 month ago

In previous versions, I swear I could delete the build folder then click Configure CMake everything would be fine and I could still compile. No errors.

Now doing the same thing, results in: ninja: error: loading 'build.ninja': The system cannot find the file specified.

Running cmake -G Ninja .. in the build folder after clicking Configure CMake in the extension, solves the ninja error.

I had a friend contact me about this same problem, they had accidently deleted the build folder, and since I already knew the solution, I was able to solve that for them effortlessly. They apparently searched and struggled with it for a day or two and couldn't figure it out.

I'm partly posting this issue so people can find a solution if they encounter this, as well ask if this is expected functionality? I don't think I remember running cmake -G Ninja .. in the build folder before, but I could be wrong as I have to use that command for other toolchains and just can't remember.

will-v-pi commented 1 month ago

It looks like the notification saying configuration is complete pops up before configuration is actually complete - could you try waiting 10s (or until the build.ninja file appears in the build folder) after clicking Configure CMake before you click Compile and see if that works?

Prototype-Laboratory commented 1 month ago

Hi, I am facing the same issue. The build.ninja file did not appear after waiting. The workaround, running cmake -G Ninja .. in the build folder after clicking Configure CMake in the extension, works for me too, but it isn't convenient. I'm using Linux.

Regards

Prototype-Laboratory commented 1 month ago

Ok, I found the mistake. In one of my CMakeLists.txt files in my project folder was the path to the pico_sdk_import.cmake file wrong. After I have corrected it, it is working now.

paulober commented 1 month ago

@SaxonRah Just pushed a commit that should fix this issue. Can you confirm with the preview build?

SaxonRah commented 1 month ago

@SaxonRah Just pushed a commit that should fix this issue. Can you confirm with the preview build?

Yes, That does fix the problem. The build.ninja file seems to be generated before/at the same time as the popup.