Skip to content

Commit

Permalink
doc: Document disabling cargo phases in Rust builds
Browse files Browse the repository at this point in the history
Since 042adf0 ("cargo/hooks: allow hooks to be disabled"), it is possible
to disable the default cargo hooks. This allows to switch back to the default
phases from stdenv. This can be useful to package projects that rely on
Makefiles.
  • Loading branch information
skyfmmf committed Aug 3, 2023
1 parent d29508c commit 73b2384
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/languages-frameworks/rust.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,13 @@ In this scenario, the `checkPhase` will be ran in `debug` mode as well.

Some packages may use custom scripts for building/installing, e.g. with a `Makefile`.
In these cases, it's recommended to override the `buildPhase`/`installPhase`/`checkPhase`.

Otherwise, some steps may fail because of the modified directory structure of `target/`.

If you want to run targets from a `Makefile`, instead of overriding the phases,
you can set `dontCargoBuild`/`dontCargoInstall`/`dontCargoCheck` to `true` to
use the [default phases from `stdenv`](#sec-stdenv-phases), which execute make
targets and can be controlled by various variables in the derivation.

### Building a crate with an absent or out-of-date Cargo.lock file {#building-a-crate-with-an-absent-or-out-of-date-cargo.lock-file}

`buildRustPackage` needs a `Cargo.lock` file to get all dependencies in the
Expand Down

0 comments on commit 73b2384

Please sign in to comment.