unikraft / pykraft

Python library for configuring and building unikernels
Other
176 stars 41 forks source link

Error: Unable to build sample kernel on Rashberry Pi #95

Open byteshiva opened 2 years ago

byteshiva commented 2 years ago

Describe the bug Unable build sample project on rashberry pi

To Reproduce

pi@raspberrypi:~/developments $ kraft up -t helloworld@staging ./my-first-unikernel 
/home/pi/developments/./my-first-unikernel is a non-empty directory, would you like to continue? [y/N]: y
[INFO    ] Initialized new unikraft application: /home/pi/developments/./my-first-unikernel
make: Entering directory '/home/pi/.unikraft/unikraft'
#
# No change to /home/pi/developments/my-first-unikernel/.config
#
make: Leaving directory '/home/pi/.unikraft/unikraft'
make: Entering directory '/home/pi/.unikraft/unikraft'
/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
make[1]: Nothing to be done for 'fetch'.
make: Leaving directory '/home/pi/.unikraft/unikraft'
make: Entering directory '/home/pi/.unikraft/unikraft'
/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
make[1]: Nothing to be done for 'prepare'.
make: Leaving directory '/home/pi/.unikraft/unikraft'
/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
     0%                                                                                                                                    0/96 [?file/s]/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
CC      libkvmplat: trace.common.o                                                                                                                       
     2% ██▋                                                                                                                            2/96 [ 2.01file/s]/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
make[1]: *** [/home/pi/.unikraft/unikraft/support/build/Makefile.build:48: /home/pi/developments/my-first-unikernel/build/libkvmplat/trace.common.o] Error 127
make: *** [Makefile:984: sub-make] Error 2
pi@raspberrypi:~/developments $               

Desktop (please complete the following information): uname -a

Linux raspberrypi 5.10.92-v7l+ #1514 SMP Mon Jan 17 17:38:03 GMT 2022 armv7l GNU/Linux

Additional context Add any other context about the problem here.

byteshiva commented 2 years ago

Please let me know if I'm missing something here?

StefanJum commented 2 years ago

From what I can see, you need to install gcc.

byteshiva commented 2 years ago

From what I can see, you need to install gcc. gcc has already been installed on the machine.

pi@raspberrypi:~ $ gcc --version  
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
byteshiva commented 2 years ago

Still getting the same error:

kraft up -t helloworld@staging ./my-first-unikernel 
   2.78% :                                        |        1 /       36 |:  app/ 100.00% :::::::::::::::::::::::::::::::::::::::: |       36 /       36 |:  app/helloworld
   0.32%                                          |        1 /      316 |:  core 100.00% :::::::::::::::::::::::::::::::::::::::: |      316 /      316 |:  core/unikraft@
 100.00% :::::::::::::::::::::::::::::::::::::::: |       36 /       36 |:  app/helloworld@2d40acb                       
