esp-rs / esp-idf-template

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.
417 stars 50 forks source link

Fix cargo template #120

Closed SergioGasquez closed 1 year ago

SergioGasquez commented 1 year ago

The template is currently broken due to recent changes. Cargo CI still fails due to esp-idf-hal: https://github.com/SergioGasquez/esp-idf-template/actions/runs/4959728233/jobs/8874244444

ivmarkov commented 1 year ago

Thanks! Can you apply the same changes to the main.rs file in the cmake dir?

ivmarkov commented 1 year ago

BTW esp-idf-hal CI passes fine now, on 4.4, 5.0 and master. Any ideas why it fails here?

SergioGasquez commented 1 year ago

BTW esp-idf-hal CI passes fine now, on 4.4, 5.0 and master. Any ideas why it fails here?

Missmatched types:

error[E0308]: mismatched types
    --> /home/runner/.cargo/git/checkouts/esp-idf-hal-923d08f725716f5e/c7dba31/src/task.rs:703:41
     |
703  |                 Arc::new(AtomicPtr::new(task::current().unwrap())),
     |                          -------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `*mut tskTaskControlBlock`, found `*mut c_void`
     |                          |
     |                          arguments to this function are incorrect
     |
     = note: expected raw pointer `*mut tskTaskControlBlock`
                found raw pointer `*mut c_void`
note: associated function defined here
    --> /home/runner/.rustup/toolchains/esp/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:1060:18
     |
1060 |     pub const fn new(p: *mut T) -> AtomicPtr<T> {
     |                  ^^^

error[E0308]: mismatched types
   --> /home/runner/.cargo/git/checkouts/esp-idf-hal-923d08f725716f5e/c7dba31/src/task.rs:753:38
    |
753 |                         task::notify(freertos_task, 1);
    |                         ------------ ^^^^^^^^^^^^^ expected `*mut c_void`, found `*mut tskTaskControlBlock`
    |                         |
    |                         arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut c_void`
               found raw pointer `*mut tskTaskControlBlock`
note: function defined here
   --> /home/runner/.cargo/git/checkouts/esp-idf-hal-923d08f725716f5e/c7dba31/src/task.rs:92:15
    |
92  | pub unsafe fn notify(task: TaskHandle_t, notification: u32) -> bool {
    |               ^^^^^^ ------------------

For more information about this error, try `rustc --explain E0308`.
error: could not compile `esp-idf-hal` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
SergioGasquez commented 1 year ago

Thanks! Can you apply the same changes to the main.rs file in the cmake dir?

Done!