ExPixel / miniaudio-rs

Rust bindings for miniaudio C library.
https://crates.io/crates/miniaudio
MIT License
49 stars 20 forks source link

For some reason, the miniaduio sys library is trying to generate the bindings even though the bindgen feature is not added #36

Closed ThePerkinrex closed 4 years ago

ThePerkinrex commented 4 years ago
❯ cargo build
   Compiling ep-miniaudio-sys v2.4.0
error: failed to run custom build command for `ep-miniaudio-sys v2.4.0`

Caused by:
  process didn't exit successfully: `/home/perc/Desktop/Projects/mlws_web/target/debug/build/ep-miniaudio-sys-35b524890eb7d61c/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
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  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
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  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
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "./miniaudio" "-Wall" "-Wextra" "-Wno-unused-function" "-msse2" "-DMINIAUDIO_IMPLEMENTATION=" "-DMA_LOG_LEVEL=1" "-o" "/home/perc/Desktop/Projects/mlws_web/target/debug/build/ep-miniaudio-sys-517a13ba79d9d3c6/out/./miniaudio-wrapper.o" "-c" "./miniaudio-wrapper.c"
  exit code: 0
  AR_x86_64-unknown-linux-gnu = None
  AR_x86_64_unknown_linux_gnu = None
  HOST_AR = None
  AR = None
  running: "ar" "crs" "/home/perc/Desktop/Projects/mlws_web/target/debug/build/ep-miniaudio-sys-517a13ba79d9d3c6/out/liblibminiaudio.a" "/home/perc/Desktop/Projects/mlws_web/target/debug/build/ep-miniaudio-sys-517a13ba79d9d3c6/out/./miniaudio-wrapper.o"
  exit code: 0
  cargo:rustc-link-lib=static=libminiaudio
  cargo:rustc-link-search=native=/home/perc/Desktop/Projects/mlws_web/target/debug/build/ep-miniaudio-sys-517a13ba79d9d3c6/out
  cargo:rustc-cfg=feature="ma-unix"
  cargo:rustc-cfg=feature="ma-linux"
  cargo:rustc-cfg=feature="ma-posix"
  cargo:rustc-cfg=feature="ma-support-alsa"
  cargo:rustc-cfg=feature="ma-support-pulseaudio"
  cargo:rustc-cfg=feature="ma-support-jack"
  cargo:rustc-cfg=feature="ma-support-null"
  cargo:rustc-cfg=feature="ma-enable-jack"
  cargo:rustc-cfg=feature="ma-enable-alsa"
  cargo:rustc-cfg=feature="ma-enable-pulseaudio"
  cargo:rustc-cfg=feature="ma-enable-null"

  --- stderr
  /usr/include/sched.h:29:10: fatal error: 'stddef.h' file not found
  /usr/include/sched.h:29:10: fatal error: 'stddef.h' file not found, err: true
  thread 'main' panicked at 'failed to generate bindings: ()', /home/perc/.cargo/registry/src/github.com-1ecc6299db9ec823/ep-miniaudio-sys-2.4.0/build.rs:58:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I am really not sure what's happening because I have all sound code inside a lib, and that compiles correctly (No errors are given) Maybe it is my problem because it is my first time creating a lib.

Full repo Lib repo

I'm just reporting the error here because it is a miniaudio problem what's being reported, but if it is my problem, please, just close this issue

ExPixel commented 4 years ago

I've disabled building without generating bindings because miniaudio has a lot of struct fields and code behind #ifdefs. It seems like you may not have clang & LLVM installed. If that is the case, try one of the installation methods from here: https://rust-lang.github.io/rust-bindgen/requirements.html and let me know how it goes :)

ThePerkinrex commented 4 years ago

Yep, that worked, well thanks, maybe the README should be updated to say that bindgen is necessary

ExPixel commented 4 years ago

Didn't realize that was still there. I'll update that as well, thanks.