Skip to content

Commit

Permalink
Updated libc dependency to allow 0.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
SSheldon committed Nov 6, 2015
1 parent 1c3f102 commit fbb62f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude = [".gitignore", ".travis.yml", "ios-tests/**", "xtests/**"]
exception = ["objc_exception"]

[dependencies]
libc = "0.1"
libc = ">= 0.1, < 0.3"
malloc_buf = "0.0"

[dependencies.objc_exception]
Expand Down

3 comments on commit fbb62f8

@tomaka
Copy link

@tomaka tomaka commented on fbb62f8 Nov 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a breaking change and caused glutin to break: rust-windowing/glutin#654 :-/

You should have bumped the major version.

@mitchmindtree
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SSheldon if you yank 0.1.8 and publish as 0.2.0, that might fix glutin? I'm not sure whether or not cargo update would roll back from the yanked 0.1.8 to the un-broken 0.1.7 in glutin though?

@SSheldon
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glutin breaks even with objc pinned to 0.1.7, which is why I didn't catch this in my testing. If you pin objc to 0.1.7 you still get:

src/api/cocoa/mod.rs:313:33: 313:36 error: mismatched types:
 expected `*mut libc::types::common::c95::c_void`,
    found `*mut libc::c_void`
(expected enum `libc::types::common::c95::c_void`,
    found enum `libc::c_void`) [E0308]
src/api/cocoa/mod.rs:313                 CGLSetParameter(obj, kCGLCPSurfaceOpacity, &mut opacity);
                                                         ^~~
src/api/cocoa/mod.rs:313:33: 313:36 help: run `rustc --explain E0308` to see a detailed explanation
src/api/cocoa/mod.rs:561:31: 561:50 error: mismatched types:
 expected `*mut libc::types::common::c95::c_void`,
    found `*mut libc::c_void`
(expected enum `libc::types::common::c95::c_void`,
    found enum `libc::c_void`) [E0308]
src/api/cocoa/mod.rs:561                     CGLEnable(cxt.CGLContextObj(), kCGLCECrashOnRemovedFunctions);
                                                       ^~~~~~~~~~~~~~~~~~~
src/api/cocoa/mod.rs:526:17: 566:18 note: in this expansion of if let expansion
src/api/cocoa/mod.rs:521:13: 569:14 note: in this expansion of if let expansion
src/api/cocoa/mod.rs:561:31: 561:50 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to 2 previous errors

Regardless, sorry for making more breakage :(

I need to think about this, because I firmly believe that this shouldn't be a breaking change. Allowing more versions of libc should strictly make things more compatible. I think this is a bug in Cargo, rust-lang/cargo#2064.

On a broader note, if updating any dependency in a crate is a breaking change, that's going to make working with Rust really frustrating in the long run.

But anyways, I realize my musings don't help solve the immediate issue, so I'll see what can be done about that.

Please sign in to comment.