includeos / includeos-docker-images

Docker images for people who want to try out building IncludeOS unikernels without having to install the development environment locally on their machines
Apache License 2.0
17 stars 6 forks source link

Unable to build demo_service #16

Closed mjbright closed 6 years ago

mjbright commented 6 years ago

Following the instruction here: https://github.com/includeos/includeos-docker-images#using-the-docker-image-to-build-your-service

I'm trying to build the IncludeOS demo_service: https://github.com/hioa-cs/IncludeOS/tree/master/examples/demo_service

I've pulled and built the latest docker-images.

I've pulled the latest IncludeOS tree I changed to the examples/demo_service/ and did mkdir build

NOTE: I needed to also do chmod 777 build so as docker could write there.

I then cd build and run

docker run --rm -v $(dirname $PWD):/service includeos/includeos-build:v0.11.0-rc.2.01

But I get compilation errors as below:

-- Building for arch x86_64, platform x86_pc
-- Target CPU architecture x86_64
-- Target triple x86_64-pc-linux-elf
-- Using vanilla CPU features: SSE3. CAPABS = -msse3 -mfpmath=sse
-- Looking for drivers in /home/ubuntu/IncludeOS_install/includeos/x86_64/drivers
--      * Found virtionet
-- Looking for plugins in /home/ubuntu/IncludeOS_install/includeos/x86_64/plugins
--      * Found autoconf
-- Configuring done
-- Generating done
-- Build files have been written to: /service/build
[ 40%] Built target config_json
[ 60%] Building CXX object CMakeFiles/service.dir/service.cpp.o
/service/service.cpp:128:58: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
      printf("<Service> @on_write: %u bytes written.\n", written);
                                   ~~                    ^~~~~~~
                                   %zu
In file included from /service/service.cpp:21:
In file included from /home/ubuntu/IncludeOS_install/includeos/api/os:23:
In file included from /home/ubuntu/IncludeOS_install/includeos/api/hw/devices.hpp:22:
In file included from /home/ubuntu/IncludeOS_install/includeos/api/hw/nic.hpp:21:
In file included from /home/ubuntu/IncludeOS_install/includeos/api/hw/../net/buffer_store.hpp:24:
In file included from /home/ubuntu/IncludeOS_install/includeos/api/smp:23:
In file included from /home/ubuntu/IncludeOS_install/includeos/api/delegate:23:
/home/ubuntu/IncludeOS_install/includeos/api/util/delegate.hpp:244:13: error: no matching function for call to object of type '(lambda at /service/service.cpp:105:5)'
                        { return reinterpret_cast<C&>(storage)(std::forward<Args>(args)...); }
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/IncludeOS_install/includeos/api/util/delegate.hpp:395:3: note: in instantiation of function template specialization 'spec::inplace<32, 16, void, std::__1::shared_ptr<unsigned char>, unsigned long>::inplace<(lambda at /service/service.cpp:105:5), (lambda at /service/service.cpp:105:5)>' requested here
                storage_{ std::forward<T>(val) }
                ^
/service/service.cpp:105:5: note: in instantiation of function template specialization 'delegate<void (std::__1::shared_ptr<unsigned char>, unsigned long), spec::inplace, 32, 16>::delegate<(lambda at /service/service.cpp:105:5), void>' requested here
    [conn] (auto buf)
    ^
/service/service.cpp:105:5: note: candidate function template not viable: requires single argument 'buf', but 2 arguments were provided
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/service.dir/service.cpp.o] Error 1
CMakeFiles/service.dir/build.make:62: recipe for target 'CMakeFiles/service.dir/service.cpp.o' failed
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/service.dir/all' failed
Makefile:127: recipe for target 'all' failed
make[1]: *** [CMakeFiles/service.dir/all] Error 2
make: *** [all] Error 2

Creating the issue here (builder not in sync with current IncludeOS?) but maybe should have filed against hioa-cs/IncludeOS (maybe example code is not up to date?).

mnordsletten commented 6 years ago

Hi, thanks for filing an issue.

You are correct, there is a mismatch in the versions specified in the docker readme and what will work if you are on the latest dev.

The latest tagged version of IncludeOS is v0.12.0-rc.1. There is a version of this image named includeos/includeos-common:v0.12.0-rc.1 and this can be used. To build using this perform the following command:

docker build -t includeos/includeos-build:v0.12.0-rc.1 -f Dockerfile.build --build-arg PARENT=includeos/includeos-common:v0.12.0-rc.1 .

Then you can build as you tried using:

$ cd <my-super-cool-service>
$ mkdir build && cd build
$ docker run --rm -v $(dirname $PWD):/service includeos/includeos-build:v0.12.0-rc.1

Everytime we push to hioa-cs/includeos:dev we update the includeos/includeos-common:dev docker image, so if you want to build using the latest dev environment you can use this.

I will update the readme to use the v0.12.0-rc.1 tag for now.