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

gstreamer does not build in rust 1.4, cargo 0.5. #5

Closed
coriolinus opened this issue Dec 7, 2015 · 8 comments
Closed

gstreamer does not build in rust 1.4, cargo 0.5. #5

coriolinus opened this issue Dec 7, 2015 · 8 comments

Comments

@coriolinus
Copy link

[master]> rustc --version
rustc 1.4.0 (8ab8581f6 2015-10-27)
[master]> cargo --version
cargo 0.5.0-nightly (833b947 2015-09-13)
[master]> cargo build --verbose
   Compiling gstreamer v0.2.7 (file:///D:/Users/coriolinus/Documents/GitHub/gstreamer1.0-rs)
     Running `rustc build.rs --crate-name build_script_build --crate-type bin -g --out-dir D:\Users\coriolinus\Documents\GitHub\gstreamer1.0-rs\target\debug\build\gstreamer-c4035b655e0fdb42 --emit=dep-info,link -L dependency=D:\Users\coriolinus\Documents\GitHub\gstreamer1.0-rs\target\debug -L dependency=D:\Users\coriolinus\Documents\GitHub\gstreamer1.0-rs\target\debug\deps`
       Fresh libc v0.1.12
build.rs:13:1: 13:19 error: use of unstable library feature 'libc': use `libc` from crates.io (see issue #27783)
build.rs:13 extern crate libc;
            ^~~~~~~~~~~~~~~~~~
build.rs:20:37: 20:51 error: use of unstable library feature 'libc': use `libc` from crates.io (see issue #27783)
build.rs:20     let key = if mem::size_of::<*const ::libc::c_void>() == 4{
                                                   ^~~~~~~~~~~~~~
error: aborting due to 2 previous errors
Could not compile `gstreamer`.

Caused by:
  Process didn't exit successfully: `rustc build.rs --crate-name build_script_build --crate-type bin -g --out-dir D:\Users\coriolinus\Documents\GitHub\gstreamer1.0-rs\target\debug\build\gstreamer-c4035b655e0fdb42 --emit=dep-info,link -L dependency=D:\Users\coriolinus\Documents\GitHub\gstreamer1.0-rs\target\debug -L dependency=D:\Users\coriolinus\Documents\GitHub\gstreamer1.0-rs\target\debug\deps` (exit code: 101)

I've tested this with libc 0.1.12 and 0.2.2; they both return the same error.

The referred error (rust-lang/rust#27783) is a bit opaque to me given that as far as I can tell, you do in fact require the use of libc from crates.io in your Cargo.toml here.

Any ideas what's going on here and how to get this to compile, or do you feel it's more useful to just wait until libc stabilizes?

@arturoc
Copy link
Owner

arturoc commented Dec 7, 2015

it's working for me fine, have you tried to run cargo update first? it might be trying to use an old version of libc. it's pulling version 0.2.2 for me

@coriolinus
Copy link
Author

It pulled 2.2 for me initially, but gave the same error. I downgraded to 1.12 because that was what was in the passing Travis build, in case it had been a breaking upgrade.

If it's working for you, I'm curious what exact rustc / cargo versions are you using? Given that rustc's error points to a discussion of stabilization of libc in future rustc versions, I suspect that this issue is (hopefully) only temporarily unstable. That said, I'd be willing to use an older version of the compiler if that makes the code work.

@arturoc
Copy link
Owner

arturoc commented Dec 7, 2015

i've just installed 1.4 stable from the web, i'm using

cargo 0.5.0-nightly (833b947 2015-09-13)

and

rustc 1.4.0 (8ab8581f6 2015-10-27)

on linux

@coriolinus
Copy link
Author

It looks like the only difference in our setup right now is the platform;
I'm on Windows. While I had thought that might be an area of concern, I
wasn't expecting it to come up in the Rust compile phase!

I may be able to get a linux box up and running in a little while to see if
I can duplicate your results, but for now, I think I'm going to file this
under Windows-specific weirdness.

On Mon, Dec 7, 2015 at 7:59 PM, arturo [email protected] wrote:

i've just installed 1.4 stable from the web, i'm using

cargo 0.5.0-nightly (833b947 2015-09-13)

and

rustc 1.4.0 (8ab8581f6 2015-10-27)

on linux


Reply to this email directly or view it on GitHub
#5 (comment)
.

@starryangt
Copy link

Adding 'libc = "*"' to [build-dependencies] seems to fix it on windows, 1.5 stable and 1.6 beta.

@coriolinus
Copy link
Author

Alternately, you can replace build.rs:20 with the following:

let key = if cfg!(target_pointer_width = "32") {

and it appears to work then, also.

@arturoc
Copy link
Owner

arturoc commented Dec 28, 2015

thanks!

@arturoc
Copy link
Owner

arturoc commented Dec 28, 2015

i've also removed the dependency with libc since the needed types are now in std::os::raw

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

3 participants