Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

**Missing** /usr/lib/x86_64-linux-gnu/mir/server-platform #72

Open
spongythecake opened this issue Mar 27, 2024 · 10 comments
Open

**Missing** /usr/lib/x86_64-linux-gnu/mir/server-platform #72

spongythecake opened this issue Mar 27, 2024 · 10 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@spongythecake
Copy link

Steps

  1. Build from source
  2. Run /usr/local/bin/miracle-wm
  3. Stderror encountered

The error message provided indicates that a file or directory named /usr/lib/x86_64-linux-gnu/mir/server-platform does not exist on your system.

I can confirm a ls yields a non-existent directory. However, I am unsure what dependencies these relate to.

Full error log

Here is the output log full error:

[2024-03-27 01:01:12.903020] <information> mircommon: Loading modules from: /usr/lib/x86_64-linux-gnu/mir/server-platform
[2024-03-27 01:01:12.903047] < - ERROR - > mircommon: Failed to load libraries from path: /usr/lib/x86_64-linux-gnu/mir/server-platform (error was:/usr/lib/x86_64-linux-gnu/mir/server-platform: No such file or directory)
ERROR: ./src/server/graphics/default_configuration.cpp(253): Throw in function virtual const std::vector<std::shared_ptr<mir::graphics::DisplayPlatform> >& mir::DefaultServerConfiguration::the_display_platforms()
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: Exception while creating graphics platform
ERROR: Dynamic exception type: std::system_error
std::exception::what: /usr/lib/x86_64-linux-gnu/mir/server-platform: No such file or directory

Specs

=== System Specs

  • Ubuntu 23.10 - fresh install
  • x86 arch
@spongythecake
Copy link
Author

It fixed itself with this cmd:

sudo apt install mir-graphics-drivers-desktop

@mattkae
Copy link
Collaborator

mattkae commented Apr 2, 2024

Sorry for the late response. Nice catch though 😄 I will add this as a dependency to the project

@mattkae mattkae self-assigned this Apr 2, 2024
@mattkae mattkae added bug Something isn't working good first issue Good for newcomers labels Apr 2, 2024
@spongythecake
Copy link
Author

I'm happy its a straightforward bug.

Since this issue was labelled "good first issue", I would like to kindly nominate myself to patch this. It would be my first patch here! Any thoughts?

In fixing, my approach is to use dpkg provided by cmake's tooling to detect if package is available. If missing, cmake will raise a typical error, then developer with missing dependencies can take heed.

I think this, in a nutshell, is the way to move forward.

@mattkae
Copy link
Collaborator

mattkae commented Apr 2, 2024

I'm happy its a straightforward bug.

Since this issue was labelled "good first issue", I would like to kindly nominate myself to patch this. It would be my first patch here! Any thoughts?

In fixing, my approach is to use dpkg provided by cmake's tooling to detect if package is available. If missing, cmake will raise a typical error, then developer with missing dependencies can take heed.

I think this, in a nutshell, is the way to move forward.

Yeah that would very be much appreciated 😄 You should be able to follow what we do in https://github.com/mattkae/miracle-wm/blob/master/CMakeLists.txt with the help of pkg_check_modules. Let me know if you run into any trouble there though.

@spongythecake
Copy link
Author

spongythecake commented Apr 5, 2024

The package mir-graphics-drivers-desktop is a metapackage, as per source.

The status of pkgconf is unaffected by the mentioned package being installed or removed. So, in this case I have determined the library presence by searching these specified paths. For example:

find_library(MIR_SERVER_GRAPHICS_PLATFORM
    NAMES graphics-gbm-kms renderer-egl-generic server-virtual server-x11
    REQUIRED
)

message(STATUS "Found graphics library: ${MIR_SERVER_GRAPHICS_PLATFORM}")

Therefore, I am posting here because I think this is the correct solution but require assistance.

