This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
Split CI clippy
into main & auxiliary steps.
#155
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We ran into an interesting situation with #151 where the CI succeeded despite our
Cargo.toml
not correctly specifying thewinerror
feature forwinapi
. --- (Cargo.toml
was fixed by #153. )This happened because some of our dev dependencies enable the
winerror
feature ofwinapi
. This can be seen by comparingcargo tree -e features
vscargo tree -e features -e no-dev
.Looking deeper, this happened because
cargo
builds with dev dependencies if any of--tests
/--benches
/--examples
are enabled. This was always the case for us, as we either didcargo test
orcargo clippy --all-targets
.This issue has bitten us before too, just this year. Back in April we received a bug report for Druid (druid#2373) that a simple hello world type app won't compile. The same story there, the CI always ran with dev dependencies enabled. I concluded back then: Seems like a shortcoming of our testing methodology that it always builds with dev dependencies. Something to look into. Looking into it is probably somewhere in my mountain of todo tasks but obviously I didn't get to it fast enough for the issue to not repeat.
This PR here addresses that shortcoming. We split
clippy
into two steps. That is,--all-targets
becomes--lib --bins
and also--tests --benches --examples
. This will increase the CI runtime a bit but there's just no way around that. Tests require dev dependencies, however we don't want those enabled for the main checks.