ch32-rs / ch32-hal-template

Templat for ch32-hal projects
Apache License 2.0
0 stars 1 forks source link

macOS: Generated template not building (opaque type declaration) #2

Closed KenjutsuGH closed 2 months ago

KenjutsuGH commented 2 months ago

Hi,

I ran

cargo generate ch32-rs/ch32-hal-template

and went through the prompts to create a project for a ch32v203f6p6.:

cargo generate ch32-rs/ch32-hal-template 
⚠️   Favorite `ch32-rs/ch32-hal-template` not found in config, using it as a git repository: https://github.com/ch32-rs/ch32-hal-template.git
🤷   Project Name: v203blink
🔧   Destination: /Users/pkruger/Downloads/ch32-rs/v203blink ...
🔧   project-name: v203blink ...
🔧   Generating template ...
✔ 🤷   Which MCU family to target? · ch32v203
✔ 🤷   Which ch32v203 variant to use? · ch32v203f6p6
🔧   Moving generated files into: `/Users/ZZZ/Downloads/ch32-rs/v203blink`...
🔧   Initializing a fresh Git repository
✨   Done! New project created /Users/ZZZ/Downloads/ch32-rs/v203blink

I then build the project, and get the following errors:

cargo build --release
   Compiling v203blink v0.1.0 (/Users/pkruger/Downloads/ch32-rs/v203blink)
error: item does not constrain `blink::Fut::{opaque#0}`, but has it in its signature
  --> src/main.rs:11:1
   |
11 | #[embassy_executor::task]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
  --> src/main.rs:11:1
   |
11 | #[embassy_executor::task]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the attribute macro `embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)

error: item does not constrain `__embassy_main::Fut::{opaque#0}`, but has it in its signature
  --> src/main.rs:23:1
   |
23 | #[embassy_executor::main(entry = "qingke_rt::entry")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
  --> src/main.rs:23:1
   |
23 | #[embassy_executor::main(entry = "qingke_rt::entry")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the attribute macro `::embassy_executor::task` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `v203blink` (bin "v203blink") due to 2 previous errors

I am new to rust so I am at a total loss on what is wrong and how to resolve it.

My setup:

romainreignier commented 2 months ago

Thanks for your report. This error is not MacOS specific. On Linux, I was on Nightly 1.79 and it was building, but after an update to 1.81, I now have the same error. This is a ch32-hal error that should be reported there.

romainreignier commented 2 months ago

This is actually already reported: https://github.com/ch32-rs/ch32-hal/issues/29

romainreignier commented 2 months ago

This should be fixed by using a fixed version of the nightly toolchain.