yshui / picom-xrdesktop-companion

picom's companion program to bring your desktop to XR
21 stars 4 forks source link

Cargo build --release fails #4

Closed Da-Boom closed 2 years ago

Da-Boom commented 2 years ago

Hi, i tried to build your software, only to be bombarded with errors

Im running archlinux with

Here are the errors I recieved:

Compiling xrd v0.15.0 (/home/jaryed/Documents/code/picom-xrdesktop-companion/xrd)
error[E0407]: method `backtrace` is not a member of trait `std::error::Error`
  --> app/src/gl.rs:32:10
   |
32 | #[derive(thiserror::Error, Debug)]
   |          ^^^^^^^^^^^^^^^^ not a member of trait `std::error::Error`
   |
   = note: this error originates in the derive macro `thiserror::Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `xlib_display` found for reference `&glium::glutin::window::Window` in the current scope
   --> app/src/gl.rs:111:59
    |
111 |         let raw_display = self.glium.gl_window().window().xlib_display().unwrap();
    |                                                           ^^^^^^^^^^^^ method not found in `&glium::glutin::window::Window`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1   | use glium::glutin::platform::unix::WindowExtUnix;
    |

error[E0308]: arguments to this function are incorrect
   --> app/src/gl.rs:135:23
    |
135 |         let display = glium::Display::new(wb, cb, &el)?;
    |                       ^^^^^^^^^^^^^^^^^^^ --  --  --- expected struct `glium::glutin::event_loop::EventLoopWindowTarget`, found struct `glutin::event_loop::EventLoop`
    |                                           |   |
    |                                           |   expected struct `glium::glutin::ContextBuilder`, found struct `glutin::ContextBuilder`
    |                                           expected struct `glium::glutin::window::WindowBuilder`, found struct `glutin::window::WindowBuilder`
    |
    = note: perhaps two different versions of crate `winit` are being used?
    = note: expected struct `glium::glutin::ContextBuilder<'_, _>`
               found struct `glutin::ContextBuilder<'_, glutin::NotCurrent>`
    = note: perhaps two different versions of crate `glutin` are being used?
    = note: expected reference `&glium::glutin::event_loop::EventLoopWindowTarget<_>`
               found reference `&glutin::event_loop::EventLoop<()>`
note: associated function defined here
   --> /home/jaryed/.cargo/git/checkouts/glium-77a94afc886844c8/3e143cf/src/backend/glutin/mod.rs:70:12
    |
70  |     pub fn new<T: ContextCurrentState, E>(
    |            ^^^

error[E0599]: no method named `get_egl_display` found for struct `std::cell::Ref<'_, impl Deref<Target = glium::glutin::ContextWrapper<glium::glutin::PossiblyCurrent, glium::glutin::window::Window>>>` in the current scope
   --> app/src/gl.rs:136:46
    |
136 |         assert!(unsafe { display.gl_window().get_egl_display().is_none() });
    |                                              ^^^^^^^^^^^^^^^ method not found in `std::cell::Ref<'_, impl Deref<Target = glium::glutin::ContextWrapper<glium::glutin::PossiblyCurrent, glium::glutin::window::Window>>>`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1   | use glium::glutin::platform::ContextTraitExt;
    |

error[E0599]: no method named `xlib_display` found for reference `&glium::glutin::window::Window` in the current scope
   --> app/src/gl.rs:211:59
    |
211 |         let raw_display = self.glium.gl_window().window().xlib_display().unwrap();
    |                                                           ^^^^^^^^^^^^ method not found in `&glium::glutin::window::Window`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1   | use glium::glutin::platform::unix::WindowExtUnix;
    |

error[E0599]: no method named `xlib_display` found for reference `&glium::glutin::window::Window` in the current scope
   --> app/src/gl.rs:337:59
    |
337 |         let raw_display = self.glium.gl_window().window().xlib_display().unwrap();
    |                                                           ^^^^^^^^^^^^ method not found in `&glium::glutin::window::Window`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1   | use glium::glutin::platform::unix::WindowExtUnix;
    |

error[E0599]: no method named `xlib_display` found for reference `&glium::glutin::window::Window` in the current scope
   --> app/src/gl.rs:424:59
    |
424 |         let raw_display = self.glium.gl_window().window().xlib_display().unwrap();
    |                                                           ^^^^^^^^^^^^ method not found in `&glium::glutin::window::Window`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1   | use glium::glutin::platform::unix::WindowExtUnix;
    |

error[E0599]: no method named `raw_handle` found for struct `std::cell::Ref<'_, impl Deref<Target = glium::glutin::ContextWrapper<glium::glutin::PossiblyCurrent, glium::glutin::window::Window>>>` in the current scope
   --> app/src/gl.rs:438:78
    |
438 |                 if let RawHandle::Glx(glx) = unsafe { self.glium.gl_window().raw_handle() } {
    |                                                                              ^^^^^^^^^^ method not found in `std::cell::Ref<'_, impl Deref<Target = glium::glutin::ContextWrapper<glium::glutin::PossiblyCurrent, glium::glutin::window::Window>>>`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1   | use glium::glutin::platform::ContextTraitExt;
    |

warning: unused import: `WindowExtUnix`
 --> app/src/gl.rs:3:23
  |
3 |     unix::{RawHandle, WindowExtUnix},
  |                       ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `ContextTraitExt`
 --> app/src/gl.rs:4:5
  |
4 |     ContextTraitExt,
  |     ^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0308, E0407, E0599.
For more information about an error, try `rustc --explain E0308`.

Hope you can help

Da-Boom commented 2 years ago

Ok so it appears some of the errors (lke the ones regarding std::error::Error are the result of a isssue with the latest rust nightly - i backdated to rust 1.64.0-nightly (2022-07-18) (chose this one because its the day of your last commit)

and found that those errors were gone. But the parts regarding gl_window().window().xlib_display() raw_handle() and others are still failing. is there a missing library, or is there one that needs backdating?

EDIT: Ok done a bit of a look through the code, and ive found there is a discrepancy betweeen glium context and direct calls to glutin.

so the use statement for WindowExtUnix and ContextTraitExt are plugged as straight glutin, but lines 111, 211, 337 and 424 in gl.rs require both straight glutin calls and glutin under the glium context calls, which seems to be causing a conflict. I tried to add uses for both the WindowExtUnix and ContextTraitExt under glium in certain parts, but that just breaks the direct functions, which are numerous, some being on the same line as the glutin under glium function calls

yshui commented 2 years ago

There could be changes in glutin and glium upstream that made the code not compile. Thanks for reporting!

yshui commented 2 years ago

The backtrace issue is tracked upstream: https://github.com/dtolnay/thiserror/issues/177

yshui commented 2 years ago

@Da-Boom Everything should've been fixed now.