Search code examples
linuxmesosalpine-linux

Errors compiling Mesos on Alpine Linux


I'm trying to create a Mesos 0.27.1 image for testing based on Alpine Linux and I've managed to make it most of the way through the compile by trial-and-error. Now I'm encountering an error that looks pretty low-level and I'm wondering if this means I can't use Mesos on Alpine at all.

The error is this:

libtool: compile:  g++ -DPACKAGE_NAME=\"libprocess\" -DPACKAGE_TARNAME=\"libprocess\" -DPACKAGE_VERSION=\"0.0.1\" "-DPACKAGE_STRING=\"libprocess 0.0.1\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libprocess\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_APR_POOLS_H=1 -DHAVE_LIBAPR_1=1 -DHAVE_SVN_VERSION_H=1 -DHAVE_LIBSVN_SUBR_1=1 -DHAVE_SVN_DELTA_H=1 -DHAVE_LIBSVN_DELTA_1=1 -DHAVE_LIBCURL=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_LIBZ=1 -DHAVE_LIBDL=1 -I. -DBUILD_DIR=\"/usr/src/mesos-0.27.1/3rdparty/libprocess\" -I./include -I./3rdparty/stout/include -isystem 3rdparty/boost-1.53.0 -I3rdparty/libev-4.15 -I3rdparty/picojson-1.3.0 -DPICOJSON_USE_INT64 -D__STDC_FORMAT_MACROS -I3rdparty/glog-0.3.3/src -I3rdparty/ry-http-parser-1c3624a -I/usr/include/subversion-1 -I/usr/include/apr-1 -I/usr/include/apr-1.0 -g1 -O0 -Wno-unused-local-typedefs -std=c++11 -MT libprocess_la-logging.lo -MD -MP -MF .deps/libprocess_la-logging.Tpo -c src/logging.cpp  -fPIC -DPIC -o libprocess_la-logging.o
In file included from ./include/process/time.hpp:18:0,
                 from ./include/process/clock.hpp:18,
                 from ./include/process/delay.hpp:16,
                 from src/logging.cpp:15:
./3rdparty/stout/include/stout/duration.hpp:80:27: error: 'timeval' does not name a type
   explicit Duration(const timeval& t)
                           ^
./3rdparty/stout/include/stout/duration.hpp: In constructor 'Duration::Duration(const int&)':
./3rdparty/stout/include/stout/duration.hpp:82:15: error: request for member 'tv_sec' in 't', which is of non-class type 'const int'
     nanos = t.tv_sec * SECONDS + t.tv_usec * MICROSECONDS;
               ^
./3rdparty/stout/include/stout/duration.hpp:82:36: error: request for member 'tv_usec' in 't', which is of non-class type 'const int'
     nanos = t.tv_sec * SECONDS + t.tv_usec * MICROSECONDS;
                                    ^
./3rdparty/stout/include/stout/duration.hpp: In member function 'timeval Duration::timeval() const':
./3rdparty/stout/include/stout/duration.hpp:95:3: error: return type 'struct timeval' is incomplete
   {
   ^
./3rdparty/stout/include/stout/duration.hpp:96:20: error: aggregate 'timeval t' has incomplete type and cannot be defined
     struct timeval t;
                    ^
Makefile:844: recipe for target 'libprocess_la-logging.lo' failed
make[4]: *** [libprocess_la-logging.lo] Error 1
make[4]: Leaving directory '/usr/src/mesos-0.27.1/3rdparty/libprocess'
Makefile:1321: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/usr/src/mesos-0.27.1/3rdparty/libprocess'
Makefile:490: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/usr/src/mesos-0.27.1/3rdparty'
Makefile:443: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/mesos-0.27.1/3rdparty'
Makefile:682: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Should I now abandon all hope and give up on this endeavor?


Solution

  • I have a build that compiles. If you want to see what I did, you can start here:

    https://github.com/jimfcarroll/mesos-on-alpine/blob/alpine/alpine/build.sh

    you can use it like this:

    https://github.com/jimfcarroll/mesos-on-alpine/blob/alpine/alpine/README

    It makes changes to system include files and there's a code patch that it cherry-picks from my alpine branch of mesos. You can review these to see what the changes are.

    It stands up and runs, however, about 10-15 of the tests fail.

    Some of these failures are related to the fact that Alpine standard commands (like: 'cp' and 'du') take different parameters than what mesos expects.

    At least one is because of functionality that my patch eliminates related to mesos reading fstab.

    I'm not sure about the others.

    My goal was not to get an alpine based mesos-master and mesos-slave (though that would have been good if I could have done it) but to build the libmesos.so so that I could run an Docker Alpine based Mesos framework by moving the libraries over once they're built.

    EDIT: I should note that I've yet to get it to work successfully against mesosphere released mesos-master and mesos-slave so take this as a starting point. I'd love to see if anyone makes more progress.