Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build warning, fail CI if build has warnings #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

projectgus
Copy link
Contributor

  • Fix a build warning that snuck in with Added impl serde #67 (unused Result).
  • Configure CI to fail if the build step produces any warnings.

Copy link
Member

@killercup killercup left a comment

Choose a reason for hiding this comment

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

I think we can get away without using a feature for this

@@ -51,7 +51,7 @@ jobs:
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build --all --verbose
run: cargo build --all --verbose --features strict
Copy link
Member

Choose a reason for hiding this comment

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

The feature is a neat idea but why not just -D warnings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question... I originally implemented this by setting RUSTFLAGS=-D warnings and it looked like it built all of the dependencies with -D warnings too. (Then I copied the feature approach from here).

I didn't try passing -D directly to cargo though, I will try this and get back to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, sorry for the long turnaround on following this up!

The best summary I've found (with links to some other resources) is the thread linked in the previous comment https://users.rust-lang.org/t/how-to-fail-a-build-with-warnings/2687

@projectgus
Copy link
Contributor Author

Have rebased this as still think it's potentially useful. As per discussion above I don't know of a neater way to enable this only in CI, but not enable it for dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants