Skip to content

doc/../rust.section.md: fix incorrect header depths#187919

Merged
5 commits merged intomasterfrom
unknown repository
Mar 19, 2023
Merged

doc/../rust.section.md: fix incorrect header depths#187919
5 commits merged intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 22, 2022

Description of changes

The headings for the Rust section are structured incorrectly in two ways:

  1. The section "Compiling non-Rust packages that include Rust code" is totally specific to buildRustPackage. It should be a child of the "Compiling Rust applications with Cargo" section.
  2. The section "Setting up nix-shell" is totally specific to buildRustCrate. It should be a child of the "Compiling Rust crates using Nix instead of Cargo" section.
Resulting header outline
# Rust

## `buildRustPackage`: Compiling Rust applications with Cargo
### Importing a `Cargo.lock` file
### Cargo features
### Cross compilation
### Running package tests
#### Tests relying on the structure of the `target/` directory
#### Disabling package-tests
#### Using `cargo-nextest`
#### Setting `test-threads`
### Building a package in `debug` mode
### Custom `build`/`install`-procedures
### Building a crate with an absent or out-of-date Cargo.lock file
### Compiling non-Rust packages that include Rust code
#### Vendoring of dependencies
#### Hooks
#### Examples
#### Python package using `setuptools-rust`
#### Python package using `maturin`

## `buildRustCrate`: Compiling Rust crates using Nix instead of Cargo
### Handling external dependencies
### Options and phases configuration
### Features
### Setting Up `nix-shell`

## Using community maintained Rust toolchains
### Using Rust nightly with `nix-shell`
### Using Rust nightly in a derivation with `buildRustPackage`

See also: #187921, #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
@ghost ghost marked this pull request as ready for review August 22, 2022 21:39
@ghost ghost requested a review from zowoq as a code owner August 22, 2022 21:39
@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
@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 2, 2023

Resolved merge conflict.

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 10, 2023

Rebased.

@ghost ghost requested review from figsoda and winterqt as code owners March 10, 2023 06:24
@ghost ghost requested review from figsoda and removed request for winterqt and zowoq March 11, 2023 05:01
@figsoda
Copy link
Copy Markdown
Member

figsoda commented Mar 11, 2023

I'm still a bit unsure about this change

  • There is no "Compiling Rust crates using Nix instead of Cargo", and now all sections are under buildRustPackage
  • IMO it makes sense for "Compiling non-Rust packages that include Rust code" to be in its own section, as it is not part of buildRustPackage
  • Despite mentioning buildRustCrate, "Setting up nix-shell" doesn't seem to be specific to buildRustCrate, and should
  • Same for "Using community maintained Rust toolchains", it probably shouldn't be part of buildRustPackage or buildRustCrate sections

Adam Joseph added 2 commits March 15, 2023 19:41
…tion.md

This reverts the part of commit
82fe76d that affected
doc/languages-frameworks/rust.section.md
The headings for the Rust section are structured incorrectly in two ways:

1. The section "Compiling non-Rust packages that include Rust code" is totally specific to `buildRustPackage`.  It should be a child of the "Compiling Rust applications with Cargo" section.
1. The section "Setting up `nix-shell`" is totally specific to `buildRustCrate`.  It should be a child of the "Compiling Rust crates using Nix instead of Cargo" section.

- Rust
  - Compiling Rust applications with Cargo
    - ...
  - Compiling non-Rust packages that include Rust code
    - ...
  - Compiling Rust crates using Nix instead of Cargo
    - ...
  - Setting Up `nix-shell`
    - ...

- Rust
  - Compiling Rust applications with Cargo
    - ...
    - Compiling non-Rust packages that include Rust code
      - ...
  - Compiling Rust crates using Nix instead of Cargo
    - ...
    - Setting Up `nix-shell`
      - ...
@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 16, 2023

Yeah, #202394 deleted the documentation section for buildRustCrate. I need to rewrite this PR now.

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 16, 2023

(moved to topmost comment)

Adam Joseph and others added 2 commits March 17, 2023 19:09
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 17, 2023

I've simply deleted the section which tried to replicate the crate2nix documentation.

crate2nix exists outside of nixpkgs, so we shouldn't try to replicate its documentation; we should link to it.

buildRustCrate is part of nixpkgs, so that's what we should document.

@ghost ghost requested a review from Mic92 March 17, 2023 19:20
@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 17, 2023

Note: this PR was just supposed to fix the header depths. I feel like this PR has been dragged into dealing with the whole carnix/crate2nix thing solely because of the merge conflict created by #202394

@ghost ghost merged commit 812b74c into NixOS:master Mar 19, 2023
@ghost ghost deleted the pr/manual/rust/buildRustX branch March 19, 2023 09:30
This pull request was closed.
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.

2 participants