{"id":15623210,"url":"https://github.com/kobzol/cargo-wizard","last_synced_at":"2025-04-08T08:12:14.309Z","repository":{"id":227035997,"uuid":"766550230","full_name":"Kobzol/cargo-wizard","owner":"Kobzol","description":"Cargo subcommand for configuring Cargo projects for best performance.","archived":false,"fork":false,"pushed_at":"2024-04-07T19:22:32.000Z","size":605,"stargazers_count":792,"open_issues_count":5,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-01T05:33:35.057Z","etag":null,"topics":["cargo","rust"],"latest_commit_sha":null,"homepage":"","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/Kobzol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-03-03T15:21:27.000Z","updated_at":"2025-03-30T20:33:41.000Z","dependencies_parsed_at":"2024-10-30T10:41:37.413Z","dependency_job_id":null,"html_url":"https://github.com/Kobzol/cargo-wizard","commit_stats":{"total_commits":127,"total_committers":2,"mean_commits":63.5,"dds":0.4330708661417323,"last_synced_commit":"ac227bdf84fb7457ae7093b3b765337a15ccc532"},"previous_names":["kobzol/cargo-wizard"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kobzol%2Fcargo-wizard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kobzol%2Fcargo-wizard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kobzol%2Fcargo-wizard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kobzol%2Fcargo-wizard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kobzol","download_url":"https://codeload.github.com/Kobzol/cargo-wizard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801170,"owners_count":20998339,"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-03T09:56:48.583Z","updated_at":"2025-04-08T08:12:14.282Z","avatar_url":"https://github.com/Kobzol.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-wizard [![Build Status]][actions] [![Latest Version]][crates.io]\n\n[Build Status]: https://github.com/kobzol/cargo-wizard/actions/workflows/check.yml/badge.svg\n\n[actions]: https://github.com/kobzol/cargo-wizard/actions?query=branch%3Amain\n\n[Latest Version]: https://img.shields.io/crates/v/cargo-wizard.svg\n\n[crates.io]: https://crates.io/crates/cargo-wizard\n\nCargo subcommand that applies [profile](https://doc.rust-lang.org/cargo/reference/profiles.html)\nand [config](https://doc.rust-lang.org/cargo/reference/config.html#configuration-format) templates to your Cargo project\nto configure it for maximum performance, fast compile times or minimal binary size.\n\n![Demo of cargo-wizard](img/wizard-demo.gif)\n\n## Motivation\nI often see Rust users asking online about how can they best configure Cargo get e.g. the fastest compilation times,\nbest\nruntime performance or minimal binary size. While this information can be found in\nvarious [books](https://nnethercote.github.io/perf-book/build-configuration.html), [repositories](https://github.com/johnthagen/min-sized-rust)\nor [blog posts](https://kobzol.github.io/rust/rustc/2023/10/21/make-rust-compiler-5percent-faster.html), it is annoying\nto hunt for it everytime we want to configure a new Cargo project.\n\nThis tool tries to automate that process to make it easier.\n\n## Installation\n\n```bash\n$ cargo install cargo-wizard\n```\n\n## Usage\n\n- Interactive mode (CLI dialog that guides you through the process):\n    ```bash\n    $ cargo wizard\n    ```\n- Non-interactive mode (directly apply a predefined template to your Cargo workspace):\n    ```bash\n    $ cargo wizard apply \u003ctemplate\u003e \u003cprofile\u003e\n    # For example, apply `fast-runtime` template to the `dist` profile\n    $ cargo wizard apply fast-runtime dist\n    ```\n\nYou can enable additional configuration options that require a nightly compiler by running `cargo-wizard` with a\nnightly Cargo (e.g. `cargo +nightly wizard`) or by using the `--nightly` flag.\n\nNote that you should be executing `cargo wizard` inside a directory that is a part of a Cargo workspace. It will then\napply the configuration options to that workspace.\n\n## Features\n`cargo-wizard` can create or modify Cargo profiles in your `Cargo.toml` manifest and RUSTFLAGS in\nthe [`.cargo/config.toml`](https://doc.rust-lang.org/cargo/reference/config.html#configuration-format) file, based on a\nset of predefined templates:\n\n- `fast-compile` - minimizes compilation times\n    - Disables debuginfo generation and uses a faster linker.\n    - In nightly mode, it also enables\n      the [Cranelift codegen backend](https://nnethercote.github.io/perf-book/build-configuration.html#cranelift-codegen-back-end)\n      and\n      the [parallel frontend](https://nnethercote.github.io/perf-book/build-configuration.html#experimental-parallel-front-end).\n- `fast-runtime` - maximizes runtime performance\n    - Enables [LTO](https://doc.rust-lang.org/cargo/reference/profiles.html#lto) and other settings designed to maximize\n      runtime performance.\n- `min-size` - minimizes binary size\n    - Similar to `fast-runtime`, but uses optimization flags designed for small binary size.\n\nYou can also modify these templates in the interactive mode to build your own custom template.\n\n### Caveats\n\n- The configuration applied by this tool is quite opinionated and might not fit all use-cases\n  perfectly. `cargo-wizard` mostly serves to improve *discoverability* of possible Cargo profile and config options, to\n  help you find the ideal settings for your use-cases.\n- `cargo-wizard` currently only modifies `Cargo.toml` and `config.toml`. There are other things that can be configured\n  to achieve e.g. even smaller binaries, but these are out of scope for this tool, at least at the moment.\n- `cargo-wizard` currently ignores Cargo settings that are not relevant to performance.\n- Cargo config (`config.toml`) changes are applied to the global `build.hostflags` setting, because per-profile\n  RUSTFLAGS are still [unstable](https://github.com/rust-lang/cargo/issues/10271).\n\n## Inspiration\n\n- [Min-sized Rust](https://github.com/johnthagen/min-sized-rust)\n- [The Rust Performance Book](https://nnethercote.github.io/perf-book/build-configuration.html)\n\n\u003e Why `wizard`? The name is inspired by\n\u003e GUI [wizards](https://documentation.softwareag.com/natural/nat913win/edis/edis_win_dia_wiz.htm) that guide you through\n\u003e some process using a series of dialogs.\n\n## Contributing\nContributions are welcome :)\n\nPossible future features:\n\n- [ ] Allow configuring\n  the [memory allocator](https://nnethercote.github.io/perf-book/build-configuration.html#alternative-allocators).\n- [ ] Load/store templates on disk to make them easier to share\n\n## Acknowledgements\n\n- [`toml_edit`](https://docs.rs/toml_edit/latest/toml_edit/): awesome crate that can modify TOML files while keeping\n  their original formatting.\n- [`inquire`](https://github.com/mikaelmello/inquire): pretty slick crate for building interactive TUI dialogs and\n  prompts.\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkobzol%2Fcargo-wizard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkobzol%2Fcargo-wizard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkobzol%2Fcargo-wizard/lists"}