PlatformIO downloads subfolder

I haven’t found any notice in docs, on forums or anywhere else, so posting here.

When I try to download GitHub - digint/tinyfsm: A simple C++ finite state machine library it downloads… examples folder? It doesn’t make any sense but I can’t find any solution.

Is there any additional internal logic in pio that does it?



From experience, PlatformIO incoroporates a logic that searches for the first valid library package nested in the repository. This is because a few people put the actual library folder in a subfolder in the repo and that is then supposted to be picked up (instead of the top-level folder). The search logic here seems to be to find the first folder that has an actual metafile (library.json, or code file .cpp in it. And the result of that in this repo is that the first folder of the first subfolder fullfills this condition.

Still, you can include it as follows, by:

Note: Care must be taken when using C++ standard library stuff. The example heavily uses std::cin and std::cout for input / output. This makes the size explode on embedded targets. When compiling for an STM32 for example, using std::cin adds ~150 KBytes of flash memory usage (most boards have like 64 to 256 KByte). When that is removed and the pure Serial object from Arduino is used, the size of the entire firmware shrinks to 12 Kbyte.

There’s a full example at: GitHub - maxgerhardt/tinyfsm-arduino-example: Example project for tinyfsm library without a lot of C++ standard dependencies

It’s actually a regression as everything works on 4.4.0. Quite strange that there is no way to override default behavior.

Thanks a lot for the forked example!

Upd: somehow tinyfsm is still downloaded incorrectly. Trying to find other solutions.

Upd2: stupid me, I should have used master