PlatformIO Community

Update all libraries for version 6.0

In version 5 of Platformio the “Update All” command was very convenient, with which I could update all the frameworks and my global libraries, but now in version 6, using the new “pio pkg update” command, only the components present in the currently open project. How can I automatically update all my assets at the same time as in the previous version? That is the contents in the folders: .platformio\platforms .platformio\packages .platformio\lib.

The pio pkg update command has a -g option to update global packages (like platforms, frameworks, global libs etc). Is this what you mean?

I tried the command -g but I get nothing, the terminal returns with no output and waiting for a new command. I checked that I had something to update, and I had 3 frameworks not yet updated.

Hi @maxgerhardt

Funnily enough, I just tried a pio update and got told off, so trying the suggested pio pkg update --global did nothing and simply returns the cursor immediately. Running without the global option does update stuff though.

norman@Hubble2:~/SourceCode/PlatformIO/EEPROMupload$ pio update
This command is deprecated and will be removed in the next releases. 
Please use `pio pkg update` instead.

norman@Hubble2:~/SourceCode/PlatformIO/EEPROMupload$ pio pkg update --global

norman@Hubble2:~/SourceCode/PlatformIO/EEPROMupload$ pio pkg update
Resolving uno environment packages...
Platform Manager: Updating atmelavr @ 3.4.0
Platform Manager: Removing atmelavr @ 3.4.0
Platform Manager: atmelavr@3.4.0 has been removed!
Platform Manager: Installing platformio/atmelavr @ 4.0.0
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Platform Manager: atmelavr@4.0.0 has been installed!

Weird!

Cheers,
Norm.

Your report is exactly what I get, the pio pkg update command works, but only for the current workspace, so you have to repeat it for each project that uses different libraries or frameworks. It used to be much better, just one command to update everything.

1 Like

Maybe @ivankravets has an idea here?

1 Like

It works if you specify packages that you would like to update. See pio pkg update — PlatformIO latest documentation

For example

pio pkg update -g -p atmelavr
1 Like

We dropped support for global packages in favor of declrative approach when working on embedded projects. This is a part of our mission on improving the lives of everyday engineers. Using global packages and updating them to the latest versions can break your projects that are not compatible with the new API.

The @maxgerhardt can confirm, we receive very often complaints when developers say that “1 month ago my project worked and after the pio update it does not work anymore”. Of course, pointing to the semantic versioning solves this issue. However, it is better if we can predict these breaking changes.

Please note that PlatformIO Core 6.0 DOES NOT duplicate your dev-platforms and toolchains for every project. Even when you manage multiple project with isolated deps using semantic versioing, PlatformIO automatically resolves dependdecys from its internal common storage. The only libraries are duplicated because LDF depends on them. Nevertheless, libraries are also cached to the .cached folder.

I think you will be thankful to PIO Core 6.0 if you back to your project after 5-10 years and you will see “SUCCESS” when running pio run.

1 Like

So you always have to specify what to update, which is always manual, and you have to repeat it for each framework and library. Personally I think it is a shame to have lost that function, perhaps put it in the background, for example only as a CLI command for those who want to use it again. Then if you know that it is a feature that gives you problems, it would be enough not to use it.

That is not true if you follow declaring practices and use pio pkg update. Please note that the next update to the PlatformIO IDE for VSCode will bring commands to manage project dependencies.

We understand that people are used to Eclipse-based and ArduinoIDEs and “global” things (toolchains, SDKs, libraries). Sorry, we have absolutely opposite vision to existing tools in the market on how embedded development workflow should look. This is the reason why over 2,000,000 developers around the globe move away from the competitive tools to the PlatformIO.

P.S: We didn’t have plans to make problems for developers or add any complexity. We just improve our ecosystem to guarantee developers full project reproducibility on any host machines even after decades.

I understand, thanks.