Distributing custom toolchain/platform?

Beyond the public registry, what are the options for distributing a custom platform and it’s custom toochain packages? I’m looking for some way to get our tools into the hands of users without too much hassle.

If you already have a custom platform, that is e.g. akin to GitHub - platformio/platform-ststm32: ST STM32: development platform for PlatformIO or GitHub - CommunityGD32Cores/platform-gd32: PlatformIO platform for ARM-based GD32{F,E,L,W} chips. Work in Progress!, you can use the platform.json to point the version of a package at an arbitrary URL where a valid package archive is stored (aka, an archive of a folder with e.g. the toolchain files and a package.json). See e.g.

If your user then opens up any project that references your custom platform (via platform = .. in the platformio.ini) or the user installs the custom platform through the GUI or CLI using its URL, the packages pointed to by the platform.json are used automatically – no need for any platform_packages instructions. See e.g. here or how-to-use.

This is also mentioned in the documentation.

I’m making progress thank you for that. The trouble I’m having now is updating. I’ve referenced my package using version like:

"toolchain-logicc": {
      "type": "toolchain",
      "version": "https://github.com/sathibault/toolchain-logicc/releases/download/v0.1.0/toolchain-logicc-windows_amd-0.1.0.tar.gz"

This worked for the initial download, but when I change the URL my platform.json file it does not recognize the new version of the toolchain. It updated the platform definition fine and it contains the new URL, but doesn’t download it.

The PlatformIO program does not repeadedly pull the platform for a new update on the URL. Upon initial installation it downloads the platform once (into <home directory>/.platformio/platforms/) and then uses the information stored within. If you update your repo’s platform.json, that does not translate in an automatic update of all clients. They still have to update the platform too, that is e.g., through the CLI with a pio platform update <platform name>.

Thanks. I have it working now. I was a little confused because I was expecting pio platform update to download it, but it only updates the platform. It seems to defer the download until it’s needed. I did pio run in a project using the platform and that triggered the download of the updated toolchain.

1 Like