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

Deny warnings in CI #1877

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Conversation

jessebraham
Copy link
Member

Whew, this was a bit more challenging to figure out than expected 😅

Largely, the issue was that RUSTFLAGS are not cumulative, so it's not as simple as just specifying RUSTFLAGS=-Dwarnings, as this stomps out the configuration needed to actually build the HAL.

Thankfully I found a comment in a Cargo issue showing a workaround, which is to set the target-specific RUSTFLAGS, which are cumulative.

I was then able to use some bash-foo to transform the kebab-case target triple into SCREAMING_SNAKE_CASE, which is needed to construct the name of the required environment variable. We then set the environment variable for the target being built for to deny warnings.

Successful run:
https://github.com/jessebraham/esp-hal/actions/runs/10147479326

To verify it's working, I then introduced a warning, which caused CI to fail as expected:
https://github.com/jessebraham/esp-hal/actions/runs/10147731395/job/28058829410

Additionally, I noticed that at some point we (probably inadvertently) reverted to building with the nightly toolchain, so we're now building with stable again.

Closes #1797

@jessebraham jessebraham added the skip-changelog No changelog modification needed label Jul 29, 2024
Copy link
Member

@SergioGasquez SergioGasquez left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for sticking with this!

Copy link
Contributor

@JurajSadel JurajSadel left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for working on this!

@JurajSadel JurajSadel added this pull request to the merge queue Jul 30, 2024
@bjoernQ
Copy link
Contributor

bjoernQ commented Jul 30, 2024

... the target-specific RUSTFLAGS, which are cumulative

Oh interesting - wasn't aware of that.

I wonder if we should/could just add the flag to .cargo/config.toml?

Merged via the queue into esp-rs:main with commit 81f3776 Jul 30, 2024
19 checks passed
@jessebraham jessebraham deleted the feature/deny-warnings branch July 30, 2024 13:05
@jessebraham
Copy link
Member Author

I wonder if we should/could just add the flag to .cargo/config.toml?

I think it would quickly become annoying, it's quite common to have a large number of warnings while working on new features and I don't think coercing those into hard errors gains us anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deny warnings in CI
4 participants