Description
While it is perfectly possible to package platformio for Linux (eg. see https://build.opensuse.org/project/show/home:dmacvicar:PlatformIO ) I had trouble submitting it to the main channels for some reasons:
- Some distributions already invest some effort in packaging things like gcc-avr
- Toolchains are compiled "somewhere" and published as binaries
Integration with system-wide packages
I like the approach of downloading on demand to the user $HOME directory. I don't think systems packages are the solution for everything, but I see the point in the trustabilty of binaries.
Some ideas that could help PlatformIO adoption into distributions could be to allow system wide installed packages (coming from distro packages) in addition to the user installed packages.
There is no need to invest on how to install them, that is the job of the distro specific tool. PlatformIO only needs to notice when a toolchain is installed (and the fact that itself can't remove it).
The distro package would have to deal with putting the right metadata in the right places for platformio to notice.
- Allow main manifest to be local, so that the distribution package can include it.
- Even better, allow to combine a local one with a remote one, with priority for the local one, while still allowing distros to disable the remote one if policy requires to
- Allow toolchains to be installed in the system, and manifests to refer as them
- The user would install the arduino manifest from his distribution package selector
- platformio would use it if installed, otherwise download it, otherwise if internet access is not allowed, error
- for this, it may be useful if the manifest could be read also in in parts eg.
/usr/share/platformio/appstate.d/toolchains/toolchain-atmelavr.json
so if the user installs the distro package platformio-toolchain-atmelavr that file will be installed there and platformio would know immediately that the toolchain is installed (like it does now with appstate.json). May be platformio could read first the directory with parts and merge that to the appstate.json generated from user installed packages.
Trustability of binaries
In addition to that, some insight on how the current toolchain tarbals are built would be helpful to be able to replicate those packages in build systems like http://build.opensuse.org so that distros can create the packages for the toolchains they are interested in.
This could benefit even the user installable packages from http://dl.platformio.org/packages, as they could be built in a trusted environment like http://build.opensuse.org, which automatically rebuilds and publish, create reproducible builds and does not allow internet access during builds.
PlatformIO could build their toolchains in http://build.opensuse.org either as rpms or ArchLinux PKGBUILDS (Open Build Service is multi-distro), and then unpack those packages to create the tarballs exposed by http://dl.platformio.org/packages (basically, a distro package without external dependencies). Then users would know where those tarballs are built.