I'd like to be able to run cargo clippy in buildDepsOnly without it exiting early due to warnings/errors in the dummy file. The PR adds #![allow(clippy::all)] to the dummy file.
Why?
It can be tricky to get optimal cargo artifact cache reuse between a custom mkCargoDerivation and buildDepsOnly. Especially when you're trying to hide the low level crane/nix details and expose a simple caching interface for CI.
What I've ended up doing is to simply run the exact same cargo command first in buildDepsOnly and then mkCargoDerivation. This guarantees that everything will be built the exact same way without having to keep all the flags (--workspace, --all-targets, --features, etc.) in sync between the cargoArtifacts and the final derivation.
Checklist
[ ] added tests to verify new behavior
[ ] added an example template or updated an existing one
[ ] updated docs/API.md (or general documentation) with changes
Motivation
I'd like to be able to run
cargo clippy
inbuildDepsOnly
without it exiting early due to warnings/errors in the dummy file. The PR adds#![allow(clippy::all)]
to the dummy file.Why?
It can be tricky to get optimal cargo artifact cache reuse between a custom
mkCargoDerivation
andbuildDepsOnly
. Especially when you're trying to hide the low level crane/nix details and expose a simple caching interface for CI.What I've ended up doing is to simply run the exact same cargo command first in
buildDepsOnly
and thenmkCargoDerivation
. This guarantees that everything will be built the exact same way without having to keep all the flags (--workspace
,--all-targets
,--features
, etc.) in sync between thecargoArtifacts
and the final derivation.Checklist
docs/API.md
(or general documentation) with changesCHANGELOG.md