=== The SDK Build Engine

The native platform for %{OsVariant} software development is GNU/Linux (Linux). In order to enable development on macOS and Windows as well as to support miscellaneous Linux variants more easily, the %{SdkVariant} encapsulates its back-end in a virtual machine running a specifically tailored Linux distribution, the so called SDK Build Engine.

Compilers and other tools running inside the build engine access the host file system through a shared workspace directory. By default the user home directory is shared for this purpose. Other workspace directory may be selected during SDK installation and through the Options dialog of the %{IdeVariant} (Qt Creator).

Under the build engine, the shared workspace directory is mounted under a path resembling the host path as closely as possible. On Linux and macOS the host path is usually used unchanged (case conversion may be applied to avoid conflicts). On Windows the path is transformed as in 'C:\Users\user' -> '/c/Users/user'.

These paths are normally mapped back to the host paths in command output to allow further processing of the command output on host. When the global '--debug' option is used, this reverse path mapping in sfdk output is disabled.

Sometimes other paths from inside the build engine leak in sfdk output. Understanding to the fact that certain paths exist inside the build engine may help debugging issues with advanced or non standard use of the SDK. These are the paths commonly seen:

- /home/mersdk
+
--
This is the home directory of the user account used for running build processes under the virtual machine
--
- /home/deploy
+
--
This location is used by 'rpmbuild' as the %buildroot, for which purpose a "fully capable" file system is needed
--

The build engine can be conveniently controlled with the 'engine' command. The virtual machine will start automatically when needed but be aware that it continues running on background until explicitly stopped.


=== Managing SDK Build Tools

The %{SdkVariant} abstracts the support for cross-development for particular target HW architectures and %{OsVariant} versions (forward compatibility applies) in form of add-on SDK Build Tools.

Two types of SDK Build Tools are recognized:

1. SDK Build Target - a target-compatible %{OsVariant} image, and
2. SDK Build Tooling - a host-compatible collection of programs used at build time.

The shorter terms "build tools", "(build) tooling(s)" and "(build) target(s)" are used instead of the official terms where the context admits.

Pairs of build targets and toolings are combined using the Scratchbox 2 technology to form complete, virtual build environments, where developers get the feeling of building software the native way while cross-compilation actually happens under the hood.

Build toolings are treated as read-only by Scratchbox 2. Any changes done under the build environment presented by Scratchbox 2 are persisted under the build targets.

SDK Build Tools can be managed using the 'tools' command or with the help of the interactive SDK Installer/Maintenance Tool (see the 'maintain' command).
