Skip to content

Check for necessary software and their versions before invoking main build system #486

@nderjung

Description

@nderjung

Feature request summary

This issue tracks adding additional checks to the Unikraft build system for all required software (and minimum/maximum versions of those software) to compile a Unikarft unikernel.

The check should be performed within the build system itself and serves as a failsafe for anyone who has not followed all set up instructions or have a misconfigured host environment which would result in an ambigious error.

Already this is done to check the minimum required version of Make before continuing with the build:

unikraft/Makefile

Lines 49 to 53 in 7f62c36

# Check for minimal make version (note: this check will break at make 10.x)
MIN_MAKE_VERSION = 4.1
ifneq ($(firstword $(sort $(RUNNING_MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MAKE_VERSION))
$(error You have make '$(RUNNING_MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
endif

For now, the kraft container has a list of the necessary software which is packaged together for reproducible environments, however, not everyone uses this container image nor wish to use the standard environment (Debian).

The following tools and additional libraries are necessary to build a Unikraft unikernel. I am actually not sure which minimum (or maximum) necessary versions are required so this will need to be checked too:

unikraft/Makefile

Lines 571 to 610 in 181c4fa

# Make variables (CC, etc...)
LD := $(CONFIG_CROSS_COMPILE)$(CONFIG_COMPILER)
CC := $(CONFIG_CROSS_COMPILE)$(CONFIG_COMPILER)
CPP := $(CC)
CXX := $(CPP)
GOC := $(CONFIG_CROSS_COMPILE)gccgo-7
# We use rustc because the gcc frontend is experimental and missing features such
# as borrowing checking
ifneq ("$(origin LLVM_TARGET_ARCH)","undefined")
RUSTC := rustc --target=$(CONFIG_LLVM_TARGET_ARCH)
else
RUSTC := rustc
endif
AS := $(CC)
AR := $(CONFIG_CROSS_COMPILE)gcc-ar
NM := $(CONFIG_CROSS_COMPILE)gcc-nm
READELF := $(CONFIG_CROSS_COMPILE)readelf
STRIP := $(CONFIG_CROSS_COMPILE)strip
OBJCOPY := $(CONFIG_CROSS_COMPILE)objcopy
OBJDUMP := $(CONFIG_CROSS_COMPILE)objdump
M4 := m4
AR := ar
CAT := cat
SED := sed
AWK := awk
YACC := bison
LEX := flex
PATCH := patch
GZIP := gzip
TAR := tar
UNZIP := unzip -qq -u
WGET := wget
SHA1SUM := sha1sum -b
SHA256SUM := sha256sum -b
SHA512SUM := sha512sum -b
MD5SUM := md5sum -b
DTC := dtc
# Time requires the full path so that subarguments are handled correctly
TIME := $(shell which time)
LIFTOFF := liftoff -e -s

Tool or libray Min version Max version When used
make 4.1 N/A Main build system
libncursesw5-dev TODO TODO make menuconfig
libncursesw5 TODO TODO make menuconfig
libyaml-dev TODO TODO TODO
flex TODO TODO TODO
wget TODO TODO make fetch
patch TODO TODO make prepare
gawk TODO TODO Main build system
socat 1.7.3.4 (ref) TODO qemu-guest
bison TODO TODO TODO
bindgen TODO TODO TODO
bzip2 TODO TODO make fetch
unzip TODO TODO make fetch
uuid-runtime TODO TODO TODO
autoconf TODO TODO Main build system
xz-utils TODO TODO TODO
ld TODO TODO TODO
cc TODO TODO TODO
cpp TODO TODO TODO
cxx TODO TODO TODO
goc TODO TODO TODO
rustc TODO TODO TODO
as TODO TODO TODO
ar TODO TODO TODO
nm TODO TODO TODO
readelf TODO TODO TODO
strip TODO TODO TODO
objcopy TODO TODO TODO
objdump TODO TODO TODO
m4 TODO TODO TODO
ar TODO TODO TODO
cat TODO TODO TODO
sed TODO TODO TODO
awk TODO TODO TODO
yacc TODO TODO TODO
lex TODO TODO TODO
patch TODO TODO TODO
gzip TODO TODO TODO
tar TODO TODO TODO
sha1sum TODO TODO TODO
sha256sum TODO TODO TODO
sha512sum TODO TODO TODO
md5sum TODO TODO TODO
dtc TODO TODO TODO
time TODO TODO TODO
liftoff TODO TODO TODO

Thoughts on approaches

  • As part of the internal Make system (using Make-fu semver checking);
  • Probably it is better as a standalone script (similar but definitely not ./configure) where these checks can be performed independently so as to speed up the build.

cc @maintainers-core, @unikraft/maintainers-build feel free to edit/update this issue with additional context, information, approaches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/makefilePart of the Unikraft Makefile build systemgood-first-issueGood for newcomerskind/enhancementNew feature or requesttopic/buildTopics to do with the build system

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions