-
Notifications
You must be signed in to change notification settings - Fork 26
Description
I've just been through about 4-6 hours of struggle to install this extension (in latest vscode, in Win11), create new project from example 'blink', compile and run.
Initially I had many other extensions installed in vscode, as I use it for other projects, but I tried using a fresh profile, and ultimately wiped vscode completely and started fresh, to no avail.
The failure mode was that upon initiating "new project from example" from the pico extension, I begin getting the notifications in the bottom right about it installing the toolchain, but it would make some progress and then fail - sometimes ending with an error that it failed to install the toolchain, sometimes an error that it failed to install CMake. At that point the project folder existed, however the 'build' folder was empty; hitting 'compile' just errored out as build.ninja didn't exist, and the commands 'configure cmake' and 'clean cmake' in the pico extension both error out. Closing and reopening vscode didn't cause it to reattempt the toolchain install. Going as far as uninstalling all extensions and vscode itself, deleting c:\users<username>.vscode and %APPDATA%\Code, reinstalling all from scratch, which also didn't cause it to reattempt the toolchain install.
After some trial and error I found that closing vscode, deleting the c:\users<username>.pico-sdk directory, reopening vscode and attempting to create the example project again was sufficient to trigger it to reattempt toolchain installation. Amidst my googling, I found one lonely forum post where someone said to just keep trying the toolchain install repeatedly until it works, because it's fragile and doesn't recover from any sort of hiccups... So I just repeated this again and again - and frustratingly, it would fail with different errors on successive tries of exactly the same process - until a half dozen or so tries later, it finally completed the entire toolchain install without errors, the build folder of the blink project was not empty, and it compiled and ran fine.
Needless to say, while I'm glad it finally worked, this "definition of insanity" approach was very frustrating.
I'm at a loss as to what exactly was failing in these instances, since I was unable to find any relevant log messages in any of the vscode outputs, and don't know where to look for log files (if there are any) - all I really got was the vscode notifications, which are very terse.
Ideally it would be great if the installation process could gracefully handle such errors, but failing that, it would be helpful if it could at least:
A) provide some useful log message outputs to the user during toolchain install, especially in the event of failures, and
B) have some ability to recover from a failed install, even if it's as basic as the nuclear approach of wiping the .pico-sdk directory in the event of unrecoverable toolchain install errors