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

Couldn't compile freshly cloned repo #1

Closed
MrSpock opened this issue Jun 20, 2024 · 4 comments
Closed

Couldn't compile freshly cloned repo #1

MrSpock opened this issue Jun 20, 2024 · 4 comments

Comments

@MrSpock
Copy link

MrSpock commented Jun 20, 2024

Hi,
Thanks for great work !

Currently this code doesn't compile with following error (using nightly as of Jun 20):

rustup override set nightly
info: override toolchain for '/Users/spock/development/rusty-car' set to 'nightly-aarch64-apple-darwin'

spock@mba ~/d/rusty-car (main)> cargo check
[cut compiling crates]
 Checking rusty-car v0.1.0 (/Users/spock/development/rusty-car/car)
 Checking rusty-controller v0.1.0 (/Users/spock/development/rusty-car/controller)
warning: unused import: `publisher`
  --> controller/src/main.rs:12:44
   |
12 | use embassy_sync::{pubsub::{PubSubChannel, publisher, Publisher, Subscriber}, blocking_mutex::raw::NoopRawMutex};
   |                                            ^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `embassy_time::Timer`
  --> controller/src/main.rs:13:5
   |
13 | use embassy_time::Timer;
   |     ^^^^^^^^^^^^^^^^^^^

error: item does not constrain `T::{opaque#0}`, but has it in its signature
  --> car/src/main.rs:52:20
   |
52 |     let executor = make_static!(Executor::new());
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
  --> car/src/main.rs:52:20
   |
52 |     let executor = make_static!(Executor::new());
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the macro `$crate::make_static` which comes from the expansion of the macro `make_static` (in Nightly builds, run with -Z macro-backtrace for more info)

error: item does not constrain `__risc_v_rt__main::T::{opaque#0}`, but has it in its signature
  --> controller/src/main.rs:60:20
   |
60 |     let executor = make_static!(Executor::new());
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
  --> controller/src/main.rs:60:20
   |
60 |     let executor = make_static!(Executor::new());
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the macro `$crate::make_static` which comes from the expansion of the macro `make_static` (in Nightly builds, run with -Z macro-backtrace for more info)

error: item does not constrain `__risc_v_rt__main::T::{opaque#0}`, but has it in its signature
  --> controller/src/main.rs:80:27
   |
80 |     let command_channel = make_static!(command_channel);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
  --> controller/src/main.rs:80:27
   |
80 |     let command_channel = make_static!(command_channel);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the macro `$crate::make_static` which comes from the expansion of the macro `make_static` (in Nightly builds, run with -Z macro-backtrace for more info)

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

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

error: could not compile `rusty-car` (bin "rusty-car") due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
warning: variable does not need to be mutable
  --> controller/src/main.rs:97:75
   |
97 | async fn encoder(pin_a: Gpio4<Input<PullUp>>,pin_b: Gpio6<Input<PullUp>>, mut publisher: Publisher<'static,NoopRawMutex,ControlMessage,MAX_MESSAGE, MAX_SUBSCRIBER,MAX_PUBLI...
   |                                                                           ----^^^^^^^^^
   |                                                                           |
   |                                                                           help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

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

warning: `rusty-controller` (bin "rusty-controller") generated 3 warnings
error: could not compile `rusty-controller` (bin "rusty-controller") due to 4 previous errors; 3 warnings emitted
@MrSpock
Copy link
Author

MrSpock commented Jun 20, 2024

I suspect this is related to that:
embassy-rs/static-cell#16

@MrSpock
Copy link
Author

MrSpock commented Jun 20, 2024

FYI:
Pinning to nighlty release before 2024-06-13 solves problem:

cat rust-toolchain.toml
[toolchain]
channel = "nightly-2024-06-12"

@flyaruu
Copy link
Owner

flyaruu commented Jun 20, 2024

Oof, ok, yes that could be the case, I've had trouble with static_cell before.
One alternative could be to not use static_cell at all, and just Box:leak those things, as we are using an allocator anyway.

I've been working on an updated version (mostly dependencies), I can push that tonight.

@flyaruu
Copy link
Owner

flyaruu commented Jul 5, 2024

Hi, I messed up at some point, and there are two versions. Please use this one: https://github.com/flyaruu/rc-car I've cleaned it up and updated to the latest version

@flyaruu flyaruu closed this as completed Jul 5, 2024
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

No branches or pull requests

2 participants