Goa - streamlining the development of Genode applications
The development of applications for Genode used to require a lot of learning about Genode's way of organizing source code, the framework's custom build system, and the use of run scripts. The Goa tool aims at largely removing these burdens from application developers.
In contrast to the tools that come with Genode, which were designed for developing complete systems, Goa is focused on the development of individual applications. In a nutshell, it streamlines the following tasks:
-
The porting of 3rd-party software to Genode, which typically involves
-
Downloading 3rd-party source code via Git, Subversion, or in the form of archives,
-
Applying patches to the downloaded source code, and
-
Keeping track of changes locally made to the downloaded source code.
-
-
Building software using standard build tools like CMake, alleviating the need to deal with Genode's custom build system. Goa takes care of automatically installing the required Genode APIs and supplying the right parameters to the build system so that Genode executables are produced.
-
Rapidly testing the software directly on the developer's Linux host system. Goa automatically downloads Genode components needed for the test scenario.
-
Since Genode executables are binary-compatible between Linux and microkernels, the same binaries as tested on Linux can be deployed on top of the other kernels supported by Genode. Goa takes care of exporting the software in the format expected by Genode's package management.
-
Publishing (archiving and cryptographically signing) the software so that it becomes available to other Genode users, in particular users of Sculpt OS.
Installation
-
It is recommended to use the latest long-term support (LTS) version of Ubuntu on a 64-bit x86 PC. Make sure that your installation satisfies the following requirements.
-
libSDL2-dev needed to run system scenarios directly on your host OS,
-
tclsh and expect needed by the tools,
-
bubblewrap for sandboxed build environments
-
-
Clone the Goa repository:
git clone https://codeberg.org/genodelabs/goa.git
The following steps refer to the directory of the clone as <goa-dir>.
-
Enable your shell to locate the goa tool by either
-
Creating a symbolic link in one of your shell's binary-search locations (e.g., if you use a bin/ directory in your home directory, issue ln -s <goa-dir>/bin/goa ~/bin/), or alternatively
-
Add <goa-dir>/bin/ to your PATH environment variable, e.g., (replace <goa-dir> with the absolute path of your clone):
export PATH=$PATH:<goa-dir>/bin
-
-
Provide the Genode toolchain by either
-
Installing the Genode toolchain following the instructions at https://genode.org/download/tool-chain. Note that Goa uses the same toolchain version as was used for the targeted Sculpt OS version. In consequence, the biennial toolchain update conducted in the framework's May-release will only take effect in Goa with the next Sculpt release.
-
Making sure squashfs-tools and squashfuse are installed so that Goa is able to download the latest Genode toolchain and make it available in the sandboxed build environment
-
-
Optionally, enable bash completion by adding the following line to your ~/.bashrc file:
source <goa-dir>/share/bash-completion/goa
Please feel welcome to explore Goa on your own. A good starting point would be the built-in help command:
goa help
A first example, using a plain old Makefile
Let's say, you want to build a hello-world application that uses the raw Genode API with no libc whatsoever.
First, create a project directory, let's call it "hello":
$ mkdir hello $ cd hello hello$
By convention, the project name corresponds to the name of the directory. Source codes are stored in a src/ subdirectory. Let's create a file at src/hello.cc with the following content:
#include <base/log.h>
#include <base/component.h>
void Component::construct(Genode::Env &)
{
Genode::log("Hello");
}
Besides the hello.cc file, let's create a Makefile at src/Makefile with the following content:
hello: hello.cc
Now, let's give goa a first try:
hello$ goa build
Goa responds with the following message:
[hello] Error: hello has a 'src' directory but lacks an 'artifacts' file.
You may start with an empty file.
The so-called artifacts file tells Goa about the expected end result of the build process. Even though we already know from our Makefile that our only build artifact will be the executable binary called "hello", let's follow Goa's advise of starting with an empty artifacts file. Note, you may consult goa help artifacts for more details on the artifacts file.
hello$ touch artifacts
As a notable side effect of the goa build command, Goa has created a new directory called var/ within the project directory. The var/ directory is the designated place for generated files such as the build directory.
Upon the next attempt of issuing the goa build command, now with an artifacts file in place, Goa attempts to compile our program but with pretty limited success:
hello.cc:1:10: fatal error: base/log.h: No such file or directory
#include <base/log.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [hello] Error 1
[hello:make] <builtin>: recipe for target 'hello' failed
Error: build via make failed
Our program tries to include a header file that is nowhere to be found. To resolve this problem, one can tell Goa that the project needs to use the Genode base API, by placing a file named used_apis with the following content into the project directory.
genodelabs/api/base
This line tells Goa that the project depends on Genode's base API, which features the base/log.h and base/component.h headers. When issuing the command goa build again, you see the following message:
download genodelabs/api/base/2026-10-22.tar.xz download genodelabs/api/base/2026-10-22.tar.xz.sig
Goa automatically downloaded the base API and installed it into a fresh depot at var/depot/genodelabs/api/base/2026-10-22/. But not only that, it also re-attempted the build of the program. If you take a look at var/build/x86_64/, you will see the hello executable. If the output was too unspectacular for your taste, you may append the --verbose argument to the goa build command to see more details about the steps taken.
To run the program, one needs to tell Goa, which part of the build artifacts are relevant. In our case, it's the hello executable binary. You can declare this information in your artifacts file by adding the following line. It refers to the respective file relative to the var/build/x86_64/ directory.
hello
If you issue the goa build command again, you can see that this file appears at var/bin/x86_64/hello. The content of the bin directory is meant for the integration into a Genode scenario.
Speaking of a Genode scenario, to run the program within a Genode system, you have to define the "contract" between the program and the surrounding system. This contract has the form of a runtime package, which is stored in the pkg/ subdirectory. A runtime package needs at least two files: a README file and a runtime file. The README file should give brief information about the purpose of the Genode subsystem for human readers. The runtime file contains the contractual information in human-inclined data (HID) syntax. Briefly summarized, its structure is inspired by XML (hierarchy of nodes, nodes can have attributes), yet it omits syntactic decor for calmness and clarity. For more details, please refer to the HID documentation at https://genode.org/documentation/hid.
For this example, create a file pkg/runtime with the following content:
runtime | ram: 1M | caps: 1000 | binary: hello + config + content + rom hello -
This file declares the binary you want to start, how much RAM and capabilities the subsystem expects, configuration information passed to the subsystem, and the content of the package. In this case, you only have a single ROM module for the binary called "hello".
Note that Goa's built-in help command provides more details on the structure of runtime files.
goa help runtime
For running the scenario, one can use the goa run command:
hello$ goa run download genodelabs/bin/x86_64/base-linux/2026-11-14.tar.xz download genodelabs/bin/x86_64/base-linux/2026-11-14.tar.xz.sig download genodelabs/bin/x86_64/init/2026-11-14.tar.xz download genodelabs/bin/x86_64/init/2026-11-14.tar.xz.sig download genodelabs/src/base-linux/2026-11-14.tar.xz download genodelabs/src/base-linux/2026-11-14.tar.xz.sig download genodelabs/src/init/2026-11-14.tar.xz download genodelabs/src/init/2026-11-14.tar.xz.sig download genodelabs/api/os/2026-11-14.tar.xz download genodelabs/api/os/2026-11-14.tar.xz.sig download genodelabs/api/report_session/2024-08-28.tar.xz download genodelabs/api/report_session/2024-08-28.tar.xz.sig download genodelabs/api/sandbox/2025-12-11.tar.xz download genodelabs/api/sandbox/2025-12-11.tar.xz.sig download genodelabs/api/timer_session/2026-08-24.tar.xz download genodelabs/api/timer_session/2026-08-24.tar.xz.sig Genode sculpt-26.10-55-ge9c42e8bbe5 17592186044415 MiB RAM and 19000 caps assigned to init [init -> hello] Hello
You can see that Goa automatically installed the dependencies needed to execute the runtime package, integrates a Genode scenario, and executes it directly on Linux. If you switch to another terminal, you can see the Genode processes:
$ ps a | grep Genode 8646 pts/3 Sl+ 0:00 [Genode] init 8649 pts/3 Sl+ 0:00 [Genode] init -> hello 8650 pts/3 Sl+ 0:02 [Genode] init -> timer
You can cancel the execution of the Genode scenario via Control-C.
A second example, using CMake
As another step, let us create a new project that executes the 3rd step of the excellent CMake tutorial. Let's call the project "cmake_step3". Instead of copying the code into the cmake_step3/src/ directory, let us better tell Goa to download the code from the original tutorial. This can be done by creating an import file in the project directory. Create the file cmake_step3/import with the following content. Please have a look at goa help import for a detailed explanation.
LICENSE := BSD VERSION := 4.3.2 DOWNLOADS := cmake_step3.sparse-git URL(cmake_step3) := https://github.com/Kitware/CMake REV(cmake_step3) := v4.3.2 DIR(cmake_step3) := src SPARSE_PATH(cmake_step3) := Help/guide/tutorial/Step3
This import file describes the download of only the specified subdirectory of the CMake project from GitHub. Let's give it a try:
cmake_step3$ goa import import download https://github.com/Kitware/CMake import git Cloning into '/tmp/tmp.Mp9TWeKK1E'... ... import generate import.hash
After the command finished, you find the source code sitting nicely in a new src/ directory. Let's try to build it just after creating an empty artifacts file.
cmake_step3$ touch artifacts
cmake_step3$ goa build
[cmake_step3:cmake] -- The C compiler identification is GNU 14.2.0
[cmake_step3:cmake] -- The CXX compiler identification is GNU 14.2.0
[cmake_step3:cmake] -- Detecting C compiler ABI info
[cmake_step3:cmake] -- Detecting C compiler ABI info - done
[cmake_step3:cmake] -- Check for working C compiler:
/usr/local/genode/tool/25.05/bin/genode-x86-gcc - skipped
[cmake_step3:cmake] -- Detecting C compile features
[cmake_step3:cmake] -- Detecting C compile features - done
[cmake_step3:cmake] -- Detecting CXX compiler ABI info
[cmake_step3:cmake] -- Detecting CXX compiler ABI info - done
[cmake_step3:cmake] -- Check for working CXX compiler:
/usr/local/genode/tool/25.05/bin/genode-x86-g++ - skipped
[cmake_step3:cmake] -- Detecting CXX compile features
[cmake_step3:cmake] -- Detecting CXX compile features - done
[cmake_step3:cmake] -- Configuring done
[cmake_step3:cmake] -- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_SYSTEM_LIBRARY_PATH
[cmake_step3:cmake] -- Build files have been written to: .../var/build/x86_64
[cmake_step3:cmake] [ 25%] Building CXX object
MathFunctions/CMakeFiles/MathFunctions.dir/MathFunctions.cxx.o
.../cmake_step3/src/MathFunctions/MathFunctions.cxx:1:10:
fatal error: iostream: No such file or directory
1 | #include <iostream>
Apparently, the example requires the standard C++ library. You can supply this API to the project by creating a used_apis file with the following content:
genodelabs/api/posix genodelabs/api/libc genodelabs/api/stdcxx
The posix API is needed because - unlike a raw Genode component - the program starts at a main function. The libc is needed as a dependency of the standard C++ library.
When issuing the goa build command again, you see that Goa downloads the required APIs and successfully builds the example program:
cmake_step3$ goa build
download genodelabs/api/libc/2026-11-14.tar.xz
download genodelabs/api/libc/2026-11-14.tar.xz.sig
download genodelabs/api/posix/2020-05-17.tar.xz
download genodelabs/api/posix/2020-05-17.tar.xz.sig
download genodelabs/api/stdcxx/2026-09-28.tar.xz
download genodelabs/api/stdcxx/2026-09-28.tar.xz.sig
[cmake_step3:cmake] -- Configuring done
[cmake_step3:cmake] -- Generating done
[cmake_step3:cmake] -- Build files have been written to: .../var/build/x86_64
[cmake_step3:cmake] [ 25%] Building CXX object
MathFunctions/CMakeFiles/MathFunctions.dir/MathFunctions.cxx.o
[cmake_step3:cmake] [ 50%] Linking CXX static library libMathFunctions.a
[cmake_step3:cmake] [ 50%] Built target MathFunctions
[cmake_step3:cmake] [ 75%] Building CXX object
Tutorial/CMakeFiles/Tutorial.dir/Tutorial.cxx.o
[cmake_step3:cmake] [100%] Linking CXX executable Tutorial
[cmake_step3:cmake] [100%] Built target Tutorial
The resulting executable binary can be found at var/build/x86_64/Tutorial/Tutorial. Let's declare it a build artifact by mentioning it in the artifacts by adding the following line.
Tutorial/Tutorial
To run the program, you need a runtime package that is slightly more advanced than the first hello example. This time, you need to declare that the runtime requires content from other depot archives in addition to your program by creating a file pkg/archives with the following content:
genodelabs/src/posix genodelabs/src/libc genodelabs/src/vfs genodelabs/src/stdcxx
This way, the subsystem incorporates the shared libraries found in those depot archives. A suitable pkg/runtime for running the program within a Genode scenario looks like this:
runtime | ram: 10M | caps: 1000 | binary: Tutorial + config + libc | stdout: /dev/log | stderr: /dev/log + vfs | + dir dev | + log + arg | : Tutorial + arg | : 24 + content + rom Tutorial + rom posix.lib.so + rom libc.lib.so + rom libm.lib.so + rom stdcxx.lib.so + rom vfs.lib.so -
Since the tutorial uses the C runtime, you have to supply a configuration that defines how the virtual file system of the component looks like, and where the program's standard output should go. The runtime also specifies the first and second arguments of the POSIX program as "Tutorial" (name of the program) and "24" as its actual argument. The + content lists all ROM modules required.
With this runtime package in place, let's give the Tutorial a run:
cmake_step3/$ goa run [cmake_step3:cmake] -- Configuring done [cmake_step3:cmake] -- Generating done [cmake_step3:cmake] -- Build files have been written to: .../var/build/x86_64 [cmake_step3:cmake] [ 50%] Built target MathFunctions [cmake_step3:cmake] [100%] Built target Tutorial download genodelabs/bin/x86_64/libc/2026-11-14.tar.xz download genodelabs/bin/x86_64/libc/2026-11-14.tar.xz.sig download genodelabs/bin/x86_64/posix/2026-11-14.tar.xz download genodelabs/bin/x86_64/posix/2026-11-14.tar.xz.sig download genodelabs/bin/x86_64/stdcxx/2026-11-14.tar.xz download genodelabs/bin/x86_64/stdcxx/2026-11-14.tar.xz.sig download genodelabs/bin/x86_64/vfs/2026-11-14.tar.xz download genodelabs/bin/x86_64/vfs/2026-11-14.tar.xz.sig ... download genodelabs/api/sandbox/2025-12-11.tar.xz download genodelabs/api/sandbox/2025-12-11.tar.xz.sig Genode sculpt-26.10-55-ge9c42e8bbe5 17592186044415 MiB RAM and 19000 caps assigned to init [init -> cmake_step3] Computing sqrt of 24 to be 12.5 [init -> cmake_step3] Computing sqrt of 24 to be 7.21 [init -> cmake_step3] Computing sqrt of 24 to be 5.26936 [init -> cmake_step3] Computing sqrt of 24 to be 4.912 [init -> cmake_step3] Computing sqrt of 24 to be 4.899 [init -> cmake_step3] Computing sqrt of 24 to be 4.89898 [init -> cmake_step3] Computing sqrt of 24 to be 4.89898 [init -> cmake_step3] Computing sqrt of 24 to be 4.89898 [init -> cmake_step3] Computing sqrt of 24 to be 4.89898 [init -> cmake_step3] Computing sqrt of 24 to be 4.89898 [init -> cmake_step3] The square root of 24 is 4.89898 [init] child "cmake_step3" exited with exit value 0
You see that Goa takes care of downloading all dependencies needed to host the subsystem and subsequently executes the scenario. The program built by the tutorial prints the result "The square root of 24 is 4.89898".
The next step
The intro above covers just a tiny part of the scope of Goa.
For further exploration, read the next episode about using Goa to create a little Unix...
You may also enjoy reading the material of complete article series as part of the "Genode Applications" book, downloadable as PDF at https://genode.org.
Please also feel welcome to explore Goa on your own. A good starting point would be the built-in help command:
goa help
If you have feedback, please don't hesitate to reach out!
Edit (2021-03-02): updated to Genode 21.02
Edit (2023-05-02): updated to Sculpt OS 23.04
Edit (2023-11-15): updated to Sculpt OS 23.10
Edit (2026-11-17): updated to Sculpt OS 26.10


Norman Feske