Eraden / amdgpud

MIT License
195 stars 11 forks source link

Build of `amdguid` fails with errors E0061, E0277, E0308, E0432, E0433, E0599, E0659: ``error[E0432]: unresolved imports `crate::app::ImageStorage`, `crate::app::ImageType``` and subsequent errors. #64

Open dreirund opened 1 year ago

dreirund commented 1 year ago

Ahoj,

Short:

Build fails with

error[E0432]: unresolved imports `crate::app::ImageStorage`, `crate::app::ImageType`

and subsequent errors (E0061, E0277, E0308, E0432, E0433, E0599, E0659).

In detail:

I am building this using the following recipe (inspired by ↗ this PKGBUILD):

export CARGO_HOME=/tmp/cargo
export RUSTUP_HOME=/tmp/rustup

export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target

export CARCH=x86_64

git clone --depth 1 --single-branch --shallow-submodules https://github.com/Eraden/amdgpud amdgpud

cd amdgpud

cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
cargo build --release --frozen --all-features --target="$CARCH-unknown-linux-gnu"

and then the next line is compilation of amdguid which fails:

   Compiling amdguid v1.0.12 (/tmp/makepkg/build/amdgpud-git/src/amdgpud/amdguid)
error[E0432]: unresolved imports `crate::app::ImageStorage`, `crate::app::ImageType`
  --> amdguid/src/backend/glium_backend.rs:10:26
   |
10 | use crate::app::{AmdGui, ImageStorage, ImageType};
   |                          ^^^^^^^^^^^^  ^^^^^^^^^ no `ImageType` in `app`
   |                          |
   |                          no `ImageStorage` in `app`
   |
   = help: consider importing this enum instead:
           vulkano::image::ImageType

error[E0433]: failed to resolve: could not find `EguiGlow` in `egui_glow`
  --> amdguid/src/backend/glow_backend.rs:49:31
   |
49 |     let mut egui = egui_glow::EguiGlow::new(&gl_window, &gl);
   |                               ^^^^^^^^ could not find `EguiGlow` in `egui_glow`

error[E0659]: `run_app` is ambiguous
  --> amdguid/src/main.rs:28:14
   |
28 |     backend::run_app(amd_gui, receiver);
   |              ^^^^^^^ ambiguous name
   |
   = note: ambiguous because of multiple glob imports of a name in the same module
note: `run_app` could refer to the function imported here
  --> amdguid/src/backend/mod.rs:13:9
   |
13 | pub use glium_backend::*;
   |         ^^^^^^^^^^^^^^^^
   = help: consider adding an explicit import of `run_app` to disambiguate
note: `run_app` could also refer to the function imported here
  --> amdguid/src/backend/mod.rs:18:9
   |
18 | pub use wayland_backend::*;
   |         ^^^^^^^^^^^^^^^^^^
   = help: consider adding an explicit import of `run_app` to disambiguate

warning: unused import: `std::collections::HashMap`
 --> amdguid/src/backend/glium_backend.rs:1:5
  |
