PlatformIO Community

Lib_deps not included, should warn about compatibility

A recent update in PIO Core (not sure when, but I ran update and it broke) caused a library I was using (ArduinoJSON) to not be included in compilation (did not show up on the Dependency Tree, could not find headers). It was a result of the default ldf_compat_mode = off, and the library was only compatible with Arduino framework, and I’m not using any framework. This took a while to uncover and fix. I think it would be nice if there was a warning when libraries that are meant to be included (in lib_deps) but are blocked for comparability.


Running pio update could mean it was a update one of the PIO packages, toolchain, framework or the library… unless you had the library version locked. pio upgrade is the command that upgrades PIO itself :wink:

The lib_compat_mode parameter has three optionsoff (no check), soft (default, check for compatibility with framework) and strict (check for compatibility with framework AND platform).

So I take it what you are really asking for is for the default soft (and strict also, for that matter) to actually show a message saying that a explicitly included library has been excluded because of the compatibility check (just so you know you’re not going completely mad?)? And probably that the lib_compat_mode actually default to off if there’s no framework specified? Does that sound about right?

i.e. To reproduce the behaviour, with this env, PlatformIO in either the default soft or strict mode does not show the LWMQTT library (and ESPIDF framework only library) in the dependency tree, or try to compile the source code for it. But will show and compile MqttTopicHelper (Arduino framework compatible).

platform = espressif32
board = esp32cam
framework = arduino
;lib_compat_mode = strict
lib_deps = 
   5671 ; LWMQTT library for ESP32 (ESP-IDF)
;    302 ; MqttTopicHelper

Yes, that’s exactly my thought. I may have ran pio update or pio upgrade, or both, not really sure. All I know is the project had not changed at all, and suddenly builds were failing.

I’ve put a feature request issue up, so hopefully that will get resolved. :wink:

If you don’t use framework and library depends on it, we can’t build it. You can see detailed warnings in Verbose Build or pio run -v.

1 Like

I understand, but in this case the library (like most) only needed millis()
I don’t expect the default behavior to change, I just think having it not fail silently would be an improvement.

1 Like