RedBeardLab / rediSQL

Redis module that provides a completely functional SQL database
https://redisql.com
Other
1.55k stars 150 forks source link

cargo build error #25

Closed codebuks closed 6 years ago

codebuks commented 6 years ago

After i install rust use curl https://sh.rustup.rs -sSf | sh Then i Compiling the rediSQL following the instruction. I don't know how to solve this problem,can you help me?

[root@localhost rediSQL]# cargo build --release
   Compiling void v1.0.2
   Compiling strsim v0.6.0
   Compiling scopeguard v0.3.3
   Compiling rayon-core v1.3.0
   Compiling regex-syntax v0.4.1
   Compiling ansi_term v0.9.0
   Compiling lazy_static v0.2.10
   Compiling term v0.4.6
   Compiling bitflags v0.9.1
   Compiling utf8-ranges v1.0.0
   Compiling fnv v1.0.6
   Compiling log v0.3.8
   Compiling libloading v0.4.2
   Compiling vec_map v0.8.0
   Compiling bitflags v0.8.2
   Compiling libc v0.2.33
   Compiling either v1.4.0
   Compiling glob v0.2.11
   Compiling cfg-if v0.1.2
   Compiling peeking_take_while v0.1.2
   Compiling unicode-width v0.1.4
   Compiling unicode-xid v0.0.4
   Compiling rustc-serialize v0.3.24
   Compiling unreachable v1.0.0
   Compiling which v1.0.3
   Compiling memchr v1.0.2
   Compiling atty v0.2.3
   Compiling rand v0.3.18
   Compiling num_cpus v1.7.0
   Compiling coco v0.1.1
   Compiling clang-sys v0.19.0
   Compiling textwrap v0.9.0
   Compiling syntex_pos v0.58.1
   Compiling thread_local v0.3.4
   Compiling aho-corasick v0.6.3
   Compiling nom v3.2.1
   Compiling uuid v0.4.0
   Compiling clap v2.27.1
   Compiling syntex_errors v0.58.1
   Compiling regex v0.2.2
   Compiling cexpr v0.2.2
   Compiling rayon v0.8.2
   Compiling syntex_syntax v0.58.1
   Compiling env_logger v0.4.3
   Compiling cc v1.0.3
   Compiling syntex v0.58.1
   Compiling quasi v0.32.0
   Compiling aster v0.41.0
   Compiling quasi_codegen v0.32.0
   Compiling bindgen v0.30.0
   Compiling rediSQL v0.3.1 (file:///root/Desktop/redisql/rediSQL)
error: failed to run custom build command for `rediSQL v0.3.1 (file:///root/Desktop/redisql/rediSQL)`
process didn't exit successfully: `/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-024e4caa69221a00/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=src/CDeps
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/CDeps/Redis/include" "-Wall" "-Wextra" "-o" "/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out/src/CDeps/Redis/redismodule.o" "-c" "src/CDeps/Redis/redismodule.c"
cargo:warning=src/CDeps/Redis/redismodule.c:3:25: 警告:‘DBType’已初始化,却又被声明为‘extern’ [默认启用]
cargo:warning= extern RedisModuleType *DBType = NULL;
cargo:warning=                         ^
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
AR_x86_64-unknown-linux-gnu = None
AR_x86_64_unknown_linux_gnu = None
HOST_AR = None
AR = None
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
running: "ar" "crs" "/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out/libredismodule.a" "/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out/src/CDeps/Redis/redismodule.o"
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
cargo:rustc-link-lib=static=redismodule
cargo:rustc-link-search=native=/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/CDeps/SQLite/include" "-Wall" "-Wextra" "-DHAVE_USLEEP=1" "-DNDEBUG=1" "-DHAVE_FDATASYNC=1" "-DSQLITE_THREADSAFE=2" "-DSQLITE_ENABLE_JSON1=1" "-DSQLITE_ENABLE_FTS3=1" "-DSQLITE_ENABLE_FTS4=1" "-DSQLITE_ENABLE_FTS5=1" "-DSQLITE_ENABLE_RTREE=1" "-o" "/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out/src/CDeps/SQLite/sqlite3.o" "-c" "src/CDeps/SQLite/sqlite3.c"
cargo:warning=src/CDeps/SQLite/sqlite3.c: 在函数‘exprAnalyze’中:
cargo:warning=src/CDeps/SQLite/sqlite3.c:131527:39: 警告:此函数中的‘pLeft’在使用前可能未初始化 [-Wmaybe-uninitialized]
cargo:warning=         pNewTerm->u.leftColumn = pLeft->iColumn;
cargo:warning=                                       ^
cargo:warning=src/CDeps/SQLite/sqlite3.c:93128:39: 警告:此函数中的‘pRight’在使用前可能未初始化 [-Wmaybe-uninitialized]
cargo:warning=   return p ? exprDup(db, p, flags, 0) : 0;
cargo:warning=                                       ^
cargo:warning=src/CDeps/SQLite/sqlite3.c:131506:11: 附注:‘pRight’在此声明
cargo:warning=     Expr *pRight, *pLeft;
cargo:warning=           ^
cargo:warning=src/CDeps/SQLite/sqlite3.c:131529:28: 警告:此函数中的‘eOp2’在使用前可能未初始化 [-Wmaybe-uninitialized]
cargo:warning=         pNewTerm->eMatchOp = eOp2;
cargo:warning=                            ^
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
AR_x86_64-unknown-linux-gnu = None
AR_x86_64_unknown_linux_gnu = None
HOST_AR = None
AR = None
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
running: "ar" "crs" "/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out/libsqlite3.a" "/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out/src/CDeps/SQLite/sqlite3.o"
exit code: 0
TARGET = Some("x86_64-unknown-linux-gnu")
cargo:rustc-link-lib=static=sqlite3
cargo:rustc-link-search=native=/root/Desktop/redisql/rediSQL/target/release/build/rediSQL-e9b4b83cec1bc012/out

--- stderr
thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any of [\'libclang.so\', \'libclang.so.*\'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (skipped: [])"', /checkout/src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
siscia commented 6 years ago

Hi,

the error is that is not able to find clang.

I am not really sure how to fix the problem but I would like to point you here: https://github.com/KyleMayes/clang-sys/issues/31

Moreover I am wondering if the pre-compiled binaries are not enough for you. I compiled the last version for x64 and ARMv7, if you need something different I can provide them.

You can get the binaries here: https://github.com/RedBeardLab/rediSQL/releases

codebuks commented 6 years ago

My environment is: centos 7 64

uname -a Linux benwen 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

when i load the module using the redis.conf configuration directive: using version 0.2

3373:M 30 Jan 17:17:12.937 # Module /usr/local/bin/libredis_sql_0.2.so failed to load: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /usr/local/bin/libredis_sql_0.2.so) 3373:M 30 Jan 17:17:12.937 # Can't load module from /usr/local/bin/libredis_sql_0.2.so: server aborting

using version 0.3

3620:M 30 Jan 17:24:33.865 # Module /usr/local/bin/libredis_sql_0.3.so failed to load: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /usr/local/bin/libredis_sql_0.3.so) 3620:M 30 Jan 17:24:33.865 # Can't load module from /usr/local/bin/libredis_sql_0.3.so: server aborting

[root@localhost bin]# ldd --version ldd (GNU libc) 2.17 Copyright (C) 2012 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. 由 Roland McGrath 和 Ulrich Drepper 编写。

siscia commented 6 years ago

Hi,

I understand the problem.

In compilation you simply do not have the LIBC path set.

During execution RediSQL requires a newer version of LIBC than the one you have instaled, ideally LIBC should be staticaly compiled inside the shared object but this is simply not the case, and it seems quite complex to get everything as smooth as it should be.

This is quite an issues and other users report the same problem, so I need to find a reasonable solution even if it doesn't seems very simple.

At the moment a reasonable workaround is to use docker, there is a published image on the docker hub mentioned somewhere in the readme (I am writing this from my mobile phone, excuse me for not providing the link).

siscia commented 6 years ago

Hi,

do you mind to check out the answer to the issue #26 .

I upload a new binary and I would like to know if it solves your issues too.

Cheers

codebuks commented 6 years ago

the new binary solves my issues, thanks.

3192:M 13 Mar 17:27:58.364 * Module 'rediSQL' loaded from /usr/local/bin/libredis_sql_LIBC2.17.so
3192:M 13 Mar 17:27:58.364 * DB loaded from disk: 0.000 seconds
3192:M 13 Mar 17:27:58.364 * Ready to accept connections
siscia commented 6 years ago

That's great!

Thank you and sorry for taking all this time!

Actually I am working on an improved version of the module, so if you need any features let me know :)