1 | use std::collections::HashMap;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::rc::Rc`
 --> amdguid/src/backend/glium_backend.rs:2:5
  |
2 | use std::rc::Rc;
  |     ^^^^^^^^^^^

warning: unused import: `image::RgbaImage`
 --> amdguid/src/backend/glium_backend.rs:6:5
  |
6 | use image::RgbaImage;
  |     ^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `glutin::event_loop::EventLoop::<T>::with_user_event`: Use `EventLoopBuilder::<T>::with_user_event().build()` instead.
  --> amdguid/src/backend/glium_backend.rs:32:53
   |
32 |     let event_loop = glutin::event_loop::EventLoop::with_user_event();
   |                                                     ^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

error[E0308]: mismatched types
  --> amdguid/src/backend/glium_backend.rs:35:47
   |
35 |     let mut egui = egui_glium::EguiGlium::new(&display);
   |                    -------------------------- ^^^^^^^^ expected `glium::backend::glutin::Display`, found `glium::Display`
   |                    |
   |                    arguments to this function are incorrect
   |
   = note: `glium::Display` and `glium::backend::glutin::Display` have similar names, but are actually distinct types
note: `glium::Display` is defined in crate `glium`
  --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/glium-0.32.1/src/backend/glutin/mod.rs:36:1
   |
36 | pub struct Display {
   | ^^^^^^^^^^^^^^^^^^
note: `glium::backend::glutin::Display` is defined in crate `glium`
  --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/glium-0.31.0/src/backend/glutin/mod.rs:36:1
   |
36 | pub struct Display {
   | ^^^^^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `glium` are being used?
note: associated function defined here
  --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/egui_glium-0.18.0/src/lib.rs:28:12
   |
28 |     pub fn new(display: &glium::Display) -> Self {
   |            ^^^

error[E0599]: no method named `begin_frame` found for struct `EguiGlium` in the current scope
  --> amdguid/src/backend/glium_backend.rs:50:18
   |
50 |             egui.begin_frame(&display);
   |                  ^^^^^^^^^^^ method not found in `EguiGlium`
   |
help: one of the expressions' fields has a method of the same name
   |
50 |             egui.egui_ctx.begin_frame(&display);
   |                  +++++++++

error[E0599]: no method named `ctx` found for struct `EguiGlium` in the current scope
  --> amdguid/src/backend/glium_backend.rs:52:45
   |
52 |             create_ui(amd_gui.clone(), egui.ctx());
   |                                             ^^^ method not found in `EguiGlium`

error[E0599]: no method named `end_frame` found for struct `EguiGlium` in the current scope
  --> amdguid/src/backend/glium_backend.rs:54:48
   |
54 |             let (needs_repaint, shapes) = egui.end_frame(&display);
   |                                                ^^^^^^^^^ method not found in `EguiGlium`
   |
help: one of the expressions' fields has a method of the same name
   |
54 |             let (needs_repaint, shapes) = egui.egui_ctx.end_frame(&display);
   |                                                +++++++++

error[E0277]: the trait bound `glium::Frame: glium::Surface` is not satisfied
    --> amdguid/src/backend/glium_backend.rs:69:38
     |
69   |                 egui.paint(&display, &mut target, shapes);
     |                      -----           ^^^^^^^^^^^ the trait `glium::Surface` is not implemented for `glium::Frame`
     |                      |
     |                      required by a bound introduced by this call
     |
help: trait impl with same name found
    --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/glium-0.32.1/src/lib.rs:1285:1
     |
1285 | impl Surface for Frame {
     | ^^^^^^^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `glium` are being used?
     = help: the following other types implement trait `glium::Surface`:
               glium::framebuffer::default_fb::DefaultFramebuffer
               glium::framebuffer::SimpleFrameBuffer<'a>
               glium::framebuffer::MultiOutputFrameBuffer<'a>
               glium::framebuffer::EmptyFrameBuffer
               glium::Frame
note: required by a bound in `EguiGlium::paint`
    --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/egui_glium-0.18.0/src/lib.rs:79:21
     |
79   |     pub fn paint<T: glium::Surface>(&mut self, display: &glium::Display, target: &mut T) {
     |                     ^^^^^^^^^^^^^^ required by this bound in `EguiGlium::paint`

error[E0061]: this method takes 2 arguments but 3 arguments were supplied
  --> amdguid/src/backend/glium_backend.rs:69:22
   |
69 |                 egui.paint(&display, &mut target, shapes);
   |                      ^^^^^ ----------
   |                            |
   |                            unexpected argument of type `&glium::Display`
   |                            help: remove the extra argument
   |
note: method defined here
  --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/egui_glium-0.18.0/src/lib.rs:79:12
   |
79 |     pub fn paint<T: glium::Surface>(&mut self, display: &glium::Display, target: &mut T) {
   |            ^^^^^

error[E0599]: no method named `is_quit_event` found for struct `EguiGlium` in the current scope
  --> amdguid/src/backend/glium_backend.rs:79:25
   |
79 |                 if egui.is_quit_event(&event) {
   |                         ^^^^^^^^^^^^^ method not found in `EguiGlium`

error[E0308]: mismatched types
   --> amdguid/src/backend/glium_backend.rs:83:31
    |
83  |                 egui.on_event(&event);
    |                      -------- ^^^^^^ expected `winit::event::WindowEvent<'_>`, found `glutin::event::WindowEvent<'_>`
    |                      |
    |                      arguments to this method are incorrect
    |
    = note: `glutin::event::WindowEvent<'_>` and `winit::event::WindowEvent<'_>` have similar names, but are actually distinct types
note: `glutin::event::WindowEvent<'_>` is defined in crate `winit`
   --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.27.2/src/event.rs:319:1
    |
319 | pub enum WindowEvent<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
note: `winit::event::WindowEvent<'_>` is defined in crate `winit`
   --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.26.1/src/event.rs:211:1
    |
211 | pub enum WindowEvent<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `winit` are being used?
note: method defined here
   --> /tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/egui_glium-0.18.0/src/lib.rs:48:12
    |
48  |     pub fn on_event(&mut self, event: &glium::glutin::event::WindowEvent<'_>) -> bool {
    |            ^^^^^^^^

warning: use of deprecated associated function `glutin::event_loop::EventLoop::<T>::with_user_event`: Use `EventLoopBuilder::<T>::with_user_event().build()` instead.
  --> amdguid/src/backend/glow_backend.rs:46:53
   |
46 |     let event_loop = glutin::event_loop::EventLoop::with_user_event();
   |                                                     ^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0061, E0277, E0308, E0432, E0433, E0599, E0659.
For more information about an error, try `rustc --explain E0061`.
warning: `amdguid` (bin "amdguid") generated 5 warnings
error: could not compile `amdguid` (bin "amdguid") due to 11 previous errors; 5 warnings emitted

and the build process terminates with exitcode 101.

Software versions:

Regards!

Eraden commented 1 year ago

Hi, I'll be making new release plus I'll be working on deploying aur via CI.

Eraden commented 1 year ago

Hi, I checked what must be fixed.

Please change following points:

ThatOneCalculator commented 1 year ago

This has not been fixed, even on nightly. https://github.com/Eraden/amdgpud/issues/62#issuecomment-1823857870