简体   繁体   English

在Alpine Linux上编译Mesos时出错

[英]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. 我正在尝试创建一个Mesos 0.27.1映像以用于基于Alpine Linux的测试,并且已经设法通过反复试验使其在大多数情况下得以通过。 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. 现在,我遇到了一个看起来很底层的错误,我想知道这是否意味着我根本无法在Alpine上使用Mesos。

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? 我现在应该放弃所有希望并放弃这项努力吗?

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 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 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. 它对系统包含文件进行了更改,并且有一个代码补丁,它是从我的mesos高山分支摘录而来的。 You can review these to see what the changes are. 您可以查看这些内容以查看更改。

It stands up and runs, however, about 10-15 of the tests fail. 它可以正常运行,但是大约有10-15个测试失败。

Some of these failures are related to the fact that Alpine standard commands (like: 'cp' and 'du') take different parameters than what mesos expects. 其中一些失败与Alpine标准命令(例如:“ cp”和“ du”)采用的参数比mesos期望的参数不同有关。

At least one is because of functionality that my patch eliminates related to mesos reading fstab. 至少一个原因是由于我的补丁程序消除了与读取fstab的mesos有关的功能。

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. 我的目标不是获得基于阿尔卑斯的mesos-master和mesos-slave(尽管如果可以的话,那会很好),而是构建libmesos.so,以便我可以通过移动来运行基于Docker Alpine的Mesos框架库一旦建立就结束了。

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. 编辑:我应该注意,我还没有使它能够成功地对抗中层释放的mesos-master和mesos-slave,因此以此为起点。 I'd love to see if anyone makes more progress. 我很想看看是否有人能取得更大的进步。

I ran into this today and the answer from David C Rankin helped me make this work. 我今天遇到了这个问题,David C Rankin回答帮助我完成了这项工作。 Inside of /3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp, I just added in #include <sys/time.h> under the call to #include time.h . 在/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp中,我只是在#include <sys/time.h>下的#include time.h调用下添加了它。

You'll likely run into issues with installing the POM (ssl certs not present and tools.jar not found) after that but those are outside the scope of this answer. 在那之后,您可能会遇到安装POM的问题(不存在ssl证书,未找到tools.jar),但这些问题不在此答案的范围之内。

从Git中的最新代码开始,Mesos现在应立即在Alpine Linux上构建(请参阅https://issues.apache.org/jira/browse/MESOS-5540)-这些更改应包含在后续的Apache中Mesos发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM