3.1.0 library manager installing from git

Following on from my post:

I have a few questions about the new library manager:

###1. What is the difference / pros / cons of referencing the full git path rather than the Pio lib name or number e.g.

I.e Do all the following do the same thing?

lib_deps = JeeLib
vs.
lib_deps = https://github.com/jcw/jeelib.git
vs.
lib_deps = 252

I would quite like to use the full git path sine this makes it clear where the lib is originating from. Would I be missing out on any Pio lib manager features by doing this?


2. Where do the git SHA’s used by Pio come from?

e.g the latest version of JeeLib in PlatformIO library manager is listed to be JeeLib@c057b5f4c0. I cannot see this version anywhere in the JeeLib github repo commit list.


3. How to install lib from github?

If I try and install the library direct from github e…g

lib_deps = https://github.com/jcw/jeelib.git@c057b5f4c0

I get error:

LibraryManager: Installing jeelib @ c057b5f
git version 1.9.1
Cloning into '/home/glyn/Downloads/dev/emonpi/firmware/.piolibdeps/installing-SVBcJg-package'...
fatal: unable to access 'https://github.com/jcw/jeelib.git@c057b5f/': The requested URL returned error: 400

and Pio fails with exit status 12.

I’ve tried using your example library and get the same result e.g.

LibraryManager: Installing PJON @ v2.0
git version 1.9.1
Cloning into '/home/glyn/Downloads/dev/emonpi/firmware/.piolibdeps/installing-sVmec7-package'...
fatal: unable to access 'https://github.com/gioblu/PJON.git@v2.0/': The requested URL returned error: 400

1. What is the difference / pros / cons of referencing the full git path rather than the Pio lib name or number e.g.

lib_deps = JeeLib

“+” Install prepared (cleaned, only source code, small size) library by name
“-” An additional request to PlatformIO API to get real Library ID
“-” May cause conflict when more than one library has the same name

lib_deps = 252

“+” Optimized way (from PlatformIO Core view) to install prepared library. Using Library ID we can directly get valid DL path to lib archive
“+” 100% guarantee that specified library that you see in Library Registry will be installed. If we receive tomorrow 10 libs with the same name, the lib 252 will be installed without any conflicts.
“+” No need to bother when “JeeLib” will be renamed to “JeeLibrary” or etc. All time you refer to library with number 252
“-” No readable :frowning: However, the comments can help, for example

[env:myenv]
lib_deps =  252   ;  JeeLib

[env:myenv_multiline]
lib_deps =  
    252   ;  JeeLib
    1   ;  OneWire

lib_deps = GitHub - jeelabs/jeelib: JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs

“+” You manually control the source code of the library
“-” VCS client should be installed
“-” Huge amount of data will be transferred. If comparison with PlatformIO Library Registry, the Library Crawler exports only source code from the library. In this case, library will have a size ~10-30Kb. We keep own library archives per each version in own Library Storage.
“-” Semantic versioning doesn’t work. You are responsible manually control which branch, tag or commit to use.

2. Where do the git SHA’s used by Pio come from?

It’s here :slight_smile: Commits · jeelabs/jeelib · GitHub
The latest commit

3. How to install lib from github?

See documentation Redirecting...

platformio lib [STORAGE_OPTIONS] install <repository#tag> (“tag” can be commit, branch or tag)

It means, that for URL the # symbol should be used. A “dog” @ symbol is intended to be used with libraries from PlatformIO Library Registry.

1 Like