Skip to content

Conversation

@bugadani
Copy link
Contributor

Thank you!

Thank you for your contribution.
Please make sure that your submission includes the following:

Must

  • The code compiles without errors or warnings.
  • All examples work.
  • cargo fmt was run.
  • Your changes were added to the CHANGELOG.md in the proper section.
  • You updated existing examples or added examples (if applicable).
  • Added examples are checked in CI

Nice to have

  • You add a description of your work to this PR.
  • You added proper docs for your newly added features and code.

This PR is taken from #666 and changes CI to check crates with the intended target. This is not extremely important but prevents weird cases where Xtensa/RISC-V asm is checked as x86 and produces warnings. This PR also ensures that the correct rustflags are set where necessary (i.e. checking S2 vs atomics).

# Check all RISC-V targets:
- name: check (esp32c3)
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32c3
run: cd esp-hal-smartled/ && cargo +nightly check --features=esp32c3 --target=riscv32imc-unknown-none-elf
Copy link
Member

Choose a reason for hiding this comment

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

Why does the target matter here? cargo check does not perform code generation, it should not make any difference should it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See below

with:
toolchain: stable
components: clippy
toolchain: nightly
Copy link
Member

Choose a reason for hiding this comment

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

We were specifically running clippy from the stable release channel so that our lints don't just start failing overnight for no reason. Lints in the nightly version of clippy are also not guaranteed to be stabilized, so I don't see much point adhering to those rules.

Copy link
Contributor Author

@bugadani bugadani Jul 21, 2023

Choose a reason for hiding this comment

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

I don't think the crates will pass check with stable. Previously, clippy ran with the host machine as target, so std was available, but now (with cd-ing into the folder instead of --manifest-path cargo will pick up the .cargo/config.toml, set the correct target and there stable will fail as build-std is not stable.

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 guess we could run clippy with the +esp toolchain so that it can pick up the unstable stuff while only checking the stable lints?

@bugadani bugadani force-pushed the ci branch 2 times, most recently from 591b827 to 5212d7d Compare July 24, 2023 19:20
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