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

Library libwayland-egl.so could not be loaded #94

Closed
antmoth opened this issue Aug 18, 2018 · 12 comments
Closed

Library libwayland-egl.so could not be loaded #94

antmoth opened this issue Aug 18, 2018 · 12 comments
Milestone

Comments

@antmoth
Copy link

antmoth commented Aug 18, 2018

I was trying to work through the tutorial at turtle.rs. I wrote out and compiled the "draw a circle" tutorial and I received this error:

    Finished dev [unoptimized + debuginfo] target(s) in 0.15s          
     Running `target/debug/turtle-toys`                                
thread 'main' panicked at 'Library libwayland-egl.so could not be loaded.', libcore/option.rs:1000:5                                           
note: Run with `RUST_BACKTRACE=1` for a backtrace.                     

A couple of existing issues on other projects suggest that the solution is to update the versions of the dependencies that interact with wayland, which in this case I think would be piston_window. (The problem is likely that I have these installed, but not the exact filename it is looking for:

/usr/lib/libwayland-egl.so.1                                            
/usr/lib/libwayland-egl.so.1.0.0                                        
/usr/lib64/libwayland-egl.so.1                                          
/usr/lib64/libwayland-egl.so.1.0.0   

)

I did first check that I had all relevant libs installed, and tried symlinking the path as well.

@sunjay
Copy link
Owner

sunjay commented Aug 18, 2018

Hi! Thank you for reporting this! Sorry it isn't working on your platform. Could you provide more information about the system you're working on?

The output of rustc --version --verbose would be great as well. :)

@sunjay
Copy link
Owner

sunjay commented Aug 18, 2018

This issue also seems relevant. Let me know if anything helps!

tensor-programming/snake-tutorial#1

@antmoth
Copy link
Author

antmoth commented Aug 18, 2018

I am running Fedora 28. I believe I'm using Wayland.
rustc --version --verbose:

rustc 1.30.0-nightly (d767ee116 2018-08-15)
binary: rustc
commit-hash: d767ee11616390d128853a06f5addb619e79213f
commit-date: 2018-08-15
host: x86_64-unknown-linux-gnu
release: 1.30.0-nightly
LLVM version: 7.0

I was honestly just going to try updating the dependency and see if that fixed it without breaking anything else, but figured I should file an issue as a first step.

@antmoth
Copy link
Author

antmoth commented Aug 18, 2018

It looks like updating the dependency creates some effort, because piston_window added a new type Hat to the Button enum. I'm up for trying to add Hat if it ends up fixing the Wayland lib issue.

@sunjay
Copy link
Owner

sunjay commented Aug 18, 2018

That would be great! Thank you! Please let me know if you run into anything or get stuck.

I mentioned yesterday that there was this comment that might provide some hints about updating piston: #67 (comment)

Let me know if you need anymore information about anything.

Nice to meet you yesterday and thanks for helping out!

@sunjay
Copy link
Owner

sunjay commented Aug 22, 2018

Hi @estelendur! Is there anything I can do to help you resolve this? Have you had a chance to take a look?

Thanks! 😄

@antmoth
Copy link
Author

antmoth commented Aug 29, 2018

Hi! I'm sorry, I haven't had much time to code outside of work. I did get pointed to a way to fix the Wayland-specific breakage by adding an environment variable:

    // Disable Wayland support. It doesn't take advantage of window decorations provided by the
   // compositor which is annoying for windowed mode.
   env::set_var("WAYLAND_DISPLAY", "wayland-999");

I'm not sure if there's a good way to set this in the library?

@antmoth antmoth closed this as completed Aug 29, 2018
@antmoth antmoth reopened this Aug 29, 2018
@antmoth
Copy link
Author

antmoth commented Aug 29, 2018

ack, learning github still and clicking the wrong buttons

@sunjay
Copy link
Owner

sunjay commented Aug 29, 2018

That's interesting! Could you try setting that in the code before we create the window? Does it solve the crash? What does the window end up looking like?

We create the window in the following code. You would need to add that line just before these ones.

turtle/src/renderer.rs

Lines 73 to 86 in 05a5fa1

let window_settings = WindowSettings::new(&*state.drawing().title, (state.drawing().width, state.drawing().height))
.exit_on_esc(true)
.opengl(OpenGL::V3_3)
.srgb(false);
// Need to create a GlutinWindow through WindowSettings::build() and then pass that to
// PistonWindow::new(). PistonWindow has a hardcoded `srgb(true)` in its implementation
// of BuildFromWindowSettings so we can't build() to a PistonWindow directly. We bypass
// BuildFromWindowSettings by calling PistonWindow::new() with the properly configured
// GlutinWindow.
// Source: https://github.com/PistonDevelopers/piston/issues/1202#issuecomment-368338909
// NOTE: This might lead to bugs because the shaders assume a linear color space (sRGB).
// Source: https://github.com/PistonDevelopers/piston/issues/1202#issuecomment-338147900
let mut window: PistonWindow = PistonWindow::new(OpenGL::V3_3, 0, window_settings.build().expect("bug: could not build window"));

Please include the comments you posted with that line of code and note that this is something we need to have until we upgrade to the latest piston and verify that it doesn't break on your platform. (please list your particular platform in the comment)

I am okay with this change if it solves the issue. Please open a PR if you find that it works. I'll test it locally here too to see if it breaks anything. We can always do a platform specific cfg to only do that when needed.

Do you forsee any problems that this might cause?

@sunjay
Copy link
Owner

sunjay commented Apr 24, 2019

Hi @estelendur! Sorry for taking so long to get around to this issue. Life has been busy!

I went and updated piston to the latest version. They seem to have made a lot of improvements. Could you test the latest master branch of turtle on your machine to see if it works?

  1. Pull the master branch of turtle: https://github.com/sunjay/turtle
  2. cargo run --example circle
  3. cargo run --example maze

Let me know if everything looks good. Thanks! 😄

@antmoth
Copy link
Author

antmoth commented Apr 24, 2019

I'm sorry I didn't get around to this either :( everything works great now!

@antmoth antmoth closed this as completed Apr 24, 2019
@sunjay
Copy link
Owner

sunjay commented Apr 24, 2019

Awesome! I'm very glad to hear that it works! 🎉

I'm sorry I didn't get around to this either :(

No problem at all. Life is busy. :)

@sunjay sunjay added this to the 1.0.0 - MVP milestone May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants