{"id":15994692,"url":"https://github.com/taiki-e/cargo-config2","last_synced_at":"2025-04-13T08:19:31.861Z","repository":{"id":65190701,"uuid":"586758958","full_name":"taiki-e/cargo-config2","owner":"taiki-e","description":"Load and resolve Cargo configuration.","archived":false,"fork":false,"pushed_at":"2025-03-20T17:52:35.000Z","size":612,"stargazers_count":13,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T08:19:14.929Z","etag":null,"topics":["cargo","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/cargo-config2","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/taiki-e.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"taiki-e"}},"created_at":"2023-01-09T06:48:55.000Z","updated_at":"2025-03-20T17:52:39.000Z","dependencies_parsed_at":"2023-01-09T13:03:04.735Z","dependency_job_id":"32d700f1-b9ef-47b3-831b-fae635b8d024","html_url":"https://github.com/taiki-e/cargo-config2","commit_stats":{"total_commits":81,"total_committers":4,"mean_commits":20.25,"dds":0.03703703703703709,"last_synced_commit":"6188f7a7218be1fe89b67652a8f9a7264e2fe60d"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-config2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-config2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-config2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-config2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taiki-e","download_url":"https://codeload.github.com/taiki-e/cargo-config2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681565,"owners_count":21144708,"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"],"created_at":"2024-10-08T07:09:50.846Z","updated_at":"2025-04-13T08:19:31.828Z","avatar_url":"https://github.com/taiki-e.png","language":"Rust","funding_links":["https://github.com/sponsors/taiki-e"],"categories":[],"sub_categories":[],"readme":"# cargo-config2\n\n[![crates.io](https://img.shields.io/crates/v/cargo-config2?style=flat-square\u0026logo=rust)](https://crates.io/crates/cargo-config2)\n[![docs.rs](https://img.shields.io/badge/docs.rs-cargo--config2-blue?style=flat-square\u0026logo=docs.rs)](https://docs.rs/cargo-config2)\n[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license)\n[![msrv](https://img.shields.io/badge/msrv-1.70-blue?style=flat-square\u0026logo=rust)](https://www.rust-lang.org)\n[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/cargo-config2/ci.yml?branch=main\u0026style=flat-square\u0026logo=github)](https://github.com/taiki-e/cargo-config2/actions)\n\n\u003c!-- tidy:sync-markdown-to-rustdoc:start:src/lib.rs --\u003e\n\nLoad and resolve [Cargo configuration](https://doc.rust-lang.org/nightly/cargo/reference/config.html).\n\nThis library is intended to accurately emulate the actual behavior of Cargo configuration, for example, this supports the following behaviors:\n\n- [Hierarchical structure and merge](https://doc.rust-lang.org/nightly/cargo/reference/config.html#hierarchical-structure)\n- [Environment variables](https://doc.rust-lang.org/nightly/cargo/reference/config.html#environment-variables) and [relative paths](https://doc.rust-lang.org/nightly/cargo/reference/config.html#config-relative-paths) resolution.\n- `target.\u003ctriple\u003e` and `target.\u003ccfg\u003e` resolution.\n\nSupported tables and fields are mainly based on [cargo-llvm-cov](https://github.com/taiki-e/cargo-llvm-cov)'s use cases, but feel free to submit an issue if you see something missing in your use case.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\ncargo-config2 = \"0.1\"\n```\n\n`cargo-config2` is usually runnable with Cargo versions older than the Rust version required for build. (e.g., a cargo subcommand using `cargo-config2` could work with older versions such as `cargo +1.59 \u003csubcommand\u003e`.)\n\n## Examples\n\n```rust\n// Read config files hierarchically from the current directory, merge them,\n// apply environment variables, and resolve relative paths.\nlet config = cargo_config2::Config::load().unwrap();\nlet target = \"x86_64-unknown-linux-gnu\";\n// Resolve target-specific configuration (`target.\u003ctriple\u003e` and `target.\u003ccfg\u003e`),\n// and returns the resolved rustflags for `target`.\nlet rustflags = config.rustflags(target).unwrap();\nprintln!(\"{rustflags:?}\");\n```\n\nSee also the [`get` example](https://github.com/taiki-e/cargo-config2/blob/HEAD/examples/get.rs) that partial re-implementation of `cargo config get` using cargo-config2.\n\n\u003c!-- tidy:sync-markdown-to-rustdoc:end --\u003e\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or\n[MIT license](LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n### Third party software\n\nThis product includes copies and modifications of software developed by third parties:\n\n- [`src/cfg_expr`](https://github.com/taiki-e/cargo-config2/tree/HEAD/src/cfg_expr) includes copies and modifications of [`cfg-expr` crate](https://github.com/EmbarkStudios/cfg-expr) by Embark Studios, licensed under \"Apache-2.0 OR MIT\".\n\nSee the license files included in these directories for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fcargo-config2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaiki-e%2Fcargo-config2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fcargo-config2/lists"}