{"id":15659800,"url":"https://github.com/volks73/cargo-rustc-cfg","last_synced_at":"2025-03-30T02:44:57.890Z","repository":{"id":57538343,"uuid":"316789741","full_name":"volks73/cargo-rustc-cfg","owner":"volks73","description":"A Rust crate for parsing the output from the `cargo rustc --print cfg` command","archived":false,"fork":false,"pushed_at":"2021-10-12T17:06:37.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T21:15:00.785Z","etag":null,"topics":["cargo","rust","rust-crate","rustc"],"latest_commit_sha":null,"homepage":"https://docs.rs/cargo-rustc-cfg","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/volks73.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-28T17:46:38.000Z","updated_at":"2021-10-12T17:06:40.000Z","dependencies_parsed_at":"2022-09-07T17:35:31.748Z","dependency_job_id":null,"html_url":"https://github.com/volks73/cargo-rustc-cfg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volks73%2Fcargo-rustc-cfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volks73%2Fcargo-rustc-cfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volks73%2Fcargo-rustc-cfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volks73%2Fcargo-rustc-cfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/volks73","download_url":"https://codeload.github.com/volks73/cargo-rustc-cfg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246269911,"owners_count":20750319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","rust","rust-crate","rustc"],"created_at":"2024-10-03T13:19:11.829Z","updated_at":"2025-03-30T02:44:57.865Z","avatar_url":"https://github.com/volks73.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-rustc-cfg\n\nThis crate currently needs the nightly toolchain. See the [tracking issue] for\nstabilization.\n\nA Rust library (crate) that runs the `cargo rustc --print cfg` command and\nparses the output. This is inspired by the [rustc-cfg] crate, which runs the\n`rustc --print cfg` command and parses the output, but it does not take into\naccount any flags or configurations passed from [Cargo] to the [Rust compiler\n(rustc)] when building a project using Cargo. For example, if the `RUSTFLAGS`\nenvironment variable is used to add a target feature, i.e.\n`RUSTFLAGS=\"-C target-feature=+crt-static`, then the `rustc --print cfg` command\nwill not list the added target feature in its output because the `RUSTFLAGS`\nenvironment variable is managed by Cargo. However, the `cargo rustc --print cfg`\nwill list the added target feature in its output. This crate is useful for\ndeveloping [third-party] [Cargo custom subcommands] that need compiler\nconfiguration information. This crate is _not_ recommended for [build scripts].\n\n[![Crates.io](https://img.shields.io/crates/v/cargo-rustc-cfg.svg)](https://crates.io/crates/cargo-rustc-cfg)\n[![GitHub release](https://img.shields.io/github/release/volks73/cargo-rustc-cfg.svg)](https://github.com/volks73/cargo-rustc-cfg/releases)\n[![Crates.io](https://img.shields.io/crates/l/cargo-rustc-cfg.svg)](https://github.com/volks73/cargo-rustc-cfg#license)\n[![Build Status](https://github.com/volks73/cargo-rustc-cfg/workflows/CI/badge.svg)](https://github.com/volks73/cargo-rustc-cfg/actions)\n![Rust: 1.51.0+](https://img.shields.io/badge/rust-1.51.0%2B-yellow)\n![Rust: nightly](https://img.shields.io/badge/rust-nightly-red)\n\n[rustc-cfg]: https://crates.io/crates/rustc-cfg\n[cargo]: http://doc.crates.io\n[rust compiler (rustc)]: https://doc.rust-lang.org/rustc/index.html\n[third-party]: https://github.com/rust-lang/cargo/wiki/Third-party-cargo-subcommands\n[cargo custom subcommands]: https://doc.rust-lang.org/1.30.0/cargo/reference/external-tools.html#custom-subcommands\n[build scripts]: https://doc.rust-lang.org/cargo/reference/build-scripts.html\n[tracking issue]: https://github.com/rust-lang/cargo/issues/9357\n\n## Quick Start\n\n**Note**, this crate currently needs the [nightly toolchain](https://github.com/rust-lang/cargo/issues/9357).\n\n```rust\nuse cargo_rustc_cfg;\n\nlet host = cargo_rustc_cfg::host()?;\nprintln(\"{:?}\", host);\n```\n\n## Installation\n\nAdd the following to a package's manifest (Cargo.toml):\n\n```toml\ncargo-rustc-cfg = \"0.3\"\n```\n\nIf using the [Rust 2015 Edition], then also add the following to the `lib.rs` or `main.rs` source file:\n\n```rust\nextern crate cargo_rustc_cfg;\n```\n\n[rust 2015 edition]: https://doc.rust-lang.org/stable/edition-guide/rust-2015/index.html\n\n## Tests\n\nTests are run using the `cargo test` command. Currently, only [documentation\ntests] are implemented because for a relatively simple, small library these\nprovide enough coverage. If the default toolchain is `stable` but the `nightly`\ntoolchain is installed, the `cargo +nightly test` command can be used without\nhaving to switch the default toolchain.\n\n[documentation tests]: https://doc.rust-lang.org/rustdoc/documentation-tests.html\n\n## License\n\nThe `cargo-rustc-cfg` project is licensed under either the [MIT license] or\nthe [Apache 2.0 license]. See the [LICENSE-MIT] or [LICENSE-APACHE] files for\nmore information about licensing and copyright.\n\n[mit license]: https://opensource.org/licenses/MIT\n[apache 2.0 license]: http://www.apache.org/licenses/LICENSE-2.0\n[license-mit]: https://github.com/volks73/cargo-rustc-cfg/blob/master/LICENSE-MIT\n[license-apache]: https://github.com/volks73/cargo-rustc-cfg/blob/master/LICENSE-APACHE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolks73%2Fcargo-rustc-cfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolks73%2Fcargo-rustc-cfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolks73%2Fcargo-rustc-cfg/lists"}