-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
minimal-sdl2 - Could not retrieve any SDL2 window info on Ubuntu 19.10 #53
Comments
This panic message is from Beryllium (a safe wrapper for libsdl2), which depends on Fermium (an unsafe binding for libsdl2). This happens when Have you installed libsdl2? |
$ apt policy libsdl2-dev
libsdl2-dev:
Installed: 2.0.10+dfsg1-1ubuntu1
Candidate: 2.0.10+dfsg1-1ubuntu1
Version table:
*** 2.0.10+dfsg1-1ubuntu1 500
500 http://pl.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
100 /var/lib/dpkg/status Do I need to install sth else? |
The Try the fermium example: https://github.com/Lokathor/fermium/tree/master/examples E.g.:
|
Also try on the And if that still works fine, then move on to trying the beryllium example (tag If all of that still works, then I'm at a complete loss, because the |
|
oh, beryllium |
Our Line 99 in 7701ac2
v1.3.0 .
And |
fermium seems to work: ~/personal_projects/rust/vendor/fermium (master)$ git co v0.1.3
Note: switching to 'v0.1.3'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 0debe20 (cargo-release) version 0.1.3
~/personal_projects/rust/vendor/fermium ((v0.1.3))$ cargo run --example window
Updating crates.io index
Compiling fermium v0.1.3 (/home/roman/personal_projects/rust/vendor/fermium)
Compiling cfg-if v0.1.10
Finished dev [unoptimized + debuginfo] target(s) in 3.29s
Running `target/debug/examples/window`
Quit after 5870 milliseconds.
~/personal_projects/rust/vendor/fermium ((v0.1.3))$ git co v0.1.2
Previous HEAD position was 0debe20 (cargo-release) version 0.1.3
HEAD is now at 0db5649 (cargo-release) version 0.1.2
~/personal_projects/rust/vendor/fermium ((v0.1.2))$ cargo run --example window
Compiling fermium v0.1.2 (/home/roman/personal_projects/rust/vendor/fermium)
Finished dev [unoptimized + debuginfo] target(s) in 1.57s
Running `target/debug/examples/window`
Quit after 2394 milliseconds. |
beryllium also seems to work: ~/personal_projects/rust/vendor/beryllium (master)$ cargo run --example basic_window
Compiling beryllium v0.2.0-alpha.5 (/home/roman/personal_projects/rust/vendor/beryllium)
Finished dev [unoptimized + debuginfo] target(s) in 0.33s
Running `target/debug/examples/basic_window`
~/personal_projects/rust/vendor/beryllium (master)$ git co v0.1.3
Note: switching to 'v0.1.3'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at cf59dd5 (cargo-release) version 0.1.3
~/personal_projects/rust/vendor/beryllium ((v0.1.3))$ cargo run --example blank_window
Updating crates.io index
Compiling beryllium v0.1.3 (/home/roman/personal_projects/rust/vendor/beryllium)
Finished dev [unoptimized + debuginfo] target(s) in 1.47s
Running `target/debug/examples/blank_window`
Quitting the program after 2503 milliseconds.
~/personal_projects/rust/vendor/beryllium ((v0.1.3))$ git co v0.1.2
Previous HEAD position was cf59dd5 (cargo-release) version 0.1.3
HEAD is now at feb6f23 (cargo-release) version 0.1.2
~/personal_projects/rust/vendor/beryllium ((v0.1.2))$ cargo run --example blank_window
Compiling beryllium v0.1.2 (/home/roman/personal_projects/rust/vendor/beryllium)
Finished dev [unoptimized + debuginfo] target(s) in 0.45s
Running `target/debug/examples/blank_window`
Quitting the program after 2007 milliseconds. |
Another question, do you know if it's using Wayland or X11? I've seen weird problems with Wayland before (#29). You can force sdl2 to use X11 with an environment variable:
Other values are documented: https://wiki.libsdl.org/FAQUsingSDL#How_do_I_choose_a_specific_video_driver.3F |
~/personal_projects/rust/vendor/parasyte/pixels (master)$ SDL_VIDEODRIVER=x11 cargo run --example minimal-sdl2 --features="minimal-sdl2"
Finished dev [unoptimized + debuginfo] target(s) in 0.15s
Running `target/debug/examples/minimal-sdl2`
thread 'main' panicked at 'Could not retrieve any SDL2 window info, and Osspial wrote the trait to be infallible despite that clearly not always being the case, so now you got this panic. h
ttps://github.com/rust-windowing/raw-window-handle/issues/new', /home/roman/.cargo/registry/src/github.com-1ecc6299db9ec823/beryllium-0.1.2/src/window.rs:152:7
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. |
~/personal_projects/rust/vendor/fermium ((v0.1.3))$ cargo run --example window
Updating crates.io index
Compiling fermium v0.1.3 (/home/roman/personal_projects/rust/vendor/fermium)
error: failed to run custom build command for `fermium v0.1.3 (/home/roman/personal_projects/rust/vendor/fermium)`
Caused by:
process didn't exit successfully: `/home/roman/personal_projects/rust/vendor/fermium/target/debug/build/fermium-2b040b905b7694d6/build-script-build` (exit code: 101)
--- stdout
use_bindgen_bin: false
link_dynamic: true
link_static: false
bind_SDL2_2_0_9: false
bind_SDL2_2_0_10: false
cargo:rustc-env=TARGET=x86_64-unknown-linux-gnu
cargo:rustc-env=BIND_PATCH_LEVEL=8
--- stderr
thread 'main' panicked at 'couldn't run `sdl2-config`, please properly install SDL2.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace. |
I'm at a loss for now. I'll try to reproduce the issue locally when I get home. Anything you can do to help debug in the meantime will be greatly appreciated. |
Oh, this last error was because I have done |
Any news on that? |
@rofrol Could you try the |
Ping @rofrol Have you been able to try this again since the last update? |
I still have this problem on master. (Manjaro) |
I do not know what the problem could be. No way to reproduce this on my end. Anyone who can reproduce this want to step through the code with a debugger? There should not be many differences between the |
Did a bit of digging, as with OP fermium::SDL_GetWindowWMInfo() returns false. |
This may actually be a bug in The default impl for According to the libsdl wiki:
This suggests that |
@willcrutchley @rofrol If either of you would like to try, please update diff --git a/examples/minimal-sdl2/Cargo.toml b/examples/minimal-sdl2/Cargo.toml
index dae1a53..0d6984b 100644
--- a/examples/minimal-sdl2/Cargo.toml
+++ b/examples/minimal-sdl2/Cargo.toml
@@ -10,7 +10,7 @@ optimize = ["log/release_max_level_warn"]
default = ["optimize"]
[dependencies]
-beryllium = { version = "0.3.1", features = ["extern_crate_raw_window_handle"] }
+beryllium = { git = "https://github.com/Lokathor/beryllium.git", rev = "9375bbd2dbc8c35d5f669181a9d525315f20ba40", features = ["extern_crate_raw_window_handle"] }
env_logger = "0.7.1"
log = "0.4.8"
pixels = { path = "../.." } Lokathor was kind enough to add the SDL version. |
Sorry I missed this. Works great with the new version of beryllium, thank you! |
This issue seems to be still present on Ubuntu 20, even if all dependencies were installed. May be because of Rust Nightly? I don't know which version of the compiler the OP was using at the time. |
@aegroto I'll have to ask you to please go through all of the troubleshooting steps presented earlier in this thread to determine whether this is the same issue or something else. FWIW, it is unlikely to be caused by your compiler version. My first suspect would be an environmental issue (e.g. perhaps
Also, if you find that this is a new problem and that all signs point to the bug being in this repo, please open a new issue so we can track it separately. |
Updating the beryllium version to the commit mentioned above solves the issue, stills the example doesn't work out-of-the-box like it's supposed to do. |
Dep installed with:
sudo apt install libsdl2-dev
Should I install something else? I have found this links:
The text was updated successfully, but these errors were encountered: