Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargoDoc: do not install cargo artifacts by default #381

Merged
merged 2 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
`Cargo.lock` is exactly what is expected (without implicit changes at build
time) but this may end up rejecting builds which were previously passing. To
get the old behavior back, set `cargoExtraArgs = "";`
* Fixed a bug when testing proc macro crates with `cargoNextest` on macO. ([#376](https://github.com/ipetkov/crane/pull/376))
* **Breaking**: `cargoDoc` will no longer install cargo artifacts by default.
Set `doInstallCargoArtifacts = true;` to get the old behavior back.
* `cargoDoc` will now install generated documentation in `$out/share/doc`
* Fixed a bug when testing proc macro crates with `cargoNextest` on macOS.
([#376](https://github.com/ipetkov/crane/pull/376))

## [0.13.1] - 2023-08-22

Expand Down
1 change: 1 addition & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ Except where noted below, all derivation attributes are delegated to
- `CARGO_PROFILE` can be set on the derivation to alter which cargo profile
is selected; setting it to `""` will omit specifying a profile
altogether.
* `doInstallCargoArtifacts` will default to `false` if not specified
* `pnameSuffix` will be set to `"-doc"`

#### Required attributes
Expand Down
9 changes: 9 additions & 0 deletions lib/cargoDoc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@ mkCargoDerivation (args // {
pnameSuffix = "-doc";

buildPhaseCargoCommand = "cargoWithProfile doc ${cargoExtraArgs} ${cargoDocExtraArgs}";

doInstallCargoArtifacts = args.doInstallCargoArtifacts or false;

# NB: cargo always places docs at the root of the target directory
# even when building in release mode
installPhaseCommand = ''
mkdir -p $out/share
mv "''${CARGO_TARGET_DIR:-target}/doc" $out/share
'';
})