On a side-note, there are also some platform checks in the mir library, it might be okay to reuse them, however this is beyond my level of expertise with regards to Mir.

Actually the above config complains when you omit the version number e.g. graphics-gbm-kms.so.21. Considering version numbers will change, it isn't a flexible solution.

In other words, pkg_check_modules didn't work for me and I resorted to using find_library, despite it feeling like a rigid approach.

@mattkae
Copy link
Collaborator

mattkae commented Apr 16, 2024

The package mir-graphics-drivers-desktop is a metapackage, as per source.

The status of pkgconf is unaffected by the mentioned package being installed or removed. So, in this case I have determined the library presence by searching these specified paths. For example:

find_library(MIR_SERVER_GRAPHICS_PLATFORM
    NAMES graphics-gbm-kms renderer-egl-generic server-virtual server-x11
    REQUIRED
)

message(STATUS "Found graphics library: ${MIR_SERVER_GRAPHICS_PLATFORM}")

Therefore, I am posting here because I think this is the correct solution but require assistance.

On a side-note, there are also some platform checks in the mir library, it might be okay to reuse them, however this is beyond my level of expertise with regards to Mir.

Actually the above config complains when you omit the version number e.g. graphics-gbm-kms.so.21. Considering version numbers will change, it isn't a flexible solution.

In other words, pkg_check_modules didn't work for me and I resorted to using find_library, despite it feeling like a rigid approach.

I also think this is the correct solution. I believe that we define no *.pc file in this scenario, so it makes sense why pkg_check_modules isn't picking that up. I probably failed to realize this since I usually have those libraries installed.

@mattkae
Copy link
Collaborator

mattkae commented Apr 16, 2024

Also, sorry for getting back to this so late 😄 Would you like to open a PR for this? I believe the find_library solution is the best in this case

spongythecake added a commit to spongythecake/miracle-wm that referenced this issue Apr 18, 2024
This commit brings an extra library check in CMakeLists.txt related to mir graphics drivers desktop. A hardcoded known-library-list was introduced and used with find_library. Also, the build output informs the user of the missing libraries. Fixes miracle-wm-org#72
@spongythecake
Copy link
Author

So regarding the wildcard in find_library. It is not supported. See screengrab.

From my POV, albeit very rigid, a "best known list" is a reasonable solution.

Screenshot from 2024-04-20 07-49-43

Curious to explore more options if you've got any suggestions.

@AlanGriffiths
Copy link

I don't think there's a simple fix in miracle-wm, or in Mir.

  1. The error message isn't very helpful - that could be fixed fairly easily by providing more information.
  2. The correct action to resolve the problem isn't clear.

The error message should include something like: "Failed to load Mir any "graphics platform" libraries, please install the appropriate platforms for your system: For example, mir-graphics-drivers-desktop or mir-graphics-drivers-desktop."

Detecting the right platform packages automatically isn't easy. On Ubuntu and Debian Mir provides:

  • mir-platform-graphics-eglstream-kms,
  • mir-platform-graphics-gbm-kms,
  • mir-platform-graphics-virtual,
  • mir-platform-graphics-wayland; and,
  • mir-platform-graphics-x

and these meta packages, for desktop-like systems, that group the above:

  • mir-graphics-drivers-desktop; and,
  • mir-graphics-drivers-nvidia.

But, from the Mir perspective, there are also "third-party" platforms that support other graphics stacks which is why none are installed by default. (Probably not a problem for miracle-wm, which could arguably make "all of the above" a default.)

Also note, that the installation location varies between systems and installation method (e.g. make install installs under /usr/loca/lib) and that the .so names can vary between Mir versions.

@Conan-Kudo
Copy link
Collaborator

I kind of decided in Fedora to sidestep this whole mess and ship the server platform libraries in the mir-server-libs package... 😅

But if Mir were to be packaged in openSUSE or Mageia, for example, then it would get some very odd names for the packages based on their sonames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants