Unconditionally cap Rust lints at warn#561
Conversation
WalkthroughA global macro was added in mockbuild_test/stratisd.spec to append a Rust compiler flag (--cap-lints=warn) to the build_rustflags used during the build process. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This will allow compilation to proceed when a new release of Rust introduces a new compiler lint. Signed-off-by: mulhern <amulhern@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
mockbuild_test/stratisd.spec (1)
6-7: Verify that capping lints aligns with CI objectives and consider documenting the rationale.The
--cap-lints=warnflag prevents any Rust lint from failing compilation, which may mask issues that would normally block the build. While this is a common practice in CI environments to ensure builds succeed across different Rust versions with varying lint strictness, it could allow code with potential issues to be built.Since this is in the
mockbuild_testdirectory and the spec explicitly states "This package should not be used in production," this approach appears reasonable for testing/CI purposes. However, consider the following:
- Add a comment explaining why lints are capped (e.g., "Cap lints to prevent CI failures from new Rust versions with stricter lints")
- Verify that production builds (if any exist separately) do not use this flag
- Ensure that lint warnings are still visible in CI output for developers to review
Apply this diff to add a clarifying comment:
+# Cap lints at warn to prevent CI build failures from stricter lints in newer Rust versions %global build_rustflags %{build_rustflags} --cap-lints=warn
No description provided.