wrl / maschine.rs

open-source NI maschine device handling
GNU Lesser General Public License v3.0
86 stars 14 forks source link

Unable to compile #3

Closed Jugulaire closed 4 years ago

Jugulaire commented 6 years ago

Hey,

I'm trying to compile your work on Ubuntu 18.04. I've installed the following package : build-essential caro rustc. I've run cargo build --release and here is what i got :

jugu@jugu-T450:~/maschine.rs$ cargo build --release
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/wrl/tinyosc`                    
   Compiling byteorder v0.5.3                                                   
   Compiling bitflags v0.1.1
   Compiling bytes v0.2.11
   Compiling libc v0.1.12
   Compiling rand_core v0.2.1
   Compiling winapi v0.2.8
   Compiling num-integer v0.1.39
   Compiling num-rational v0.2.1
   Compiling bitflags v1.0.3
   Compiling cfg-if v0.1.4
   Compiling winapi-build v0.1.1
   Compiling libc v0.2.42
   Compiling num-traits v0.2.5
   Compiling slab v0.1.3
   Compiling utf8-ranges v0.1.3
   Compiling num-iter v0.1.37
   Compiling pkg-config v0.3.12
   Compiling num-complex v0.2.0
   Compiling rustc-serialize v0.3.24
   Compiling num-bigint v0.2.0
   Compiling void v1.0.2
   Compiling nix v0.11.0
   Compiling regex-syntax v0.3.9
   Compiling tinyosc v0.0.3 (https://github.com/wrl/tinyosc#357bc16a)
   Compiling nix v0.3.10
   Compiling log v0.4.3
   Compiling kernel32-sys v0.2.2                                                                                                    
   Compiling memchr v0.1.11                                                                                                         
   Compiling rand v0.4.2                                                                                                            
   Compiling rand v0.5.4                                                                                                            
   Compiling time v0.1.40                                                                                                           
   Compiling alsa-sys v0.1.2                                                                                                        
   Compiling log v0.3.9                                                                                                             
   Compiling aho-corasick v0.5.3                                                                                                    
   Compiling mio v0.3.7                                                                                                             
   Compiling rand v0.3.22                                                                                                           
error[E0277]: the trait bound `M: std::marker::Send` is not satisfied                                                               
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:57:9                                       
   |                                                                                                                                
57 | impl<M> fmt::Debug for Notify<M> {                                                                                             
   |         ^^^^^^^^^^ `M` cannot be sent between threads safely                                                                   
   |                                                                                                                                
   = help: the trait `std::marker::Send` is not implemented for `M`                                                                 
   = help: consider adding a `where M: std::marker::Send` bound                                                                     
note: required by `notify::Notify`                                                                                                  
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:16:1                                       
   |                                                                                                                                
16 | pub struct Notify<M: Send> {                                                                                                   
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                     

error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied                                                           
 --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:8:5
  |
8 | /     fn readable(&mut self, event_loop: &mut EventLoop<Self>, token: Token, hint: ReadHint) {
9 | |     }
  | |_____^ `Self` does not have a constant size known at compile-time
  |
  = help: the trait `std::marker::Sized` is not implemented for `Self`
  = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `event_loop::EventLoop`
 --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
  |
37| pub struct EventLoop<H: Handler> {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:11:5
   |
11 | /     fn writable(&mut self, event_loop: &mut EventLoop<Self>, token: Token) {
12 | |     }
   | |_____^ `Self` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `Self`
   = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `event_loop::EventLoop`
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
   |
37 | pub struct EventLoop<H: Handler> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:14:5
   |
14 | /     fn notify(&mut self, event_loop: &mut EventLoop<Self>, msg: Self::Message) {
15 | |     }
   | |_____^ `Self` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `Self`
   = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `event_loop::EventLoop`
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
   |
37 | pub struct EventLoop<H: Handler> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:17:5
   |
17 | /     fn timeout(&mut self, event_loop: &mut EventLoop<Self>, timeout: Self::Timeout) {
18 | |     }
   | |_____^ `Self` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `Self`
   = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `event_loop::EventLoop`
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
   |
37 | pub struct EventLoop<H: Handler> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/handler.rs:20:5
   |
20 | /     fn interrupted(&mut self, event_loop: &mut EventLoop<Self>) {
21 | |     }
   | |_____^ `Self` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `Self`
   = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `event_loop::EventLoop`
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/event_loop.rs:37:1
   |
37 | pub struct EventLoop<H: Handler> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `Self: std::marker::Sized` is not satisfied
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/nonblock.rs:67:5
   |
67 |     fn into_non_block(self) -> Result<NonBlock<Self>>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Self` does not have a constant size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `Self`
   = help: consider adding a `where Self: std::marker::Sized` bound
note: required by `nonblock::NonBlock`
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/nonblock.rs:7:1
   |
7  | pub struct NonBlock<T> {
   | ^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `M: std::marker::Send` is not satisfied
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:58:5
   |
58 | /     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
59 | |         write!(fmt, "Notify<?>")
60 | |     }
   | |_____^ `M` cannot be sent between threads safely
   |
   = help: the trait `std::marker::Send` is not implemented for `M`
   = help: consider adding a `where M: std::marker::Send` bound
note: required by `notify::Notify`
  --> /home/jugu/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.3.7/src/notify.rs:16:1
   |
16 | pub struct Notify<M: Send> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 8 previous errors

error: Could not compile `mio`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Could you help me ?

parsadotsh commented 6 years ago

Same issue here

parsadotsh commented 6 years ago

A cargo.lock file would help a lot

wrl commented 6 years ago

Hey, sorry for the delay in my response here. I'm pretty swamped with work right now so I don't have a lot of time to look into this, but my understanding here is that I've basically just stalled on keeping maschine.rs up-to-date relative to mio (and old mio doesn't build with current rustc).

I have some grander long-term plans relative to platform-independent USB HID access, but, for the time being, since maschine.rs depends on other Linux-specific interfaces (ALSA, mostly), I have a branch that just uses poll() for eventing, and that builds fine on my machine (rustc 1.28.0). I don't have any devices with me right now to test with, so if you could report back and let me know, I'd appreciate that.

Relevant branch is just-use-poll: https://github.com/wrl/maschine.rs/tree/just-use-poll

parsadotsh commented 6 years ago

@wrl Thanks for the guidance! I managed to compile just-use-poll branch although I had to edit the bitflags parts (changed syntax). Unfortunately simply running the program didn't work, and handler.pad_pressed seemed to only fire on the very first event loop run.

But the pressure readings on the pads are working correctly in the loop, so I will have to look some more into the code tomorrow.

Also I must mention this is my first ever interaction with the Rust language, so it is possible that I may have missed something obvious!

wrl commented 6 years ago

@hyperparsa Alright, sounds good. As mentioned, I have no device to test with right now, so I can't be of as much help as I'd like, but I can hopefully provide help if you have any more questions about the code.

Good luck!

wrl commented 4 years ago

Pinned some versions, cleaned up some obsolete syntax. Clean compile on rustc 1.44.1.