platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

Add support for subdirectories when adding git repos as a library

Open jimbobbennett opened this issue 3 years ago • 7 comments

Some libraries are available as folders inside a Git repo. One example being ArduCAM.

The Arduino code for the ArduCAM is in this repo: https://github.com/ArduCAM/Arduino. Rather than have one library in this repo, it contains multiple libraries each inside a folder in this repo. It would be a great enhancement to be able to specify a folder inside a git repo for a library dependency to remove the need to configure library directories, or download the repo and copy one folder into the lib folder.

For example, being able to write something like:

lib_deps =
    https://github.com/ArduCAM/Arduino/tree/master/ArduCAM

jimbobbennett avatar Jun 30 '21 01:06 jimbobbennett

This would also help pio work better with monorepos!

TheButlah avatar May 24 '22 16:05 TheButlah

This feature is important

DreamPWJ avatar Jul 21 '22 03:07 DreamPWJ

Yeah this would be a very useful feature

christhomas avatar Oct 22 '22 17:10 christhomas

Agreed, would be quite useful

dmezh avatar Jan 29 '23 03:01 dmezh

It would also make it possible to override individual platform libraries with forks, which unfortunately I need to do, and the workaround (separate management of a local copy of that repo along with a symlink:// lib_dep) is error-prone.

teejaydub avatar Feb 02 '23 15:02 teejaydub

I would agree to this, a whole bunch of ESP-IDF components, for example, are in the ESP-BSP-repository and I cannot add them as it is now. There are many more examples of this, please add this functionality.

Accepting a https://github.com/espressif/esp-bsp.git/components/esp_lvgl_port-syntax, by identifying the break at the ".git", or using some other scheme. Or add a "path", as in idf_component.yml. It is quite usable. Maybe the best variant, as then you could combine with other schemes, and it is the most clear.

nicklasb avatar Feb 25 '24 17:02 nicklasb

I also just noted that the maximum length of the URL, it seems like it is only 100 characters, which is super tight and will probably run out in many cases. The max length for most browsers are around 2000 characters, and several permanent link schemes has more than 100 characters. Basically I see no 2024 reason for restricting the URL length in such a severe manner.

This actually became a problem, I had to just not manually upload, but rename: https://github.com/RobustoFramework/Robusto/releases/download/v0.1.5-alpha/espressif_esp_lvgl_port_1.4.0.zip to https://github.com/RobustoFramework/Robusto/releases/download/v0.1.1-alpha/esp_lvgl_port_1.4.0.zip

..to be able to refer to them in the dependencies.

nicklasb avatar Feb 25 '24 18:02 nicklasb