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

Support CROSS_COMPILE environment variable #106

Merged
merged 2 commits into from
Oct 12, 2016

Conversation

jdub
Copy link
Contributor

@jdub jdub commented Oct 11, 2016

Used as last resort when HOST != TARGET.

Used as last resort when HOST != TARGET.
@jdub
Copy link
Contributor Author

jdub commented Oct 11, 2016

Intended as one approach to #82.

This is kinda ugly, because I had to juggle an Option<String> into an Option<&str> and didn't want to muck around too much with the logic in the host != target if block.

No tests or docs because I'm spitballing an approach for now. 😳

@alexcrichton
Copy link
Member

Thanks! I wonder if perhaps this should be prioritized over the fallback prefixes though? It seems like it this variable is set it's higher priority

@jdub
Copy link
Contributor Author

jdub commented Oct 12, 2016

Hmm, yeah. 😳

This is a bit ooky, but it looks better than if cross_compile.is_some() { … } else { match … }.

@alexcrichton alexcrichton merged commit 24d1b39 into rust-lang:master Oct 12, 2016
@alexcrichton
Copy link
Member

Thanks!

@jdub
Copy link
Contributor Author

jdub commented Oct 12, 2016

Oh! That is a surprise. I hadn't written docs, tests, or extended it to the other tools yet. I'll follow up in a separate PR. 😀

@jdub jdub deleted the cross-compile branch October 12, 2016 15:02
@alexcrichton
Copy link
Member

Oh ok seems fine to me :)

ruuda added a commit to ruuda/filebuffer that referenced this pull request Oct 22, 2016
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
ruuda added a commit to ruuda/filebuffer that referenced this pull request Oct 22, 2016
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
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

Successfully merging this pull request may close these issues.

3 participants