Skip to content

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.0linux-amd64 macos
  • Release 1.0.1linux-amd64 esp8266-generic macos
  • Release 1.1.0linux-amd64 esp8266-generic macos
  • Release 1.2.0linux-amd64 esp8266-generic
  • Release 1.3.0linux-amd64 esp8266-generic macos

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 version 1.0.1, and updates will then continue normally
  • for macos – the Unit will be updated normally up to version 1.1.0; automatic updates will then be interrupted but will resume starting from version 1.3.0

Example of bad asset naming across releases

  • Release 1.0.0linux-amd64-1.0.0 macos-one
  • Release 1.0.1linux-amd64-1.0.1 esp8266-and-esp8266-generic macos-two
  • Release 1.1.0linux-amd64-1.1.0 esp8266-generic macos-three
  • Release 1.2.0linux-amd64-1.2.0 esp8266-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 assets names differs between releases, only manual updates of the Unit are guaranteed to work correctly.
  • If the structure of assets names is consistent within a Unit, Pepeunit can automatically build update URLs for Compilable Units across versions.