Specify older library version using SHA?

As far as I gather if no specific version is mentioned in the library.json manifest file then the first 10 characters of the git SHA is used to specify the version. e.g. a lib can be installed with:

- platformio lib install 252 --version="e70c9d9f4e"

I would like to use a version of this library (JeelLib) from a few commits previous, is seems it’s not currently possible to specify and older version by installing the lib with previous SHA commit e.g.

- platformio lib install 252 --version="64bdc605dc"

This results in a platformio API error, am I missing something or has this feature not been implemented? Being able to specify exactly what version of a lib I want to use is very important for my project future replicability.

Very impressed with platformio btw, good job :grinning:

This is PlatformIO 3.0. See PlatformIO 3.0 Library Manager related issues.

I recommend to use temporary lib_install option for platformio.ini and remove these lines

What is more, you can specify direct path for the project directory. This line is equal to platformio run -d firmware :blush:

Thank you! Please follow us on Twitter.

Wow, it looks like you have been busy improving lib management with 3.0.

Is 3.0 ready for testing? I’m currently running 2.9.4, do I need to update before I can use lib_install option? The docs don’t mention if lib version can be specified with lib_install? e.g.

lib_install = 1 --version="xx"

It’s a nice improvement to define libs and versions in platformio.ini. That way both the compiler and travis can use the same definitions :thumbsup:

Nice, thanks, I’ve removed the cd command and replaced with above :smiley:

Done, I’ve got a blog post ready to post up on our blog. I’m sure lots of folk on our community will be interested in using platformio. After fighting with Arduino IDE and lib versions for the past 6 years platformio feels like a step change :smiley:

Here is the separate branch https://github.com/platformio/platformio/tree/feature/platformio-30. The all source code that relates to development platforms has been moved to separate repositories. This is issue #479
"platform.json" manifest for development platform · Issue #479 · platformio/platformio-core · GitHub

The library manager has not been refactored yet. I’ve just invited you to PlatformIO Club/Slack Team. I’ll post here about further beta builds of PlatformIO 3.0.

It looks that PlatformIO Library Registry doesn’t contain that version.

1 Like

Going forward will platformio library register containing SHA versioning for each commit to libraries? Does the library not contain the SHA I am after since this is an older commit made before your library crawler was active on this library repo.

You are right. Currently, the registry contains only the versions since the library was registered. You will be able to use VCS with specific branch/tag/commit in PlatformIO 3.0.

See example how does PlatformIO 3.0 allow to use verion of development platform:

The same functionality will be implemented for Library Manager.

1 Like