8 releases

0.1.7 Feb 5, 2023
0.1.6 Feb 5, 2023

#328 in Build Utils

Download history 115/week @ 2024-07-27 109/week @ 2024-08-03 297/week @ 2024-08-10 319/week @ 2024-08-17 298/week @ 2024-08-24 204/week @ 2024-08-31 162/week @ 2024-09-07 76/week @ 2024-09-14 98/week @ 2024-09-21 78/week @ 2024-09-28 83/week @ 2024-10-05 126/week @ 2024-10-12 211/week @ 2024-10-19 175/week @ 2024-10-26 203/week @ 2024-11-02 68/week @ 2024-11-09

663 downloads per month
Used in 4 crates (3 directly)

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

~260–720KB
~17K SLoC