Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Compiling wlroots-rs on ARM #205

Open
andrewcsmith opened this issue Aug 19, 2018 · 6 comments
Open

Compiling wlroots-rs on ARM #205

andrewcsmith opened this issue Aug 19, 2018 · 6 comments

Comments

@andrewcsmith
Copy link
Contributor

andrewcsmith commented Aug 19, 2018

Hey there, I'm following up (finally) on my reddit post from 3 months ago and it turns out that the Odroid's ARMv7 architecture (running Arch Linux ARM) is having some trouble with i8 vs u8 sizes. 66 troubles, to be precise.

Posting this below so that there's a checklist, but if this sounds like something that seems nominally interesting I can get to work. I'll just warn you that I haven't actually gotten any wayland compositor working yet on this thing, though I have run glxgears through X11 with OpenGL ES acceleration, so that definitely works.

compilation errors

   Compiling wlroots v0.0.0 (file:///home/alarm/way-cooler/wlroots-rs)
error[E0432]: unresolved import `wlroots_sys::__va_list_tag`
  --> wlroots-rs/src/utils.rs:10:19
   |
10 | use wlroots_sys::{__va_list_tag, wlr_log_init, wlr_edges};
   |                   ^^^^^^^^^^^^^ no `__va_list_tag` in the root. Did you mean to use `__va_list`?

error[E0308]: mismatched types
  --> wlroots-rs/src/macros.rs:43:9
   |
43 |         concat!($s, "\0").as_ptr() as *const i8
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   | 
  ::: wlroots-rs/src/manager/input_manager.rs:99:29
   |
99 |                             wlr_log!(WLR_ERROR, "Device {:#?} was not a keyboard!", dev);
   |                             ------------------------------------------------------------- in this macro invocation
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:127:29
    |
127 |                             wlr_log!(WLR_ERROR, "Device {:#?} was not a pointer!", dev);
    |                             ------------------------------------------------------------ in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:153:29
    |
153 |                             wlr_log!(WLR_ERROR, "Device {:#?} was not a touch", dev);
    |                             --------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:178:29
    |
178 |                             wlr_log!(WLR_ERROR, "Device {:#?}, was not a tablet tool", dev);
    |                             ---------------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:205:29
    |
205 |                             wlr_log!(WLR_ERROR, "Device {:#?}, was not a tablet pad", dev);
    |                             --------------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
  --> wlroots-rs/src/macros.rs:43:9
   |
43 |         concat!($s, "\0").as_ptr() as *const i8
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   | 
  ::: wlroots-rs/src/manager/xdg_shell_v6_manager.rs:30:9
   |
30 |         wlr_log!(WLR_DEBUG, "New xdg_shell_v6_surface request {:p}", data);
   |         ------------------------------------------------------------------- in this macro invocation
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
  --> wlroots-rs/src/macros.rs:43:9
   |
43 |         concat!($s, "\0").as_ptr() as *const i8
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   | 
  ::: wlroots-rs/src/manager/xdg_shell_manager.rs:30:9
   |
30 |         wlr_log!(WLR_DEBUG, "New xdg_shell_surface request {:p}", data);
   |         ---------------------------------------------------------------- in this macro invocation
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/seat/seat.rs:277:9
    |
277 |         wlr_log!(WLR_DEBUG, "New drag icon request {:p}", data);
    |         -------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:250:5
    |
250 |     wlr_log!(WLR_DEBUG, "Using xkb rules: {:?}", rules);
    |     ---------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:251:5
    |
251 |     wlr_log!(WLR_DEBUG, "Using xkb model: {:?}", model);
    |     ---------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:252:5
    |
252 |     wlr_log!(WLR_DEBUG, "Using xkb layout: {:?}", layout);
    |     ------------------------------------------------------ in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:253:5
    |
253 |     wlr_log!(WLR_DEBUG, "Using xkb variant: {:?}", variant);
    |     -------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/manager/input_manager.rs:254:5
    |
254 |     wlr_log!(WLR_DEBUG, "Using xkb options: {:?}", options);
    |     -------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/compositor.rs:425:13
    |
425 | /             wlr_log!(WLR_DEBUG,
426 | |                      "Running compositor on wayland display {}",
427 | |                      socket_name);
    | |__________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/compositor.rs:488:13
    |
488 |             wlr_log!(WLR_INFO, "Starting compositor");
    |             ------------------------------------------ in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/compositor.rs:601:43
    |
601 | /                                           wlr_log!(WLR_ERROR,
602 | |                                                    "After running compositor callback, mutable \
603 | |                                                     lock was false");
    | |_____________________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/keyboard.rs:205:13
    |
205 |             wlr_log!(WLR_DEBUG, "Dropped Keyboard {:p}", self.keyboard);
    |             ------------------------------------------------------------ in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/keyboard.rs:211:17
    |
211 | /                 wlr_log!(WLR_DEBUG,
212 | |                          "Still {} weak pointers to Keyboard {:p}",
213 | |                          weak_count,
214 | |                          self.keyboard);
    | |________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/keyboard.rs:301:43
    |
301 | /                                           wlr_log!(WLR_ERROR,
302 | |                                                    "After running keyboard callback, mutable \
303 | |                                                     lock was false for: {:?}",
304 | |                                                    keyboard);
    | |_____________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/pointer.rs:106:13
    |
106 |             wlr_log!(WLR_DEBUG, "Dropped Pointer {:p}", self.pointer);
    |             ---------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/pointer.rs:112:17
    |
112 | /                 wlr_log!(WLR_DEBUG,
113 | |                          "Still {} weak pointers to Pointer {:p}",
114 | |                          weak_count,
115 | |                          self.pointer);
    | |_______________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/pointer.rs:171:21
    |
171 |                     wlr_log!(WLR_ERROR, "Double mutable borrows on {:?}", pointer);
    |                     --------------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/pointer.rs:203:43
    |
203 | /                                           wlr_log!(WLR_ERROR,
204 | |                                                    "After running pointer callback, mutable lock \
205 | |                                                     was false for: {:?}",
206 | |                                                    pointer);
    | |____________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/touch.rs:105:13
    |
105 |             wlr_log!(WLR_DEBUG, "Dropped Touch {:p}", self.touch);
    |             ------------------------------------------------------ in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/touch.rs:111:17
    |
111 | /                 wlr_log!(WLR_DEBUG,
112 | |                          "Still {} weak pointers to Touch {:p}",
113 | |                          weak_count,
114 | |                          self.touch);
    | |_____________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/touch.rs:170:21
    |
170 |                     wlr_log!(WLR_ERROR, "Double mutable borrows on {:?}", touch);
    |                     ------------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/touch.rs:202:43
    |
202 | /                                           wlr_log!(WLR_ERROR,
203 | |                                                    "After running touch callback, mutable lock \
204 | |                                                     was false for: {:?}",
205 | |                                                    touch);
    | |__________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/tablet_tool.rs:101:9
    |
101 |         wlr_log!(WLR_DEBUG, "Dropped TabletTool {:p}", self.tool);
    |         ---------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/tablet_tool.rs:107:13
    |
107 | /             wlr_log!(WLR_DEBUG,
108 | |                      "Still {} weak pointers to TabletTool {:p}",
109 | |                      weak_count,
110 | |                      self.tool);
    | |________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/tablet_tool.rs:196:43
    |
196 | /                                           wlr_log!(WLR_ERROR,
197 | |                                                    "After running tablet tool callback, mutable \
198 | |                                                     lock was false for: {:?}",
199 | |                                                    tool);
    | |_________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/tablet_pad.rs:101:9
    |
101 |         wlr_log!(WLR_DEBUG, "Dropped TabletPad {:p}", self.pad);
    |         -------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/tablet_pad.rs:107:13
    |
107 | /             wlr_log!(WLR_DEBUG,
108 | |                      "Still {} weak pointers to TabletPad {:p}",
109 | |                      weak_count,
110 | |                      self.pad);
    | |_______________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/input/tablet_pad.rs:196:43
    |
196 | /                                           wlr_log!(WLR_ERROR,
197 | |                                                    "After running tablet tool callback, mutable \
198 | |                                                     lock was false for: {:?}",
199 | |                                                    pad);
    | |________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/cursor/cursor.rs:495:21
    |
495 |                     wlr_log!(WLR_ERROR, "Tried to map output not in the OutputLayout");
    |                     ------------------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/cursor/cursor.rs:522:21
    |
522 | /                     wlr_log!(WLR_ERROR,
523 | |                              "Tried to map input to an output not in the OutputLayout");
    | |________________________________________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/cursor/cursor.rs:606:9
    |
606 |         wlr_log!(WLR_DEBUG, "Dropped {:?}", self);
    |         ------------------------------------------ in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/cursor/cursor.rs:714:43
    |
714 | /                                           wlr_log!(WLR_ERROR,
715 | |                                                    "After running cursor callback, mutable lock \
716 | |                                                     was false for {:p}",
717 | |                                                    cursor_ptr);
    | |_______________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output.rs:179:17
    |
179 |                 wlr_log!(WLR_DEBUG, "output added {:?}", self);
    |                 ----------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/types/output/output.rs:323:59
    |
323 |                                        timespec { tv_sec: duration.as_secs() as i64,
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
   --> wlroots-rs/src/types/output/output.rs:324:60
    |
324 |                                                   tv_nsec: duration.subsec_nanos() as i64 }
    |                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
   --> wlroots-rs/src/types/output/output.rs:410:18
    |
409 |     pub fn set_gamma(&mut self, size: u32, mut r: u16, mut g: u16, mut b: u16) {
    |                                                                                - expected `()` because of default return type
410 |         unsafe { wlr_output_set_gamma(self.output, size, &mut r, &mut g, &mut b) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
    |                  |
    |                  expected (), found bool
    |
    = note: expected type `()`
               found type `bool`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output.rs:472:13
    |
472 |             wlr_log!(WLR_DEBUG, "Dropped output {:p}", self.output);
    |             -------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output.rs:475:17
    |
475 | /                 wlr_log!(WLR_DEBUG,
476 | |                          "Still {} weak pointers to Output {:p}",
477 | |                          weak_count,
478 | |                          self.output);
    | |______________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output.rs:563:43
    |
563 | /                                           wlr_log!(WLR_ERROR,
564 | |                                                    "After running output callback, mutable lock \
565 | |                                                     was false for: {:?}",
566 | |                                                    output);
    | |___________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output_layout.rs:214:13
    |
214 |             wlr_log!(WLR_DEBUG, "Added {:?} to {:?}", output, self);
    |             -------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output_layout.rs:296:9
    |
296 |         wlr_log!(WLR_DEBUG, "Removing {:?} from {:?}", output, self);
    |         ------------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output_layout.rs:422:43
    |
422 | /                                           wlr_log!(WLR_ERROR,
423 | |                                                    "After running OutputLayout callback, mutable \
424 | |                                                     lock was false for: {:?}",
425 | |                                                    output_layout);
    | |__________________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/types/output/output_damage.rs:121:63
    |
121 |                                            timespec { tv_sec: duration.as_secs() as i64,
    |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
   --> wlroots-rs/src/types/output/output_damage.rs:122:64
    |
122 |                                                       tv_nsec: duration.subsec_nanos() as i64 }
    |                                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/output/output_damage.rs:154:9
    |
154 |         wlr_log!(WLR_DEBUG, "Dropped OutputDamage {:p}", self.damage);
    |         -------------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/seat/drag_icon.rs:144:43
    |
144 | /                                           wlr_log!(WLR_ERROR,
145 | |                                                    "After running DragIcon callback, \
146 | |                                                     mutable lock was false for: {:?}",
147 | |                                                    drag_icon);
    | |______________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/seat/seat.rs:898:43
    |
898 | /                                           wlr_log!(WLR_ERROR,
899 | |                                                    "After running seat callback, mutable lock \
900 | |                                                     was false for {:p}",
901 | |                                                    seat_ptr);
    | |_____________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/types/surface/surface.rs:295:43
    |
295 |             let when = timespec { tv_sec: duration.as_secs() as i64,
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
   --> wlroots-rs/src/types/surface/surface.rs:296:44
    |
296 |                                   tv_nsec: duration.subsec_nanos() as i64 };
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found i64

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/surface/surface.rs:412:43
    |
412 | /                                           wlr_log!(WLR_ERROR,
413 | |                                                    "After running surface callback, mutable lock \
414 | |                                                     was false for: {:?}",
415 | |                                                    surface);
    | |____________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |         concat!($s, "\0").as_ptr() as *const i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/surface/surface.rs:438:9
    |
438 |         wlr_log!(WLR_DEBUG, "Dropped surface {:p}", self.surface);
    |         ---------------------------------------------------------- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/surface/surface.rs:441:13
    |
441 | /             wlr_log!(WLR_DEBUG,
442 | |                      "Still {} weak pointers to Surface {:p}",
443 | |                      weak_count,
444 | |                      self.surface);
    | |___________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
  --> wlroots-rs/src/macros.rs:43:9
   |
43 |         concat!($s, "\0").as_ptr() as *const i8
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   | 
  ::: wlroots-rs/src/types/surface/surface_state.rs:71:21
   |
71 |                     wlr_log!(WLR_ERROR, "Invalid invalid state {}", invalid);
   |                     --------------------------------------------------------- in this macro invocation
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/surface/sub_surface.rs:185:43
    |
185 | /                                           wlr_log!(WLR_ERROR,
186 | |                                                    "After running subsurface callback, mutable \
187 | |                                                     lock was false for: {:?}",
188 | |                                                    subsurface);
    | |_______________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/shell/xdg_shell_v6.rs:294:43
    |
294 | /                                           wlr_log!(WLR_ERROR,
295 | |                                                    "After running XdgV6ShellSurface callback, \
296 | |                                                     mutable lock was false for: {:?}",
297 | |                                                    xdg_surface);
    | |________________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/types/shell/xdg_shell.rs:304:43
    |
304 | /                                           wlr_log!(WLR_ERROR,
305 | |                                                    "After running XdgShellSurface callback, \
306 | |                                                     mutable lock was false for: {:?}",
307 | |                                                    xdg_surface);
    | |________________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error[E0308]: mismatched types
  --> wlroots-rs/src/macros.rs:43:9
   |
43 |         concat!($s, "\0").as_ptr() as *const i8
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   | 
  ::: wlroots-rs/src/extensions/server_decoration.rs:25:9
   |
25 |         wlr_log!(WLR_INFO, "New server decoration mode: {:?}", mode);
   |         ------------------------------------------------------------- in this macro invocation
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
  --> wlroots-rs/src/utils.rs:35:46
   |
35 |                 wlr_log_init(verbosity, Some(log_callback));
   |                                              ^^^^^^^^^^^^ expected struct `wlroots_sys::__va_list`, found *-ptr
   |
   = note: expected type `unsafe extern "C" fn(wlroots_sys::wlr_log_importance, *const u8, wlroots_sys::__va_list)`
              found type `unsafe extern "C" fn(wlroots_sys::wlr_log_importance, *const u8, *mut [type error]) {utils::log_callback}`

error[E0308]: mismatched types
  --> wlroots-rs/src/macros.rs:43:9
   |
43 |           concat!($s, "\0").as_ptr() as *const i8
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
   | 
  ::: wlroots-rs/src/utils.rs:78:13
   |
78 | /             wlr_log!(WLR_ERROR,
79 | |                      "Error occured while trying to convert a Rust string to a C string {:?}",
80 | |                      err);
   | |__________________________- in this macro invocation
   |
   = note: expected type `*const u8`
              found type `*const i8`

error[E0308]: mismatched types
   --> wlroots-rs/src/macros.rs:43:9
    |
43  |           concat!($s, "\0").as_ptr() as *const i8
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
    | 
   ::: wlroots-rs/src/xwayland/surface.rs:574:43
    |
574 | /                                           wlr_log!(WLR_ERROR,
575 | |                                                    "After running XWaylandSurface callback, \
576 | |                                                     mutable lock was false for: {:?}",
577 | |                                                    wl_shell_surface);
    | |_____________________________________________________________________- in this macro invocation
    |
    = note: expected type `*const u8`
               found type `*const i8`

error: aborting due to 66 previous errors

Some errors occurred: E0308, E0432.
For more information about an error, try `rustc --explain E0308`.
error: Could not compile `wlroots`.

To learn more, run the command again with --verbose.
make: *** [makefile:4: build] Error 101
@psychon
Copy link
Contributor

psychon commented Aug 20, 2018

43 | concat!($s, "\0").as_ptr() as *const i8
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8

Is this a signed vs unsigned char thing?

@ascent12
Copy link
Member

It sounds like it should be cast as *const c_char. Plain char in C can be either signed or unsigned, depending on the compiler/platform, so you don't want to assume either.

@andrewcsmith
Copy link
Contributor Author

I'm happy to work on this (experienced Rust dev, very inexperienced ARM dev), if someone can point me to a place with similar idiomatic cross-architecture code? My first impulse would be lots of #[cfg(platform ...)] directives, but I imagine there's got to be a simpler way.

@Timidger
Copy link
Member

The majority (all?) of these are from the wlr log macro so can be fixed in one place.

@ascent12 is correct @andrewcsmith, use libc::c_char which is automatically set to the correct type (so no need for ifcfg)

@andrewcsmith
Copy link
Contributor Author

Okay, thanks a lot all -- down to a few more, can't figure these ones out...sorry, I'm a wayland and arm noob, but I assume it's an issue with finding different headers. Is this small enough that I should do #[cfg] directives, or what do you think?

   Compiling wlroots v0.0.0 (file:///home/alarm/way-cooler/wlroots-rs)                                                                      
error[E0432]: unresolved import `wlroots_sys::__va_list_tag`                                                                                
  --> src/utils.rs:10:19                                                                                                                    
   |                                                                                                                                        
10 | use wlroots_sys::{__va_list_tag, wlr_log_init, wlr_edges};                                                                             
   |                   ^^^^^^^^^^^^^ no `__va_list_tag` in the root. Did you mean to use `__va_list`?                                       
                                                                                                                                            
error[E0308]: mismatched types                                                                                                              
   --> src/types/output/output.rs:410:18                                                                                                    
    |                                                                                                                                       
409 |     pub fn set_gamma(&mut self, size: u32, mut r: u16, mut g: u16, mut b: u16) {                                                      
    |                                                                                - expected `()` because of default return type         
410 |         unsafe { wlr_output_set_gamma(self.output, size, &mut r, &mut g, &mut b) }                                                    
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`                   
    |                  |                                                                                                                    
    |                  expected (), found bool                                                                                              
    |                                                                                                                                       
    = note: expected type `()`                                                                                                              
               found type `bool`                                                                                                            
                                                                                                                                            
error[E0308]: mismatched types                                                                                                              
  --> src/utils.rs:35:46                                                                                                                    
   |                                                                                                                                        
35 |                 wlr_log_init(verbosity, Some(log_callback));                                                                           
   |                                              ^^^^^^^^^^^^ expected struct `wlroots_sys::__va_list`, found *-ptr                        
   |                                                                                                                                        
   = note: expected type `unsafe extern "C" fn(wlroots_sys::wlr_log_importance, *const u8, wlroots_sys::__va_list)`                         
              found type `unsafe extern "C" fn(wlroots_sys::wlr_log_importance, *const u8, *mut [type error]) {utils::log_callback}`        
                                                                                                                                            
error: aborting due to 3 previous errors                                                                                                    

@andrewcsmith andrewcsmith changed the title ARM Support / i8 and u8 defaults Compiling wlroots-rs on ARM Aug 21, 2018
andrewcsmith added a commit to andrewcsmith/wlroots-rs that referenced this issue Aug 21, 2018
@Timidger
Copy link
Member

The va list thing is strange. Might need a cfg?

Add the ; for set_gamma.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants