How do you make LDF prioritize Framework/SDK over `core_dir/lib`?

I’m new to PlatformIO, and realize this is an odd question; maybe there is a more sensible way of doing this?!

The problem is that the ESP8266 Arduino framework includes it’s own version of ArduinoOTA, and is incompatible with the ArduinoOTA library that’s in the library manager (GitHub - JAndrassy/ArduinoOTA: Arduino library to upload sketch over network to Arduino board with WiFi or Ethernet libraries) – I’ll call this one EXT_ArduinoOTA.

If you install EXT_ArduinoOTA globally, it will be pulled into ESP8266 projects that are written against the ESP8266 builtin version… which causes them to fail to build.

I tried using lib_ignore… but that completely ignored the library- including from ESP8266 Arduino framework(!)

I could switch to EXT_ArduinoOTA for ESP8266 based projects - but the readme there notes that the ESP8266 package needs to be tweaked, and it doesn’t work with the default espota script- would prefer not to do that as it makes it more complicated for students I’m working with (and for me too!)

Is there a way to make LDF search the framework before the globally installed libraries for a given project? (I did think about hardcoding the platform library location as an extra_dirs… but I’m sure that makes it machine/user specific.)

Any other suggestions to be able to have EXT_ArduinoOTA library installed in PlatformIO but still use the version that comes with the ESP8266 version of the Arduino framework for ESP8266 based boards?

Installing libraries globally which conflict with existing framework libraries is the crux of the whole problem. I suggest users don’t do that and use per-project library management as much as possible.

Otherwise I do not know of a way that changes priorites in the LDF search.

Thanks for the quick response, and confirming my gut thoughts.

In general, I agree, but global installation makes some things easier- upgrading a group of projects to the same versions, and I’m assuming space and download savings. (I’m assuming global install effectively acts like a local cache.)

Will adjust my projects and make long term maintenance easier on myself :wink: