As of 2021 the problem still occur. I use arduino mega 2560 and the arduino framework. Core pio is 5.0.4 and Home is 3.3.1
I have written my own library that has a dependency on mcp2515 library. MCP2515 depends on SPI.h. The issue came suddenly without changes. Can be temporarily solved by including in the main.cpp of the project SPI.h or by adding SPI.h dependency into library.json or by deep+ in platformio.ini
lib_dir = ../../common_lib
platform = atmelavr
board = megaatmega2560
framework = arduino
monitor_speed = 115200
The problematic lib is in base_framework folder.
Updating platformio/contrib-piohome 3.3.1 @ ~3.3.1 [Up-to-date]
Updating platformio/contrib-pysite 2.38.201019 @ ~2.38.0 [Incompatible 2.39.201019]
Updating platformio/tool-unity 1.20500.200612 @ ~1.20500.0 [Up-to-date]
Updating platformio/tool-scons 4.40001.0 @ ~4.40001.0 [Up-to-date]
Updating platformio/atmelavr 3.1.0 [Up-to-date]
Updating platformio/toolchain-atmelavr 1.50400.190710 @ ~1.50400.0 [Up-to-date]
Updating platformio/framework-arduino-avr 5.1.0 @ ~5.1.0 [Up-to-date]
Updating platformio/tool-avrdude 1.60300.200527 @ ~1.60300.0 [Up-to-date]
Updating platformio/ststm32 11.0.0 [Up-to-date]
Updating platformio/toolchain-gccarmnoneeabi 1.70201.0 @ >=1.60301.0,<1.80000.0 [Up-to-date]
Updating platformio/framework-arduinoststm32 4.10900.200819 @ ~4.10900.0 [Up-to-date]
Updating platformio/tool-stm32duino 1.0.1 @ ~1.0.1 [Up-to-date]
Updating platformio/tool-openocd 2.1000.200630 @ ~2.1000.0 [Up-to-date]
Updating platformio/tool-dfuutil 1.9.200310 @ ~1.9.190708 [Up-to-date]
Library Storage: /Users/x/.platformio/lib
Updating TaskScheduler 3.1.6 [Updating to 3.2.2]
Library Manager: Installing TaskScheduler @ 3.2.2
Library Manager: TaskScheduler @ 3.2.2 has been installed!
After playing around with includes and dependencies the problem resolved the same as appear, just because of no reason. I have now the same state as before the problem. No includes, no dependencies no ldf params.
I suspect that the order of dependency walktrough of ldf has some issue. The spi lib was more far behind as the issue occured. Now SPI lib is again more at the start of ldf process. It is also now one at the only time it was found, back before at the problem it resolved multiple times.