Rust: Difference between revisions
imported>Torhovland cargo2nix uses cargo + custom, and the custom logic is not written in Nix (it generates Nix). |
imported>Torhovland Added crane and dream2nix. |
||
Line 177: | Line 177: | ||
== Packaging Rust projects with nix == | == Packaging Rust projects with nix == | ||
At the time of writing, there are now no less than | At the time of writing, there are now no less than 8 different solutions for building Rust code with Nix. In the following table they are compared: | ||
{| | {| | ||
Line 228: | Line 228: | ||
| Unclear | | Unclear | ||
| More of a proof of concept than a full working solution | | More of a proof of concept than a full working solution | ||
|- | |||
| [https://github.com/ipetkov/crane <code>crane</code>] | |||
| Import | |||
| 2 | |||
| cargo | |||
| [https://github.com/ipetkov/crane/tree/master/examples Yes] | |||
| Inspired by naersk, with [https://discourse.nixos.org/t/introducing-crane-composable-and-cacheable-builds-with-cargo/17275/4 better support for composing Cargo invocations as completely separate derivations] | |||
|- | |||
| [https://github.com/nix-community/dream2nix/blob/main/docs/src/subsystems/rust.md <code>dream2nix</code>] | |||
| Codegen | |||
| 1 or 2 | |||
| <code>buildRustPackage</code> or <code>crane</code> | |||
| Yes | |||
| A framework for unifying 2nix converters across languages | |||
|} | |} | ||