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

Blank project with lz4 fails "cargo check" on OS X #43

Open
rodya-mirov opened this issue Mar 13, 2019 · 1 comment
Open

Blank project with lz4 fails "cargo check" on OS X #43

rodya-mirov opened this issue Mar 13, 2019 · 1 comment

Comments

@rodya-mirov
Copy link

rodya-mirov commented Mar 13, 2019

I understand this is binding to a C library, but the bindings don't seem to be bound. Or something. I don't speak C. I'm not sure what assumptions this is making about my local machine, because there is no install guide. lz4 is installed on my machine and is pointing to /usr/local/bin/lz4.

I made a new project with cargo new, added lz4 = "1.23.1" to the dependencies in Cargo.toml, and ran cargo check. I got the following opaque error messages:

$ export RUST_BACKTRADE=1; cargo check
   Compiling lz4-sys v1.8.3
error: failed to run custom build command for `lz4-sys v1.8.3`
process didn't exit successfully: `/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-a7eabe1892d3ba65/build-script-build` (exit code: 101)
--- stdout
TARGET = 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
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4.o" "-c" "liblz4/lib/lz4.c"
exit code: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4frame.o" "-c" "liblz4/lib/lz4frame.c"
exit code: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4hc.o" "-c" "liblz4/lib/lz4hc.c"
exit code: 0
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/xxhash.o" "-c" "liblz4/lib/xxhash.c"
exit code: 0
AR_x86_64-apple-darwin = None
AR_x86_64_apple_darwin = None
HOST_AR = None
AR = None
running: "ar" "crs" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4.a" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4.o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4frame.o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4hc.o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/xxhash.o"
cargo:warning=/opt/local/bin/ranlib: object: /Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4.a(lz4.o) malformed object (unknown load command 1)
cargo:warning=ar: internal ranlib command failed
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "ar" "crs" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4.a" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4.o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4frame.o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/lz4hc.o" "/Users/richard.rast/example/lz4ex/target/debug/build/lz4-sys-3174f5bb3bf29731/out/liblz4/lib/xxhash.o" with args "ar" did not execute successfully (status code exit code: 1).

', /Users/richard.rast/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.31/src/lib.rs:2367:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
@rodya-mirov
Copy link
Author

Note: rust-lang/backtrace-rs#128 indicates a similar issue (in a different repository) so it may be that a bad copy of cc is running around for Mac. yay for us. Will close this issue if I can confirm

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

1 participant