Skip to content

bump rustc-cfg version and show a better error message when it fails #89

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

Merged
merged 1 commit into from
Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = "0.1.0"

[build-dependencies]
gcc = "0.3.35"
rustc-cfg = "0.1.2"
rustc-cfg = "0.2.0"

[dependencies]

Expand Down
8 changes: 6 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ extern crate gcc;
extern crate rustc_cfg;

use std::collections::BTreeMap;
use std::env;
use std::io::Write;
use std::path::Path;
use std::{env, io, process};

use rustc_cfg::Cfg;

Expand Down Expand Up @@ -50,7 +51,10 @@ fn main() {

let target = env::var("TARGET").unwrap();
let Cfg { ref target_arch, ref target_os, ref target_env, ref target_vendor, .. } =
Cfg::new(&target).unwrap();
Cfg::new(&target).unwrap_or_else(|e| {
writeln!(io::stderr(), "{}", e).ok();
process::exit(1)
});
// NOTE we are going to assume that llvm-target, what determines our codegen option, matches the
// target triple. This is usually correct for our built-in targets but can break in presence of
// custom targets, which can have arbitrary names.
Expand Down