rust-lang / backtrace-rs

Backtraces in Rust
https://docs.rs/backtrace
Other
537 stars 246 forks source link

Error compiling backtrace-sys v0.1.24 #132

Closed MRECoelho closed 6 years ago

MRECoelho commented 6 years ago

Currently working on Solus with rustc 1.30.1 (1433507eb 2018-11-07). I saw a similar problem here, however I didn't quite understand the answer. My best guess was to add the submodules crate to my toml file, which didn't help much.

The project I'm working on can be found here.

Error:


miguel@zen ~/Documents/Projects/Rust/Walkers/random_walk_ggez $ cargo run
   Compiling backtrace-sys v0.1.24                                                                                                                                                                                                            
error: failed to run custom build command for `backtrace-sys v0.1.24`                                                                                                                                                                         
process didn't exit successfully: `/home/miguel/Documents/Projects/Rust/Walkers/random_walk_ggez/target/debug/build/backtrace-sys-af61f6a6f94f616a/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
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
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/libbacktrace" "-I" "/home/miguel/Documents/Projects/Rust/Walkers/random_walk_ggez/target/debug/build/backtrace-sys-b4e6883f3e489315/out" "-fvisibility=hidden" "-DBACKTRACE_ELF_SIZE=64" "-DBACKTRACE_SUPPORTED=1" "-DBACKTRACE_USES_MALLOC=1" "-DBACKTRACE_SUPPORTS_THREADS=0" "-DBACKTRACE_SUPPORTS_DATA=0" "-DHAVE_DL_ITERATE_PHDR=1" "-D_GNU_SOURCE=1" "-D_LARGE_FILES=1" "-Dbacktrace_full=__rbt_backtrace_full" "-Dbacktrace_dwarf_add=__rbt_backtrace_dwarf_add" "-Dbacktrace_initialize=__rbt_backtrace_initialize" "-Dbacktrace_pcinfo=__rbt_backtrace_pcinfo" "-Dbacktrace_syminfo=__rbt_backtrace_syminfo" "-Dbacktrace_get_view=__rbt_backtrace_get_view" "-Dbacktrace_release_view=__rbt_backtrace_release_view" "-Dbacktrace_alloc=__rbt_backtrace_alloc" "-Dbacktrace_free=__rbt_backtrace_free" "-Dbacktrace_vector_finish=__rbt_backtrace_vector_finish" "-Dbacktrace_vector_grow=__rbt_backtrace_vector_grow" "-Dbacktrace_vector_release=__rbt_backtrace_vector_release" "-Dbacktrace_close=__rbt_backtrace_close" "-Dbacktrace_open=__rbt_backtrace_open" "-Dbacktrace_print=__rbt_backtrace_print" "-Dbacktrace_simple=__rbt_backtrace_simple" "-Dbacktrace_qsort=__rbt_backtrace_qsort" "-Dbacktrace_create_state=__rbt_backtrace_create_state" "-Dbacktrace_uncompress_zdebug=__rbt_backtrace_uncompress_zdebug" "-o" "/home/miguel/Documents/Projects/Rust/Walkers/random_walk_ggez/target/debug/build/backtrace-sys-b4e6883f3e489315/out/src/libbacktrace/alloc.o" "-c" "src/libbacktrace/alloc.c"
cargo:warning=In file included from /usr/include/errno.h:28,
cargo:warning=                 from src/libbacktrace/alloc.c:35:
cargo:warning=/usr/include/bits/errno.h:26:11: fatal error: linux/errno.h: No such file or directory
cargo:warning= # include <linux/errno.h>
cargo:warning=           ^~~~~~~~~~~~~~~
cargo:warning=compilation terminated.
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "src/libbacktrace" "-I" "/home/miguel/Documents/Projects/Rust/Walkers/random_walk_ggez/target/debug/build/backtrace-sys-b4e6883f3e489315/out" "-fvisibility=hidden" "-DBACKTRACE_ELF_SIZE=64" "-DBACKTRACE_SUPPORTED=1" "-DBACKTRACE_USES_MALLOC=1" "-DBACKTRACE_SUPPORTS_THREADS=0" "-DBACKTRACE_SUPPORTS_DATA=0" "-DHAVE_DL_ITERATE_PHDR=1" "-D_GNU_SOURCE=1" "-D_LARGE_FILES=1" "-Dbacktrace_full=__rbt_backtrace_full" "-Dbacktrace_dwarf_add=__rbt_backtrace_dwarf_add" "-Dbacktrace_initialize=__rbt_backtrace_initialize" "-Dbacktrace_pcinfo=__rbt_backtrace_pcinfo" "-Dbacktrace_syminfo=__rbt_backtrace_syminfo" "-Dbacktrace_get_view=__rbt_backtrace_get_view" "-Dbacktrace_release_view=__rbt_backtrace_release_view" "-Dbacktrace_alloc=__rbt_backtrace_alloc" "-Dbacktrace_free=__rbt_backtrace_free" "-Dbacktrace_vector_finish=__rbt_backtrace_vector_finish" "-Dbacktrace_vector_grow=__rbt_backtrace_vector_grow" "-Dbacktrace_vector_release=__rbt_backtrace_vector_release" "-Dbacktrace_close=__rbt_backtrace_close" "-Dbacktrace_open=__rbt_backtrace_open" "-Dbacktrace_print=__rbt_backtrace_print" "-Dbacktrace_simple=__rbt_backtrace_simple" "-Dbacktrace_qsort=__rbt_backtrace_qsort" "-Dbacktrace_create_state=__rbt_backtrace_create_state" "-Dbacktrace_uncompress_zdebug=__rbt_backtrace_uncompress_zdebug" "-o" "/home/miguel/Documents/Projects/Rust/Walkers/random_walk_ggez/target/debug/build/backtrace-sys-b4e6883f3e489315/out/src/libbacktrace/alloc.o" "-c" "src/libbacktrace/alloc.c" with args "cc" did not execute successfully (status code exit code: 1).

', /home/miguel/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.25/src/lib.rs:2260:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
alexcrichton commented 6 years ago

Thanks for the report! This looks like it's largely just a missing header file though? Perhaps a misconfigured local C compiler?

MRECoelho commented 6 years ago

Forgive my incompetence, I had to read upon header files and how exactly you could configure a c compiler before I wanted to mess with stuff I didn't get. But you were right about the misconfiguration! For reference sake I though I'd share my steps to solving the problem.

So, first I had to install a complete C compiler toolchain using:

sudo eopkg install -c system.devel

I know I've done that in the past but apparently I butchered the latest installation of my OS. Anyway, that lead to a new compiler error complaining about a missing not being able to find 'lsdl2' even though it was there. This thread showed me the solution, which was to create a new symbolic link.

sudo ln -s /usr/lib64/libSDL2-2.0.so /usr/lib64/libSDL2.so

This all might be trivial, but it was a bit new to me ;)

Anyway, thank you so much for you fast response and pointing me in the right direction!

alexcrichton commented 6 years ago

Ok glad it worked out! I'm gonna close this issue as I don't think there's much we could have done about this on this crate's side