In addition to the Free and Open Source (FOSS) operating systems, we also provide support for using CloudABI on some commercial operating systems, such as macOS. This article explains both how software for CloudABI can be developed and how the resulting programs can be executed, all using macOS.
A complete toolchain for CloudABI based on LLVM, Clang and LLD can be installed using the Homebrew package manager. The following commands can be used to enable access to the CloudABI tap and install its cloudabi-toolchain formula that builds the latest version of LLVM:
This package installs a copy of the Clang C and C++ compiler for every architecture supported by CloudABI, thus making it very easy to cross compile software for other hardware:
Alternatively, a toolchain based on the latest development version of Clang can be installed by running the following command:
The toolchain that was installed above does not ship with any code that has been cross compiled for CloudABI, meaning it cannot be used to build CloudABI applications on its own. Cross compiled libraries and tools are instead provided by the CloudABI Ports Collection. The packages that are part of this collection are automatically converted to bottles that are synchronized into the same tap, meaning they can easily be installed using brew install.
It typically makes sense to at least install the standard C++ runtime environment package, so that it is possible to compile C and C++ applications that depend on just core C, C++ and POSIX interfaces:
A full list of packages provided by the CloudABI Ports Collection can be obtained by running the following command:
The tap also contains a formula that installs the cloudabi-run utility. On macOS, this utility can be used to run CloudABI executables using a very lightweight system call emulation layer. Though this emulation layer does not strictly guarantee any of the safety properties normally provided by in-kernel support, it is sufficient for running CloudABI applications on macOS for development and testing purposes. The cloudabi-run utility can be installed by running the following command:
The shell commands below show how cloudabi-run can be used to execute a simple CloudABI executable. Please refer to cloudabi-run's manual page for more examples.