Building from source: seafile server build fails

I’m trying to build Seafile (server and hub) from source on Gentoo. I believe I have nearly all dependencies; I’m expecting to see obvious compile errors for any that I missed.

I’ve gotten these tarballs:

ccnet-server-v6.2.0-server.tar.gz
libevhtp-1.2.12-1.tar.gz
libsearpc-v3.1-latest.tar.gz
seafile-server-v6.2.0-server.tar.gz
seahub-v6.2.0-server.tar.gz

I am attempting to install into ~/usr/local (under the user’s home dir) by way of --prefix on the ./configure commands. I am following the instructions at https://manual.seafile.com/build_seafile/server.html . libevhtp, libsearpc and ccnet-server seem to have built and installed without issue. Next is seafile-server but I am not succeeding.

I have set these environment variables to try to help the build:

CPATH=/home/seafile6/seafile-server/src/libsearpc-3.1-latest/test
PKG_CONFIG_PATH=/home/seafile6/usr/local/lib/pkgconfig
LD_RUN_PATH=/home/seafile6/usr/local/lib
PATH=/home/seafile6/.rvm/gems/ruby-2.4.2/bin:/home/seafile6/.rvm/gems/ruby-2.4.2@global/bin:/home/seafile6/.rvm/rubies/ruby-2.4.2/bin:/home/seafile6/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3:/home/seafile6/.rvm/bin:/home/seafile6/usr/local:/home/seafile6/usr/local/bin

I set the CPATH because without it, the ccnet build fails at:

../common/rpc-service.c:40:30: fatal error: searpc-signature.h: No such file or directory #include "searpc-signature.h"

The final lines of the build failure for seafile-server are:

upload-file.c: In function ‘upload_read_cb’:
upload-file.c:2056:12: error: ‘evhtp_request_t’ has no member named ‘keepalive’
         req->keepalive = 0;
            ^
upload-file.c: In function ‘upload_headers_cb’:                                                                                                                                 upload-file.c:2257:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook (&req->hooks, evhtp_hook_on_read, upload_read_cb, fsm);
     ^
upload-file.c:2258:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook (&req->hooks, evhtp_hook_on_request_fini, upload_finish_cb, fsm);                                                                                                ^
upload-file.c:2273:8: error: ‘evhtp_request_t’ has no member named ‘keepalive’
     req->keepalive = 0;
        ^
upload-file.c: In function ‘upload_file_init’:                                                                                                                         [32/1801]
upload-file.c:2342:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]                                                                                                                          evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2342:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2345:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]                                                                                                                          evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2345:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2349:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]                                                                                                                          evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2349:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2352:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2352:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2355:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2355:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2358:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2358:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2361:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2361:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2364:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook
() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2364:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2367:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2367:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2370:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2370:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
upload-file.c:2373:5: warning: ‘evhtp_set_hook’ is deprecated (declared at /home/seafile6/usr/local/include/evhtp/evhtp.h:784): use evhtp_[connection|request|callback]_set_hook() instead of set_hook directly [-Wdeprecated-declarations]
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
     ^
upload-file.c:2373:23: error: dereferencing pointer to incomplete type
     evhtp_set_hook(&cb->hooks, evhtp_hook_on_headers, upload_headers_cb, NULL);
                       ^
make[3]: *** [Makefile:694: upload-file.o] Error 1
make[3]: Leaving directory '/home/seafile6/seafile-server/src/seafile-server-6.2.0-server/server'
make[2]: *** [Makefile:1245: all-recursive] Error 1
make[2]: Leaving directory '/home/seafile6/seafile-server/src/seafile-server-6.2.0-server/server'
make[1]: *** [Makefile:459: all-recursive] Error 1
make[1]: Leaving directory '/home/seafile6/seafile-server/src/seafile-server-6.2.0-server'
make: *** [Makefile:391: all] Error 2

~/usr/local has this stuff in it:

