Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo run fails on OSX 10.12.1 #480

Closed
philippkeller opened this issue Dec 28, 2016 · 3 comments
Closed

cargo run fails on OSX 10.12.1 #480

philippkeller opened this issue Dec 28, 2016 · 3 comments

Comments

@philippkeller
Copy link

cd libc-test && cargo run fails with:

   Compiling libc-test v0.1.0 (file:///Users/philipp/oss/libc/libc-test)
error: failed to run custom build command for `libc-test v0.1.0 (file:///Users/philipp/oss/libc/libc-test)`
process didn't exit successfully: `/Users/philipp/oss/libc/target/debug/build/libc-test-e4b221826622db1a/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=../src/lib.rs
cargo:rerun-if-changed=../src/dox.rs
cargo:rerun-if-changed=../src/unix/mod.rs
cargo:rerun-if-changed=../src/macros.rs
cargo:rerun-if-changed=../src/unix/bsd/mod.rs
cargo:rerun-if-changed=../src/unix/bsd/apple/mod.rs
cargo:rerun-if-changed=../src/unix/bsd/apple/b64.rs
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
debug=true opt-level=0
HOST = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
HOST = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-Wall" "-Wextra" "-Werror" "-Wno-unused-parameter" "-Wno-type-limits" "-Wno-deprecated-declarations" "-o" "/Users/philipp/oss/libc/target/debug/build/libc-test-a2a81fcd0fdb71cc/out/all.o" "-c" "/Users/philipp/oss/libc/target/debug/build/libc-test-a2a81fcd0fdb71cc/out/all.c"
cargo:warning=/Users/philipp/oss/libc/target/debug/build/libc-test-a2a81fcd0fdb71cc/out/all.c:12680:66: error: use of undeclared identifier 'KERN_KDENABLE_BG_TRACE'
cargo:warning=            static int __test_const_KERN_KDENABLE_BG_TRACE_val = KERN_KDENABLE_BG_TRACE;
cargo:warning=                                                                 ^
cargo:warning=/Users/philipp/oss/libc/target/debug/build/libc-test-a2a81fcd0fdb71cc/out/all.c:12686:67: error: use of undeclared identifier 'KERN_KDDISABLE_BG_TRACE'
cargo:warning=            static int __test_const_KERN_KDDISABLE_BG_TRACE_val = KERN_KDDISABLE_BG_TRACE;
cargo:warning=                                                                  ^
cargo:warning=2 errors generated.
ExitStatus(ExitStatus(256))


command did not execute successfully, got: exit code: 1



--- stderr
thread 'main' panicked at 'explicit panic', /Users/philipp/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.35/src/lib.rs:897
stack backtrace:
   1:        0x1079147ba - std::sys::imp::backtrace::tracing::imp::write::hd8952e96bd20f4b7
   2:        0x10791962f - std::panicking::default_hook::{{closure}}::hfd6ba86ea4dd6ba9
   3:        0x1079192d7 - std::panicking::default_hook::h44ade8c78c995294
   4:        0x107919a36 - std::panicking::rust_panic_with_hook::h3e771863e3ed8403
   5:        0x1073b74f3 - std::panicking::begin_panic::h94258923a88c8674
   6:        0x1073d8fba - gcc::fail::h746b5a92c67537cd
   7:        0x1073d8b34 - gcc::run::h1f20c84d1d42308c
   8:        0x1073d017c - gcc::Config::compile_object::h5fb2784c54de727f
   9:        0x1073cfadd - gcc::Config::compile_objects::h037ba06b0cc44c7c
  10:        0x1073cf0b4 - gcc::Config::compile::h7413c285bc5d235e
  11:        0x10739e64a - ctest::TestGenerator::_generate::h8420e1d411a8d88e
  12:        0x10734e55e - ctest::TestGenerator::generate::hee3e8852123ea693
  13:        0x107352809 - build_script_build::main::hb85df0201459ee74
  14:        0x10791a8fa - __rust_maybe_catch_panic
  15:        0x107919dd6 - std::rt::lang_start::hefd96b70277e8a4a
  16:        0x107354d49 - main

if I read the error correctly then it misses KERN_KDENABLE_BG_TRACE and KERN_KDDISABLE_BG_TRACE. These are indeed missing in /usr/include/... in /usr/include/sys/sysctl.h there are some defines such as KERN_KDEBUG but not the two missing ones.

My setup:

  • OSX 10.12.1
  • rust: nightly-x86_64-apple-darwin, rustc 1.15.0-nightly (71c06a56a 2016-12-18)
@alexcrichton
Copy link
Member

Oh dear! Looks like OSX removed these I suppose? If you want to send a PR updating the "ignore whitelist" in libc-test/build.rs I think that should do the trick!

@philippkeller
Copy link
Author

I tried to build on Travis - and the test runs on i686-apple-darwin and x86_64-apple-darwin.
So I think the problem is on my machine, no?

Is there a place where I can obtain the header files for a given architecture so I could compare Travis' environment to mine?

@alexcrichton
Copy link
Member

It's likely that you're running a different version of OSX than Travis, but it doesn't necessarily mean your machine has a problem. I unfortunately don't know of a way to extract header files from Travis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants