Configurable toolchain #673
Labels
gsoc
Google Summer of Code Contribution
kind/enhancement
New feature or request
kind/project
This issue represents a standalone project
priority/medium
Issue which is important, but KraftKit is usable without it also.
Overview
Unikraft is a highly modular library operating system designed for the cloud. It's high degree of modularization allows for extreme customization and specialization. As such, its tooling should not interfere with the user's desire to support such customization. Towards increasing the unikernel's developer's ability to customize the build whilst simultaneously systemitizing the process of retrieving, organizing and generally facilitating the build of a unikernel based on Unikraft and its many components, the supported tooling,
kraft
, should allow for the injection of the user's environment and or additional toolchain requirements.Feature request summary
This project is designed to better facilitate the dynamic injection of user provided variables into Unikraft's build system through the addition of a dynamically configured
toolchain
towards greater customization of the unikernel build through the use of its command-line companion client tool,kraft
. This manifests itself as an injection into KraftKit's core configuration system and must propagate across the codebase appropriately.Distinct results of this addition would enable, but are not limited to: alternating the GNU Compiler Collection (GCC) version, providing alternative compile-time flags, and more.
This project tracks the addition of a map to the internal configuration system entitled
toolchain
which sets the values of programs that are ultimately passed to Unikraft's build system.The addition is first made as an entry to the
KraftKit
config structure intype KraftKit struct { [...] + Toolchain map[string]string `yaml:"toolchain" long:"toolchain" usage:"Set specific global programs in Unikraft's build system" [...] }
These values need to be passed any
make
invocations as in-line variables via the optionmake.WithVar
in relevant parts of KraftKit's commands that interact with the build, namely incmd/kraft/build/build.go
since it is in these files that access to the map is possible viaconfig.G[config.KraftKit](ctx).Toolchain
.Additionally, the specific entry for
CC
should be added as default during the installation process, i.e. the user should be asked whether they want to change the default value forCC
which should be set togcc
.A sample change to the user's configuration could look something like:
The same top-level
toolchain
should also be added as a directive/element into theKraftfile
, with the ability to specify it per-target.Such configuration changes, when applied to KraftKit's configuration system, would allow for the dynamic injection of toolchain arguments via command-line flags, e.g. during the the construction of a unikernel binary image:
Additional context
Such a configuration system will enable KraftKit users to pass in additional flags to Unikraft's build system following the merge of unikraft/unikraft#957
Steps
The text was updated successfully, but these errors were encountered: