PlatformIO Community

Correct way to handle small changes in added libraries

I’m using vscode 1.71.0, platformio core 6.1.4 home 3.4.3 under Ubuntu 22.04.
Writing code for ESP32 with Arduino framework I added some libraries using the PlatformIO tool.

If I understand correctly it download the source codes from the repositories and put them under .pio/libdeps/. But it seems they are not git repositories anymore.

Let’s say I need to make a quick and dirty hack to a library, without having the time to fork it, make a pull request, wait to be included in the main branch (often it’s not likely the case because it’s something useful for my specific need).

Of course I can change the code in the libdeps folders, but then when I clone my own repository on another machine, it will download the source code for each lib and I will lost my changes.

What is the recommended way to keep these changes across installations?

I tried to move the downloaded library from libdeps to lib, remove the library entry in platformio.ini and change the code as needed. Still I’m not sure if it’s the best way…