/home/seafile6/usr/local
├── bin
│   ├── ccnet-init
│   ├── ccnet-server
│   └── searpc-codegen.py
├── include
│   ├── ccnet
│   │   ├── async-rpc-proc.h
│   │   ├── ccnet-client.h
│   │   ├── ccnet-object.h
│   │   ├── ccnetrpc-transport.h
│   │   ├── ccnet-session-base.h
│   │   ├── cevent.h
│   │   ├── invoke-service-proc.h
│   │   ├── job-mgr.h
│   │   ├── message.h
│   │   ├── mqclient-proc.h
│   │   ├── option.h
│   │   ├── packet.h
│   │   ├── peer.h
│   │   ├── processor.h
│   │   ├── proc-factory.h
│   │   ├── rpcserver-proc.h
│   │   ├── sendcmd-proc.h
│   │   ├── status-code.h
│   │   ├── threaded-rpcserver-proc.h
│   │   ├── timer.h
│   │   └── valid-check.h
│   ├── ccnet.h
│   ├── evhtp
│   │   ├── config.h
│   │   ├── evhtp.h
│   │   ├── parser.h
│   │   └── thread.h
│   ├── evhtp.h
│   ├── searpc-client.h
│   ├── searpc.h
│   ├── searpc-named-pipe-transport.h
│   ├── searpc-server.h
│   └── searpc-utils.h
├── lib
│   ├── libccnet.a
│   ├── libccnet.la
│   ├── libccnet.so -> libccnet.so.0.0.0
│   ├── libccnet.so.0 -> libccnet.so.0.0.0
│   ├── libccnet.so.0.0.0
│   ├── libevhtp.a
│   ├── libsearpc.a
│   ├── libsearpc.la
│   ├── libsearpc.so -> libsearpc.so.1.0.2
│   ├── libsearpc.so.1 -> libsearpc.so.1.0.2
│   ├── libsearpc.so.1.0.2
│   └── pkgconfig
│       ├── evhtp.pc
│       ├── libccnet.pc
│       └── libsearpc.pc
└── lib64
    └── python2.7
        └── site-packages
            ├── ccnet
            │   ├── async
            │   │   ├── async_client.py
            │   │   ├── async_client.pyc
            │   │   ├── async_client.pyo
            │   │   ├── __init__.py
            │   │   ├── __init__.pyc
            │   │   ├── __init__.pyo
            │   │   ├── mqclientproc.py
            │   │   ├── mqclientproc.pyc
            │   │   ├── mqclientproc.pyo
            │   │   ├── processor.py
            │   │   ├── processor.pyc
            │   │   ├── processor.pyo
            │   │   ├── rpcserverproc.py
            │   │   ├── rpcserverproc.pyc
            │   │   ├── rpcserverproc.pyo
            │   │   ├── sendcmdproc.py
            │   │   ├── sendcmdproc.pyc
            │   │   ├── sendcmdproc.pyo
            │   │   ├── timer.py
            │   │   ├── timer.pyc
            │   │   └── timer.pyo
            │   ├── client.py
            │   ├── client.pyc
            │   ├── client.pyo
            │   ├── errors.py
            │   ├── errors.pyc
            │   ├── errors.pyo
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── __init__.pyo
            │   ├── message.py
            │   ├── message.pyc
            │   ├── message.pyo
            │   ├── packet.py
            │   ├── packet.pyc
            │   ├── packet.pyo
            │   ├── pool.py
            │   ├── pool.pyc
            │   ├── pool.pyo
            │   ├── rpc.py
            │   ├── rpc.pyc
            │   ├── rpc.pyo
            │   ├── status_code.py
            │   ├── status_code.pyc
            │   ├── status_code.pyo
            │   ├── sync_client.py
            │   ├── sync_client.pyc
            │   ├── sync_client.pyo
            │   ├── utils.py
            │   ├── utils.pyc
            │   └── utils.pyo
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo
            │   ├── client.py
            │   ├── client.pyc
            │   ├── client.pyo
            │   ├── errors.py
            │   ├── errors.pyc
            │   ├── errors.pyo
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── __init__.pyo
            │   ├── message.py
            │   ├── message.pyc
            │   ├── message.pyo
            │   ├── packet.py
            │   ├── packet.pyc
            │   ├── packet.pyo
            │   ├── pool.py
            │   ├── pool.pyc
            │   ├── pool.pyo
            │   ├── rpc.py
            │   ├── rpc.pyc
            │   ├── rpc.pyo
            │   ├── status_code.py
            │   ├── status_code.pyc
            │   ├── status_code.pyo
            │   ├── sync_client.py
            │   ├── sync_client.pyc
            │   ├── sync_client.pyo
            │   ├── utils.py
            │   ├── utils.pyc
            │   └── utils.pyo
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo
            │   ├── client.py
            │   ├── client.pyc
            │   ├── client.pyo
            │   ├── errors.py
            │   ├── errors.pyc
            │   ├── errors.pyo
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── __init__.pyo
            │   ├── message.py
            │   ├── message.pyc
            │   ├── message.pyo
            │   ├── packet.py
            │   ├── packet.pyc
            │   ├── packet.pyo
            │   ├── pool.py
            │   ├── pool.pyc
            │   ├── pool.pyo
            │   ├── rpc.py
            │   ├── rpc.pyc
            │   ├── rpc.pyo
            │   ├── status_code.py
            │   ├── status_code.pyc
            │   ├── status_code.pyo
            │   ├── sync_client.py
            │   ├── sync_client.pyc
            │   ├── sync_client.pyo
            │   ├── utils.py
            │   ├── utils.pyc
            │   └── utils.pyo
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo
            │   ├── client.py
            │   ├── client.pyc
            │   ├── client.pyo
            │   ├── errors.py
            │   ├── errors.pyc
            │   ├── errors.pyo
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── __init__.pyo
            │   ├── message.py
            │   ├── message.pyc
            │   ├── message.pyo
            │   ├── packet.py
            │   ├── packet.pyc
            │   ├── packet.pyo
            │   ├── pool.py
            │   ├── pool.pyc
            │   ├── pool.pyo
            │   ├── rpc.py
            │   ├── rpc.pyc
            │   ├── rpc.pyo
            │   ├── status_code.py
            │   ├── status_code.pyc
            │   ├── status_code.pyo
            │   ├── sync_client.py
            │   ├── sync_client.pyc
            │   ├── sync_client.pyo
            │   ├── utils.py
            │   ├── utils.pyc
            │   └── utils.pyo
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo
            │   ├── client.py
            │   ├── client.pyc
            │   ├── client.pyo
            │   ├── errors.py
            │   ├── errors.pyc
            │   ├── errors.pyo
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── __init__.pyo
            │   ├── message.py
            │   ├── message.pyc
            │   ├── message.pyo
            │   ├── packet.py
            │   ├── packet.pyc
            │   ├── packet.pyo
            │   ├── pool.py
            │   ├── pool.pyc
            │   ├── pool.pyo
            │   ├── rpc.py
            │   ├── rpc.pyc
            │   ├── rpc.pyo
            │   ├── status_code.py
            │   ├── status_code.pyc
            │   ├── status_code.pyo
            │   ├── sync_client.py
            │   ├── sync_client.pyc
            │   ├── sync_client.pyo
            │   ├── utils.py
            │   ├── utils.pyc
            │   └── utils.pyo
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo
            │   ├── client.py
            │   ├── client.pyc
            │   ├── client.pyo
            │   ├── errors.py
            │   ├── errors.pyc
            │   ├── errors.pyo
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── __init__.pyo
            │   ├── message.py
            │   ├── message.pyc
            │   ├── message.pyo
            │   ├── packet.py
            │   ├── packet.pyc
            │   ├── packet.pyo
            │   ├── pool.py
            │   ├── pool.pyc
            │   ├── pool.pyo
            │   ├── rpc.py
            │   ├── rpc.pyc
            │   ├── rpc.pyo
            │   ├── status_code.py
            │   ├── status_code.pyc
            │   ├── status_code.pyo
            │   ├── sync_client.py
            │   ├── sync_client.pyc
            │   ├── sync_client.pyo
            │   ├── utils.py
            │   ├── utils.pyc
            │   └── utils.pyo
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo
            │   ├── client.py
            │   ├── client.pyc
            │   ├── client.pyo
            │   ├── errors.py
            │   ├── errors.pyc
            │   ├── errors.pyo
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   ├── __init__.pyo
            │   ├── message.py
            │   ├── message.pyc
            │   ├── message.pyo
            │   ├── packet.py
            │   ├── packet.pyc
            │   ├── packet.pyo
            │   ├── pool.py
            │   ├── pool.pyc
            │   ├── pool.pyo
            │   ├── rpc.py
            │   ├── rpc.pyc
            │   ├── rpc.pyo
            │   ├── status_code.py
            │   ├── status_code.pyc
            │   ├── status_code.pyo
            │   ├── sync_client.py
            │   ├── sync_client.pyc
            │   ├── sync_client.pyo
            │   ├── utils.py
            │   ├── utils.pyc
            │   └── utils.pyo
            └── pysearpc
                ├── client.py
                ├── client.pyc
                ├── client.pyo
                ├── common.py
                ├── common.pyc
                ├── common.pyo
                ├── __init__.py
                ├── __init__.pyc
                ├── __init__.pyo
                ├── server.py
                ├── server.pyc
                └── server.pyo

CC: @lins05 , since you helped me with the ccnet build.

I got the same error, what is the solution?