Strange version being installed by library manager?

I’m just experimenting with PlatformIO for Arduino development and I’ve come totally unstuck quite early on.

I’m using the LVGL library. So, I thought, OK, I’ll add it in the PIO Library manager - all seems to work fine. It says it’s installing 8.0.0, which is what I want - but my software doesn’t compile at all. Looking at it, I’m not sure what version Platform IO has installed - the files don’t seem to match any version on GitHub. They’re the right library, just very strange versions

Eg, the 8.0.0 src/extras/layout/lv_grid.h file on Github (lvgl/lv_grid.h at v8.0.0 · lvgl/lvgl · GitHub) is 7.03kB, has lots of defines, typedefs, globals etc - eg starts like

/**
 * @file lv_grid.h
 *
 */

#ifndef LV_GRID_H
#define LV_GRID_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "../../../core/lv_obj.h"
#if LV_USE_GRID

/*********************
 *      DEFINES
 *********************/
/**
 * Can be used track size to make the track fill the free space.
 * @param x how much space to take proportionally to other FR tracks
 * @return a special track size
 */
#define LV_GRID_FR(x)          (LV_COORD_MAX - 100 + x)

The version in Platform IO is 3387 bytes (nothing like 7.03kB), is missing lots of the necessary defines, typedefs, globals, etc and starts like:

/**
 * @file lv_grid.h
 *
 */

#ifndef LV_GRID_H
#define LV_GRID_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "../../../core/lv_obj.h"

/*********************
 *      DEFINES
 *********************/
#if LV_USE_GRID

What’s going on? If the PIO library registry didn’t have LVGL, or if it didn’t have version 8.0.0, I could understand it, but it says it’s got the right version, but the file contents are totally different!

It’s not exactly filling me with confidence :frowning:

PlatformIO gives you the library version that the LVGL upload in the registry.

As one can see in here

grafik

they uploaded the 8.0.0 version to PlatformIO 3 months ago (16th March 2021). Yet the file you’ve shown was changed 14 days ago and is also tagged as 8.0.0.

I have no idea what the LVGL people are doing there, releasing the library to PlatformIO and then keep on developing it, under the same version tag, on their github, changing it significantly. As said, PlatformIO gives you the library version uploaded by them, which is e.g. this file as of 16th March 2021.

There is also an issue with library’s default version recommendation making PlatformIO crash, as I’ve reported here, but that’s a separate issue.

There is also a related topic at Problem with pio lib install "lvgl/lvgl".

Really, if you want the LVGL version that matches the one at the github, you should be referring to their gitrepo and a specific branch or commit, say e.g. with

lib_deps =
   https://github.com/lvgl/lvgl.git#v8.0.0

(this repo#branch syntax is allowed per docs)

Then you will be getting what is in the repo for that tag. (which still seems to be changing a lot for a fixed version…)

Edit: In issue has been opened in https://github.com/lvgl/lvgl/issues/2315

Thank you for your reply.

I had just managed to work this out, in a roundabout way. I thought “forget PlatformIO, I’ll use ‘git clone’ straight from github” - but that actually downloaded the ‘wrong’ version as well… So, I worked out that using ‘git clone’ and specifying a particular branch worked fine, so then I worked out how to do that in PlatformIO, and that bit now seems happy (as far as I can tell).

I’d also decided that it looks as if the developer of lvgl is doing something unusual with their source control, but, not knowing how the PlatformIO library registry works, I don’t know exactly what.