Skip to content

Conversation

lsytj0413
Copy link
Contributor

@tillrohrmann propose to add clippy for each features, this will help us catch some errors which will cause compile failed when enable different feature or disable some feature. If you prefer this i will go on, I'm looking forward to receiving your feedback.

Copy link
Contributor

@tillrohrmann tillrohrmann 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 creating this PR @lsytj0413. While your past fixes have shown that we need tooling support for catching compilation problems with using features, I am wondering what the additional costs of cargo hack clippy --each-feature are (added compilation time). If it is negligible then it is ok. If it slows the feedback cycle down, then I am not 100% whether the added safety is worth the slowdown. Maybe a compromise could be to have a clippy-each-feature command which we only run on CI?

@@ -77,7 +77,7 @@ check-fmt:
cargo fmt --all -- --check

clippy: (_target-installed target)
cargo clippy {{ _target-option }} --all-targets --workspace -- -D warnings
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the additional compilation time due to using hack --each-feature on CI and locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hack clippy takes 18 minutes and clippy takes 4 minutes on my computer. If it's too long, maybe we can run hack --each-feature periodically ( per day or per week)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Running it on a daily basis on CI could be a worthwhile compromise indeed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have add an daily workflow, ptal

@lsytj0413 lsytj0413 force-pushed the add-features-clippy-to-ci branch 2 times, most recently from e211383 to a869b1b Compare April 24, 2025 13:05
@lsytj0413 lsytj0413 changed the title WIP: chore: add hach clippy with each feature chore: add hach clippy with each feature May 1, 2025
Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks a lot for updating this PR @lsytj0413. The changes look good to me :-) This will help us to catch changes that break features we have defined in our crates. Thanks a lot 🙏

When running just hack-clippy there are a few errors. I think before we can merge this PR, we need to address them. Do you want to take a stab at them?

Comment on lines 64 to 65
LOCAL_CLUSTER_RUNNER_FORWARD_LOGS: "true"
LOCAL_CLUSTER_RUNNER_RETAIN_TEMPDIR: "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we running tests as part of the hack-clippy command? If not, then these env variables might not be needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, ptal

@lsytj0413 lsytj0413 force-pushed the add-features-clippy-to-ci branch from a869b1b to 13c158e Compare May 18, 2025 12:28
@tillrohrmann
Copy link
Contributor

Sorry for not getting back earlier @lsytj0413. The changes look good. I am currently trying to fix the violations when running just hack-clippy and then I'll merge this PR.

@tillrohrmann tillrohrmann force-pushed the add-features-clippy-to-ci branch 2 times, most recently from 8349c8d to f07e4c0 Compare May 26, 2025 16:12
lsytj0413 and others added 2 commits May 26, 2025 18:12
This is the outcome of running just hack-clippy and making the
build pass.
@tillrohrmann tillrohrmann force-pushed the add-features-clippy-to-ci branch from f07e4c0 to 6dff0f6 Compare May 26, 2025 16:21
@tillrohrmann tillrohrmann merged commit 6dff0f6 into restatedev:main May 26, 2025
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 26, 2025
@lsytj0413 lsytj0413 deleted the add-features-clippy-to-ci branch May 27, 2025 00:40
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