Skip to content
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
merged 2 commits into from
Aug 18, 2023
Merged

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented Aug 17, 2023

We ran into an interesting situation with #151 where the CI succeeded despite our Cargo.toml not correctly specifying the winerror feature for winapi. --- ( Cargo.toml was fixed by #153. )

This happened because some of our dev dependencies enable the winerror feature of winapi. This can be seen by comparing cargo tree -e features vs cargo 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 did cargo test or cargo 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.

@xStrom
Copy link
Member Author

xStrom commented Aug 17, 2023

I also disabled the CI for main pushes. Direct pushes to main are not allowed anyway, but previously there was the benefit of having the green checkmark next to commits when looking at the history. Merge queues graduated to general availability last month and it looks like one of the changes is that the merge queue checks are now displayed in the history too. So now we not only run the CI twice per merge, but also display both results. Hence the removal.

@xStrom xStrom marked this pull request as ready for review August 17, 2023 21:50
Copy link
Contributor

@waywardmonkeys waywardmonkeys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out. That also explains why it had worked for me locally. (I'd done a build of all targets.)

I thought I was going insane when it suddenly stopped working.

@xStrom xStrom added this pull request to the merge queue Aug 18, 2023
Merged via the queue into linebender:main with commit 6dd0474 Aug 18, 2023
7 checks passed
@xStrom xStrom deleted the fixci branch August 18, 2023 19:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants