Skip to content

Commit

Permalink
doc/../rust.section.md: prominently mention buildRustXX names
Browse files Browse the repository at this point in the history
This was a source of massive confusion for me when I first learned my way around nixpkgs' rust machinery.  I seek to save others from that confusion.

* `buildRustPackage` should have been named `buildRustPackageUsingCargo`

* `buildRustCrate` should have been named `buildRustPackageUsingNix`

It is, unfortunately, too late to fix this.  Let's do the next best thing and make the names `buildRustPackage` and `buildRustCrate` very prominent in the documentation, so readers see immediately that they need to learn the following jargon:

* `buildRustPackage` means "build this Rust crate by calling `cargo` in one (or two) monolithic derivations"

* `buildRustCrate` means "build this Rust crate by calling `rustc` in one derivation for each crate"
  • Loading branch information
Adam Joseph committed Aug 22, 2022
1 parent 97d1ae9 commit aad7f1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/languages-frameworks/rust.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For other versions such as daily builds (beta and nightly),
use either `rustup` from nixpkgs (which will manage the rust installation in your home directory),
or use a community maintained [Rust overlay](#using-community-rust-overlays).

## Compiling Rust applications with Cargo {#compiling-rust-applications-with-cargo}
## `buildRustPackage`: Compiling Rust applications with Cargo {#compiling-rust-applications-with-cargo}

Rust applications are packaged by using the `buildRustPackage` helper from `rustPlatform`:

Expand Down Expand Up @@ -596,7 +596,7 @@ buildPythonPackage rec {
}
```

## Compiling Rust crates using Nix instead of Cargo {#compiling-rust-crates-using-nix-instead-of-cargo}
## `buildRustCrate`: Compiling Rust crates using Nix instead of Cargo {#compiling-rust-crates-using-nix-instead-of-cargo}

### Simple operation {#simple-operation}

Expand Down

0 comments on commit aad7f1d

Please sign in to comment.