Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable toolchain #673

Open
1 of 7 tasks
Tracked by #266
nderjung opened this issue Jul 25, 2023 · 1 comment
Open
1 of 7 tasks
Tracked by #266

Configurable toolchain #673

nderjung opened this issue Jul 25, 2023 · 1 comment
Assignees
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.

Comments

@nderjung
Copy link
Member

nderjung commented Jul 25, 2023

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 in

  type 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 option make.WithVar in relevant parts of KraftKit's commands that interact with the build, namely in cmd/kraft/build/build.go since it is in these files that access to the map is possible via config.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 for CC which should be set to gcc.

A sample change to the user's configuration could look something like:

toolchain:
  CC: /path/to/alternative/gcc
  UK_CFLAGS: -fdiagnostics-color=always

The same top-level toolchain should also be added as a directive/element into the Kraftfile, 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:

kraft --toolchain.UK_CFLAGS="-fdiagnostics-color=always" build

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

@nderjung nderjung added the kind/enhancement New feature or request label Jul 25, 2023
@nderjung nderjung added kind/project This issue represents a standalone project gsoc Google Summer of Code Contribution labels Feb 5, 2024
@craciunoiuc craciunoiuc added the priority/medium Issue which is important, but KraftKit is usable without it also. label Feb 29, 2024
@craciunoiuc
Copy link
Member

craciunoiuc commented May 27, 2024

@UjjwalMahar this is an overview of the GSoC project that you are going to work on.

I'll assign this to myself cause for some reason I can't assign you.

@craciunoiuc craciunoiuc self-assigned this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
Status: Backlog
Status: 🧊 Icebox
Development

No branches or pull requests

3 participants