Skip to content

Commit

Permalink
Work around breaking change in gcc crate
Browse files Browse the repository at this point in the history
The gcc crate, a transitive dependency of rust-crypto, recently released
a new version that breaks compatibility with Rust 1.4 through 1.6.
Because no major version bump was done, Cargo will prefer the more
recent version when no Cargo.lock is present. This is the case on CI, so
the builds are failing for Rust 1.4 through 1.6, even though they would
build fine with an older gcc crate.

To work around this, add an explicit dependency on gcc, locked to the
non-broken version. Because gcc is only a dependency of rust-crypto
which is a dev-dependency, gcc can be added as a dev-dependency too, so
this will not affect crates that depend on Filebuffer, fortunately.

For reference, the reason gcc is broken is because code was introduced
in [1] (commit 5f97af47013607521b70cb254a1b581cde2310a0) that uses the
function String::as_str, which was only stabilized in Rust 1.7.0.

[1]: rust-lang/cc-rs#106
  • Loading branch information
ruuda committed Oct 22, 2016
1 parent 5a1c85d commit 1f3a3e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ winapi = "0.2.5"

[dev-dependencies]
rust-crypto = "0.2.34"

# Version 0.3.36 of the gcc crate (a dependency of rust-crypto) breaks backwards
# compatibility with Rust 1.4 through 1.6, so force a less recent version. This
# is only for building the application, so dependencies of Filebuffer are not
# affected by this override.
gcc = "= 0.3.35"

0 comments on commit 1f3a3e2

Please sign in to comment.