Compilation for different platforms
Due to the specifics of Compilable programs, the way they are delivered to Users differs from Interpretable ones. To avoid forcing the end User to constantly compile the source code to obtain a binary, the Git repository hosting platforms GitLab and GitHub provide a release system.
Each release can include binary files with specific names; such pairs are typically called assets. GitLab and GitHub allow you to obtain the mapping between an asset name and the URL to the binary file via their API.
INFO
Based on this mechanism, Pepeunit can update Compilable repositories automatically. The only requirement is that assets names must be consistent across different releases.
WARNING
If the Developer of a Compilable Unit wants to add automatic update support in Pepeunit, they will have to compile and upload versions of their program for each platform to GitLab or GitHub. The asset name for the same platform must remain identical across all releases.
Example of good asset naming across releases
Release 1.0.0–linux-amd64macosRelease 1.0.1–linux-amd64esp8266-genericmacosRelease 1.1.0–linux-amd64esp8266-genericmacosRelease 1.2.0–linux-amd64esp8266-genericRelease 1.3.0–linux-amd64esp8266-genericmacos
Let’s consider how Pepeunit behaves in this scenario for each platform: linux-amd64, esp8266-generic, and macos:
- for
linux-amd64– the Unit will be updated normally for all versions - for
esp8266-generic– the Unit can be created starting from version1.0.1, and updates will then continue normally - for
macos– the Unit will be updated normally up to version1.1.0; automatic updates will then be interrupted but will resume starting from version1.3.0
Example of bad asset naming across releases
Release 1.0.0–linux-amd64-1.0.0macos-oneRelease 1.0.1–linux-amd64-1.0.1esp8266-and-esp8266-genericmacos-twoRelease 1.1.0–linux-amd64-1.1.0esp8266-genericmacos-threeRelease 1.2.0–linux-amd64-1.2.0esp8266-and-esp8266-generic
In this case, Pepeunit will not be able to automatically update the Unit. Only manual updates will work correctly; the platform-specific binary for each version will have to be downloaded manually.
Summary
- If the structure of
assetsnames differs between releases, only manual updates of the Unit are guaranteed to work correctly. - If the structure of
assetsnames is consistent within a Unit, Pepeunit can automatically build update URLs for Compilable Units across versions.