8 releases

0.1.7 Feb 5, 2023
0.1.6 Feb 5, 2023

#214 in Build Utils

Download history 24/week @ 2024-01-08 9/week @ 2024-01-15 78/week @ 2024-01-22 52/week @ 2024-01-29 14/week @ 2024-02-05 77/week @ 2024-02-12 31/week @ 2024-02-19 47/week @ 2024-02-26 122/week @ 2024-03-04 121/week @ 2024-03-11 14/week @ 2024-03-18 12/week @ 2024-03-25 50/week @ 2024-04-01 27/week @ 2024-04-08 19/week @ 2024-04-15

110 downloads per month
Used in cargo-stylus

MIT/Apache

9KB
63 lines

rustc-host

crates.io crates.io

Combined crate (library + binary) for getting the so-called "host triple" of rustc.

Usage as a library

Add this to your Cargo.toml:

[dependencies]
rustc-host = "0.1"

after that you can use it like this:

extern crate rustc_host;

fn main() {
    let host_triple = rustc_host::from_cli()
        .expect("failed to get host triple from rustc");
    println!("host triple: {}", host_triple);
}

Usage as a binary

Installation

cargo install rustc-host

Usage

rustc-host

Example output

x86_64-pc-windows-msvc

Features

  • unsafe - disabled by default, enables unsafe code that reuses the String buffer obtained from rustc -Vv instead of allocating a new one.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~335–800KB
~19K SLoC