Library Dependency too aggressive in 4.3.1?

Did something change about the LDF between pio 4.2.1 and 4.3.1? In particular, v4.3.1 is including more libraries from the AdaFruit GFX library than 4.2.1 and some of those libraries do not compile on some ESP32 boards (e.g. m5stickc).

In particular, in 4.3.1 it is including these unwanted libraries:
1.1.2
1.0.5
1.3.1
SD (pulled in by one of the above)

The SD library is the one that fails to compile. I can work around this by adding the libraries to lib_ignore but I did not need to do that in earlier versions of pio.

Here’s my platformio.ini entry:

[env:m5stick]
platform = espressif32
board = m5stick-c
lib_deps =
Adafruit GFX Library
Adafruit ST7735 and ST7789 Library

I can provide compilation logs on requst.

Hi @johnm!

Did something change about the LDF between pio 4.2.1 and 4.3.1? In particular, v4.3.1 is including more libraries from the AdaFruit GFX library than 4.2.1 and some of those libraries do not compile on some ESP32 boards (e.g. m5stickc).

PlatformIO v4.3.1 now parses depends field in library.properties file. And it looks like SD library shipped with Arduino ESP32 has a strange name:

name=SD(esp32)
version=1.0.5
...
architectures=esp32

For this reason PlatformIO is not able to detect it as a dependency and downloads another library with the proper name SD from the library registry. The workaround with lib_ignore option looks optimal for the moment.

Thanks for the quick reply!

It’s nice to understand what changed. I think the reason that several unecessary libraries are getting pulled in and compiled is because the old system parsed the #ifdefs in the header files and thus skipped libraries that were not relevant to a particular board/package. It sounds as though library.properties includes all the libraries that could ever be needed on any platform. Although they don’t get linked in, downloading and compiling those extra libraries takes additional time and, as was the case with the SD library, can lead to compilation errors.

Is there a flag I could use to revert to the old #ifdef respecting behavior?

Thanks!