[INFO    ] Initialized new unikraft application: /home/pi/development/./my-first-unikernel
make: Entering directory '/home/pi/.unikraft/unikraft'
LN      Makefile
mkdir -p /home/pi/development/my-first-unikernel/build/kconfig/lxdialog
make --no-print-directory CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \
obj=/home/pi/development/my-first-unikernel/build/kconfig -C /home/pi/.unikraft/unikraft/support/kconfig -f Makefile.br /home/pi/development/my-first-unikernel/build/kconfig/conf
/usr/bin/gcc -I. -I/home/pi/development/my-first-unikernel/build/kconfig -DCONFIG_=\"\"   -c fixdep.c -o /home/pi/development/my-first-unikernel/build/kconfig/fixdep.o
/usr/bin/gcc -I. -I/home/pi/development/my-first-unikernel/build/kconfig -DCONFIG_=\"\"   /home/pi/development/my-first-unikernel/build/kconfig/fixdep.o -o /home/pi/development/my-first-unikernel/build/kconfig/fixdep
#
# configuration written to /home/pi/development/my-first-unikernel/.config
#
make: Leaving directory '/home/pi/.unikraft/unikraft'
make: Entering directory '/home/pi/.unikraft/unikraft'
/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
make[1]: Nothing to be done for 'fetch'.
make: Leaving directory '/home/pi/.unikraft/unikraft'
make: Entering directory '/home/pi/.unikraft/unikraft'
/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
CP      config
make: Leaving directory '/home/pi/.unikraft/unikraft'
/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
     0%                                                                                                                           0/96 [?file/s]/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: [: -gt: unary operator expected
/bin/bash: line 1: [: -eq: unary operator expected
/bin/bash: line 1: x86_64-linux-gnu-gcc: command not found
     2% ██▍                                                                                                                   2/96 [ 2.14file/s]make[1]: *** [/home/pi/.unikraft/unikraft/support/build/Makefile.build:48: /home/pi/development/my-first-unikernel/build/libkvmplat/trace.common.o] Error 127
CC      libkvmplat: trace.common.o                                                                                                              
     2% ██▍                                                                                                                   2/96 [ 2.14file/s]make: *** [Makefile:984: sub-make] Error 2
adminy commented 2 years ago

You simply can't be building this on an arm device, as you have some hardcoded x86_64-linux-gnu-gcc expectation of a gcc binary in some makefile probably. You can try and pretend you have it like so:

ln -s `which gcc` $(dirname `which gcc`)/x86_64-linux-gnu-gcc but its not a guarantee it'll have the same parameters, still you can try.

byteshiva commented 2 years ago

You simply can't be building this on an arm device, as you have some hardcoded x86_64-linux-gnu-gcc expectation of a gcc binary in some makefile probably. You can try and pretend you have it like so:

ln -s `which gcc` $(dirname `which gcc`)/x86_64-linux-gnu-gcc but its not a guarantee it'll have the same parameters, still you can try.

Now it's throwing GCC error.

 kraft up -t helloworld@staging ./my-first-unikernel 
 100.00% :::::::::::::::::::::::::::::::::::::::: |       37 /       37 |:  app/helloworld@2d40acb                                                                           
[INFO    ] Initialized new unikraft application: /home/pi/development/./my-first-unikernel
make: Entering directory '/home/pi/.unikraft/unikraft'
LN      Makefile
mkdir -p /home/pi/development/my-first-unikernel/build/kconfig/lxdialog
make --no-print-directory CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \
obj=/home/pi/development/my-first-unikernel/build/kconfig -C /home/pi/.unikraft/unikraft/support/kconfig -f Makefile.br /home/pi/development/my-first-unikernel/build/kconfig/conf
/usr/bin/gcc -I. -I/home/pi/development/my-first-unikernel/build/kconfig -DCONFIG_=\"\"   -c fixdep.c -o /home/pi/development/my-first-unikernel/build/kconfig/fixdep.o
/usr/bin/gcc -I. -I/home/pi/development/my-first-unikernel/build/kconfig -DCONFIG_=\"\"   /home/pi/development/my-first-unikernel/build/kconfig/fixdep.o -o /home/pi/development/my-first-unikernel/build/kconfig/fixdep
#
# configuration written to /home/pi/development/my-first-unikernel/.config
#
make: Leaving directory '/home/pi/.unikraft/unikraft'
make: Entering directory '/home/pi/.unikraft/unikraft'
make[1]: Nothing to be done for 'fetch'.
make: Leaving directory '/home/pi/.unikraft/unikraft'
make: Entering directory '/home/pi/.unikraft/unikraft'
CP      config
make: Leaving directory '/home/pi/.unikraft/unikraft'
CC      libkvmplat: trace.common.o                                                                                                                                            
     2% ███                                                                                                                                                 2/96 [ 2.73file/s]x86_64-linux-gnu-gcc: error: unrecognized command-line option ‘-m64’
x86_64-linux-gnu-gcc: error: unrecognized command-line option ‘-mno-red-zone’
make[1]: *** [/home/pi/.unikraft/unikraft/support/build/Makefile.build:48: /home/pi/development/my-first-unikernel/build/libkvmplat/trace.common.o] Error 1
make: *** [Makefile:984: sub-make] Error 2

Is this gcc version compatible for compilation.

pi@raspberrypi:~/ $ gcc --version                                                                                                                                  
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.