Why not run `pio lib update` as part of `pio run`

When you start pio run then uninstalled libs are installed automatically, so pio lib install is part of the run process.

Why doesnt pio run also call 'pio lib update`?

Another possiblity would be to have the run-process include ’pio lib update and have the update process also include installing new libraries specified in lib_deps

Because then you would have libraries updating at any random time, which could introduce new bugs, break your code completely if there are API changes, and generally cause more headaches then it’s worth. If you want to the latest and greatest, ask for it… otherwise. leave things well alone! :smiley:

If that were a behaviour your wanted, its probably possible to add it via a pre:extra_script.

1 Like

Ok, I understand that you don’t want unwanted updated of libraries, but if you specify i.e. ~1.3.1 or >1.3.0 as the version to use, you specifically say that you accept 1.3.1 or 1.3.2 etc as valid versions.
If you don’t want any updates automatically, you should specify an exact version like 1.3.0 in my opinion

The inverse is true also… if I didn’t tell it to update, I don’t expect it to change things one me! :stuck_out_tongue:

If you really want it to auto-update, turn auto update on, and set the update interval (days between checks - as you don’t really want it checking for updates every time you run a build, since that means every single build will take a bit longer).

https://docs.platformio.org/en/latest/userguide/cmd_settings.html#auto-update-libraries