PlatformIO Community

Library Manager Pre-Release Support?

Does the library manager support prerelease versioning and releases? If so I cannot get it to work with semver, any exmaples or tips, I did not see any specific mention in docs.

Arduino does support and pick these up

I’ve observed with LVGL which released a “8.0.0-dev” version as the semver that it would not install per https://github.com/platformio/platformio-core/issues/3960.

If I remember correctly, @ivankravets said in a github issue that I can’t find anymore that one should not push pre-release versions into the library registry, only stables. For pre-releases, one can use lib_deps to explicitly point to the github repository / certain branch.

Maybe he has more thoughts on this.

1 Like

Thanks, Just found that

Yes, you can publish pre-release versions to the registry. We had a problem with an incorrect installation guide on https://platformio.org/lib. Now, we generate valid SemVer specification.

How do pre-releases work wrt. unreleased dependencies?

SignalK/SensESP is currently at version 1.0.8. We’re working heavily on 2.0.0. Part of that release is splitting some code into separate add-on libraries that depend on SignalK/SensESP@^2.0.0. I have created the add-on library repos but can’t test them in real life until SensESP 2.0.0 has been released.

If I now release SignalK/SensESP 2.0.0-alpha.1:

  1. What happens if existing code has an unversioned dependency like lib_deps = SignalK/SensESP? Do they pull 1.0.8 or 2.0.0-alpha.1?
  2. What about lib_deps = SignalK/SensESP @ ^2.0.0? Does that pull 2.0.0-alpha.1?

You can test this with Python REPL (run python in PlatformIO CLI console) using https://github.com/rbarrois/python-semanticversion

>>> import semantic_version
>>> semantic_version.SimpleSpec("^2.0.0").match(semantic_version.Version("2.0.0-alpha.1"))
False

Thanks, that’s handy!

A little experimentation indicates that prereleases are to be avoided at all costs:

In [26]: SimpleSpec("<2.0.0").match(Version("2.0.0-alpha.2"))
Out[26]: False

In [27]: SimpleSpec("<=2.0.0").match(Version("2.0.0-alpha.2"))
Out[27]: True

In [28]: SimpleSpec("=2.0.0").match(Version("2.0.0-alpha.2"))
Out[28]: False

In [29]: SimpleSpec("^2.0.0").match(Version("2.0.0-alpha.2"))
Out[29]: False

In [30]: SimpleSpec("^2.0.0-alpha").match(Version("2.0.0-alpha.2"))
Out[30]: False

In [31]: SimpleSpec("^2.0.0-alpha.1").match(Version("2.0.0-alpha.2"))
Out[31]: False

In [32]: SimpleSpec("^2.0.0-alpha.2").match(Version("2.0.0-alpha.2"))
Out[32]: False

I think that is correct. 2.0.0-alpha is less than 2.0.0 (which means stable release). What do you think?