Skip to content
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
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ enum ErrorKind {
ToolFamilyMacroNotFound,
/// Invalid target.
InvalidTarget,
/// Unknown target.
UnknownTarget,
/// Invalid rustc flag.
InvalidFlag,
#[cfg(feature = "parallel")]
Expand Down Expand Up @@ -3979,7 +3981,7 @@ impl Default for Build {
}

fn fail(s: &str) -> ! {
eprintln!("\n\nerror occurred: {}\n\n", s);
eprintln!("\n\nerror occurred in cc-rs: {}\n\n", s);
std::process::exit(1);
}

Expand Down
16 changes: 14 additions & 2 deletions src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,20 @@ impl FromStr for TargetInfo<'_> {
Ok(info.clone())
} else {
Err(Error::new(
ErrorKind::InvalidTarget,
format!("unknown target `{target_triple}`"),
ErrorKind::UnknownTarget,
format!(
"unknown target `{target_triple}`.

NOTE: `cc-rs` only supports a fixed set of targets when not in a build script.
- If adding a new target, you will need to fork of `cc-rs` until the target
has landed on nightly and the auto-generated list has been updated. See also
the `rustc` dev guide on adding a new target:
https://rustc-dev-guide.rust-lang.org/building/new-target.html
- If using a custom target, prefer to upstream it to `rustc` if possible,
otherwise open an issue with `cc-rs`:
https://github.com/rust-lang/cc-rs/issues/new
"
),
))
}
}
Expand Down
Loading