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 lvgl installation recommendation does not work · Issue #3960 · platformio/platformio-core · GitHub.

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 GitHub - rbarrois/python-semanticversion: Semantic version comparison for Python (see http://semver.org/)

>>> 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?

Hello,

I’m also looking to install a pre release version library (tzapu/WiFiManager also).

I tried to add in my platformio.ini project file

lib_deps = 
	tzapu/WiFiManager@2.0.16-rc.2

Unfortunately I’m getting the following error message

Resolving esp32dev dependencies...

Library Manager: Installing tzapu/WiFiManager @ ^2.0.16-rc.2

Error: Could not find the package with 'tzapu/WiFiManager @ ^2.0.16-rc.2' requirements for your system 'windows_amd64'

Any idea how I can pass a RC version number ?

Using platformio.ini with

lib_deps = 
	https://github.com/tzapu/WiFiManager/

I’m getting

Resolving esp32dev dependencies...

Removing unused dependencies...

Library Manager: Installing git+https://github.com/tzapu/WiFiManager/

git version 2.41.0.windows.1

Cloning into 'C:\Users\scelles\.platformio\.cache\tmp\pkg-installing-mtrqrrth'...

Library Manager: WiFiManager@2.0.16-rc.2+sha.3a303ee has been installed!

Updating metadata for the vscode IDE...

Project has been successfully updated!

But I would prefer to stick with a fixed version number in platformio.ini so I also tried

lib_deps = 
	WiFiManager@2.0.16-rc.2+sha.3a303ee

but building raises

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
--------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.3.1) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20009.0 (2.0.9)
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Library Manager: Installing WiFiManager @ 2.0.16-rc.2+sha.3a303ee
Warning! Could not find the package with 'WiFiManager @ 2.0.16-rc.2+sha.3a303ee' requirements for your system 
'windows_amd64'
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- DHT sensor library @ 1.4.4
|-- Adafruit Unified Sensor @ 1.1.9
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
Building .pio\build\esp32dev\bootloader.bin
Generating partitions .pio\build\esp32dev\partitions.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Compiling .pio\build\esp32dev\lib9b3\Adafruit Unified Sensor\Adafruit_Sensor.cpp.o
Compiling .pio\build\esp32dev\libf6d\DHT sensor library\DHT.cpp.o
Compiling .pio\build\esp32dev\libf6d\DHT sensor library\DHT_U.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\HWCDC.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\IPAddress.cpp.o
src/main.cpp:2:10: fatal error: WiFiManager.h: No such file or directory

*********************************************************************
* Looking for WiFiManager.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WiFiManager.h"
* Web  > https://registry.platformio.org/search?q=header:WiFiManager.h
*
*********************************************************************

 #include <WiFiManager.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
======================================== [FAILED] Took 10.03 seconds ========================================

 *  The terminal process "C:\Users\scelles\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'esp32dev'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.

Any idea what is wrong?

Thanks

For stable versions from the registry, you can only pass those that are registered. See PlatformIO Registry.

Per Tags · tzapu/WiFiManager · GitHub there are stable tags. So just say

lib_deps = 
	https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2

like the documentation already says.

1 Like