Skip to content

doc/../rust.section.md: prominently mention buildRustXX names#187921

Merged
Artturin merged 1 commit intomasterfrom
unknown repository
Nov 21, 2022
Merged

doc/../rust.section.md: prominently mention buildRustXX names#187921
Artturin merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 22, 2022

Description of changes

This was a source of massive confusion for me when I first learned my way around nixpkgs' rust machinery:

  • buildRustPackage should have been named buildRustCrateUsingCargo

  • buildRustCrate should have been named buildRustCrateUsingNix (or maybe buildRustCrateUsingRustC)

I seek to save others from the confusion I experienced. It is, unfortunately, too late to change these names. 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 memorize 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"

See also: #187919, #187922

Things done

@github-actions github-actions bot added 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 8.has: documentation This PR adds or changes documentation labels Aug 22, 2022
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"
@ghost ghost marked this pull request as ready for review August 22, 2022 21:38
@ghost ghost requested a review from zowoq as a code owner August 22, 2022 21:38
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Aug 22, 2022
@Artturin Artturin merged commit 8021261 into NixOS:master Nov 21, 2022
@ghost ghost deleted the pr/manual/rust/buildRustY branch January 23, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant