RedisLabsModules/redismodule-rs

Sample not building on RaspberriPi

janraak opened this issue · 2 comments

I:

  1. Installed clang9
  2. Installed rust
  3. downloaded redis 6.0
  4. cloned the redismodule-rs repo
  5. tried to build following the read.me instructions.

No luck

pi@raspberrypiB:~/redis/redis-6.0.10/rust/redismodule-rs $ ./build.sh
Compiling redis-module v0.12.0 (/home/pi/redis/redis-6.0.10/rust/redismodule-rs)
error: failed to run custom build command for redis-module v0.12.0 (/home/pi/redis/redis-6.0.10/rust/redismodule-rs)

Caused by:
process didn't exit successfully: /home/pi/redis/redis-6.0.10/rust/redismodule-rs/target/debug/build/redis-module-1b4fff876549888d/build-script-build (exit code: 101)
--- stdout
TARGET = Some("armv7-unknown-linux-gnueabihf")
OPT_LEVEL = Some("0")
HOST = Some("armv7-unknown-linux-gnueabihf")
CC_armv7-unknown-linux-gnueabihf = None
CC_armv7_unknown_linux_gnueabihf = None
HOST_CC = None
CC = None
CFLAGS_armv7-unknown-linux-gnueabihf = None
CFLAGS_armv7_unknown_linux_gnueabihf = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = None
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=armv7-a" "-I" "src/include/" "-Wall" "-Wextra" "-DREDISMODULE_EXPERIMENTAL_API" "-o" "/home/pi/redis/redis-6.0.10/rust/redismodule-rs/target/debug/build/redis-module-2b3d6b368d48fecf/out/src/redismodule.o" "-c" "src/redismodule.c"
exit code: 0
AR_armv7-unknown-linux-gnueabihf = None
AR_armv7_unknown_linux_gnueabihf = None
HOST_AR = None
AR = None
running: "ar" "cq" "/home/pi/redis/redis-6.0.10/rust/redismodule-rs/target/debug/build/redis-module-2b3d6b368d48fecf/out/libredismodule.a" "/home/pi/redis/redis-6.0.10/rust/redismodule-rs/target/debug/build/redis-module-2b3d6b368d48fecf/out/src/redismodule.o"
exit code: 0
running: "ar" "s" "/home/pi/redis/redis-6.0.10/rust/redismodule-rs/target/debug/build/redis-module-2b3d6b368d48fecf/out/libredismodule.a"
exit code: 0
cargo:rustc-link-lib=static=redismodule
cargo:rustc-link-search=native=/home/pi/redis/redis-6.0.10/rust/redismodule-rs/target/debug/build/redis-module-2b3d6b368d48fecf/out

--- stderr
/usr/include/arm-linux-gnueabihf/sys/types.h:144:10: fatal error: 'stddef.h' file not found
/usr/include/arm-linux-gnueabihf/sys/types.h:144:10: fatal error: 'stddef.h' file not found, err: true
thread 'main' panicked at 'error generating bindings: ()', build.rs:76:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
pi@raspberrypiB:~/redis/redis-6.0.10/rust/redismodule-rs $

It looks like the issue is caused by the compiler being unable to locate the stddef.h header file. Could you verify this file is part of your clang installation? On my Ubuntu it's found under /usr/lib/clang/10/include/stddef.h; unfortunately I don't have a RaspberryPI to test with.

Also, re-running the build with RUST_BACKTRACE=1 might provide a little more detail.

> RUST_BACKTRACE=1 ./build.sh

Issue resolved.

  1. restarted my IDE(VSCODE) and started a new terminal.
  2. build and run succesful