{"id":16889383,"url":"https://github.com/dcbaker/toml-describe","last_synced_at":"2025-03-20T07:17:43.289Z","repository":{"id":205171556,"uuid":"713586274","full_name":"dcbaker/toml-describe","owner":"dcbaker","description":"Crate for describing common checks from build.rs in Cargo.toml instead","archived":false,"fork":false,"pushed_at":"2024-10-07T17:43:24.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T08:27:38.208Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcbaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-11-02T20:30:01.000Z","updated_at":"2024-10-07T17:43:28.000Z","dependencies_parsed_at":"2023-11-07T02:01:05.290Z","dependency_job_id":"536067ad-ebaa-4944-a28a-10056b1e9cbd","html_url":"https://github.com/dcbaker/toml-describe","commit_stats":null,"previous_names":["dcbaker/toml-describe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbaker%2Ftoml-describe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbaker%2Ftoml-describe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbaker%2Ftoml-describe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcbaker%2Ftoml-describe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcbaker","download_url":"https://codeload.github.com/dcbaker/toml-describe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244566948,"owners_count":20473451,"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":[],"created_at":"2024-10-13T16:57:00.736Z","updated_at":"2025-03-20T07:17:43.269Z","avatar_url":"https://github.com/dcbaker.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toml Describe\n\nToml-describe is a rust crate to allow describing feature checks in toml, instead of open coding them in build.rs. It achieves this by providing a simple entry point to add to your build.rs, and then you describe the environment in your Cargo.toml.\n\n## Usage\n\nAdd this snippet to your build.rs:\n```rs\nextern crate toml_describe;\n\nfn main() {\n    toml_describe::evaluate();\n}\n```\n\n### Compiler checked CFGs\n\nThese are added to Toml in the format\n\n```toml\n[package.metadata.toml_describe.compiler_checks.CFG_NAME]\nversion = \"1.75\"\nnightly_version = \"1.60\"\n```\n\nUsing `version` will set the cfg if the compiler is at least the given version, `nightly_version` will return tru if the compiler is `nightly` and the compiler has at least that version. If both `version` and `nightly_version` are set, then the condition is true if either check succeeds.\n\n```toml\n[package.metadata.toml_describe.compiler_checks]\nCFG_NAME = { can_compile = \"fn function() -\u003e bool { false }\" }\n```\n\nWill cause the compiler to be invoked to compile the given code snippet. If it can be compiled then the cfg will be enabled, otherwise it wont.\n\nIf both versions and compiler checks are provided, then both must be true for the cfg to be emitted.\n\n### Allowed CFGS\n\nThese are sent to cargo for use with the `-Z cfg-check` option. options are in the form `cfg = [...\u003callowed values\u003e]`. If the CFG does not have allowed values, it should be an empty list\n\n```toml\n[package.metadata.toml_describe.allowed_cfgs]\nuse_foo = []\nfoo_backend = [\"unix\", \"windows\"]\n```\n\nWith the correct flags, rustc will then warn about CFGS that are not defined, or values to those cfgs that are not in the allowed value set.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcbaker%2Ftoml-describe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcbaker%2Ftoml-describe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcbaker%2Ftoml-describe/lists"}