Rust: Difference between revisions

m To Windows via a cargo plugin:: fix example to show that using a target is required
Kiri (talk | contribs)
m Format table so the header is clearly distinguished from the rest of the rows.
 
(2 intermediate revisions by 2 users not shown)
Line 37: Line 37:


== Installating with bindgen support ==
== Installating with bindgen support ==
By default crates using <code>bindgen</code> will not compile. To add bindegen support add the <code>rustPlatform.bindegenHook</code> to your <code>nativeBuildInputs</code>.
By default crates using <code>bindgen</code> will not compile. To add bindgen support add the <code>rustPlatform.bindgenHook</code> to your <code>nativeBuildInputs</code>.


Here's an example <code>shell.nix</code>:
Here's an example <code>shell.nix</code>:
Line 227: Line 227:
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:
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:


{|
{| class="wikitable" style="margin:auto"
| Name
| Cargo.lock solution
| Derivations
| Build logic
| Supports cross
| Notes
|-
|-
| [https://github.com/NixOS/nixpkgs/blob/4fc53b59aecbc25c0e173163d60155f8fca14bfd/doc/languages-frameworks/rust.section.md <code>buildRustPackage</code>]
! Name !! Cargo.lock solution !! Derivations !! Build logic !! Supports cross !! Notes
|-
| <code>[https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md buildRustPackage]</code>
| Checksum
| Checksum
| 1
| 1