amdgpud icon indicating copy to clipboard operation
amdgpud copied to clipboard

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.

Open dreirund opened this issue 7 months ago • 3 comments

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"
  • My checkout of https://github.com/Eraden/amdgpud is at the following commit: git log -n1:

    commit 9242681bb2726f41d867094f6c3e2b8a1447fa9d (grafted, HEAD -> main, origin/main, origin/HEAD)
    Author: Adrian Woźniak <[email protected]>
    Date:   Thu Aug 25 15:12:11 2022 +0200
    
        Change button to label
    
  • Terminal output from cargo fetch --locked --target "$CARCH-unknown-linux-gnu":

    warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
    note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
    note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
        Updating crates.io index
      Downloaded either v1.7.0
    [...]
      Downloaded 239 crates (34.4 MB) in 46.31s (largest was `shaderc-sys` at 6.8 MB)
    
  • Terminal output from cargo build --release --frozen --all-features --target="$CARCH-unknown-linux-gnu":

    warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
    note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
    note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
      Compiling libc v0.2.132
    [...]
     Compiling nix v0.23.1
     Compiling amdfan v0.1.0 (/tmp/makepkg/build/amdgpud-git/src/amdgpud/amdfan)
     Compiling amdgui-helper v1.0.10 (/tmp/makepkg/build/amdgpud-git/src/amdgpud/amdgui-helper)
     Compiling amdportsd v0.1.0 (/tmp/makepkg/build/amdgpud-git/src/amdgpud/amdportsd)
     Compiling amdfand v1.0.13 (/tmp/makepkg/build/amdgpud-git/src/amdgpud/amdfand)
     Compiling amdmond v1.0.10 (/tmp/makepkg/build/amdgpud-git/src/amdgpud/amdmond)
     Compiling amdvold v1.0.10 (/tmp/makepkg/build/amdgpud-git/src/amdgpud/amdvold)
     [...]
    

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:

  • cargo --version: cargo 1.73.0
  • rustc --version: rustc 1.73.0 (cc66ad468 2023-10-03) (Arch Linux rust 1:1.73.0-1)

Regards!

dreirund avatar Nov 08 '23 19:11 dreirund

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

Eraden avatar Nov 18 '23 19:11 Eraden

Hi, I checked what must be fixed.

Please change following points:

  • stable rust doesn't work for this project, please change to export RUSTUP_TOOLCHAIN=nightly
  • GUI applications are split to amdguid-wayland, amdguid-glow and amdguid-glium. Please choose your default and copy binary as amdguid, then install it

Eraden avatar Nov 22 '23 10:11 Eraden

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

ThatOneCalculator avatar Nov 23 '23 06:11 ThatOneCalculator