Trying to install the RP2040 / RasPi Pico software development kit.
There's a script. Easy, right?
Well... it makes sure various distro-supplied tools are installed. OK so far.
Then it brings in source code from the Git repositories, guaranteeing the very freshest.
Then it compiles everything... and, oops.
It gets partway through, and on one source file for one subsystem, it issues a warning about misleading indentation (which wouldn't be needed if programmers would use braces consistently), because this file has (paraphrasing, since the actual stuff is on my other computer):
if (foo == WONKY)
return status;
LOG_MESSAGE("Status is %02X", status);
instead of a decently-formatted:
if (foo == WONKY) {
return status;
} LOG_MESSAGE("Status is %02X", status);
or:
if (foo == WONKY)
return status;
LOG_MESSAGE("Status is %02X", status);
or even the presumably-intended (but in violation of the One True Brace doctrine):
if (foo == WONKY)
return status;
LOG_MESSAGE("Status is %02X", status);
So, a warning. Big deal. Except that, in addition to enabling this rather arcane warning (and presumably many others), whatever level of build script / Makefile is invoking the compiler is also including the option to treat all warnings as errors. Ergo, this little formatting quirk means the whole thing won't build.
Maybe I need to see if there's a newer version of the install script that does something differently. Elsewise, I gotta explore the source tree and figure out how to do the build, after fixing the formatting, without having a fresh copy of the erroneously-indented source pulled in. This is already getting more Educational than I'd planned on.
Update: There is indeed a newer, restructured version of the script. It looks like that part of the source builds just fine. But... then it's trying to install something, possibly VS Code, which is not available via apt
but is available via snap
... except that snap
gives a security warning about the available version of the package, suggests trying again with --classic
if one isn't concerned about sandbox integrity... and, if invoked with --classic
, segfaults out.
Gngngngn....
Now downloading the latest official Microsoft VS Code for Linux as a .deb for AMD64; I'll see if that plays nice.
Update 2: VS Code installed just fine. The script still tries to do strange things, and can't be relaunched after a failure without deleting the target directory and starting over from the beginning. Now, the script is intended for installing the SDK on a RasPi, specifically, so... guess I need to RTFM and follow the approved generic-host installation process. (It appears that I'll also need to drag in the tinyusb
package, though there may be some magic for somewhat automating that.)
And, of course, I've never used VS Code before. Or... I guess I made some use of a VS-based IDE, some years ago, back when it was Windows-only. I don't remember much about how to use it. Well, the command line is still a thing, right?
Comments