-
Notifications
You must be signed in to change notification settings - Fork 473
Upgrade to SDL 2.0.9 #817
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
Upgrade to SDL 2.0.9 #817
Conversation
It looks like the failing test is flaky:
makes the test reliably fail:
I'm pushing a fix. |
@Cobrand ready for review! |
I'll jump on this after work, thanks! |
@rasky shouldn't also the embedded headers be updated? |
@mattiascibien I'm not sure what the embedded headers are used for, I grepped around but could not find a reference. Any pointers? This PR updates the version that is shipped when activating the |
The headers are used with the bindgen feature, when you don't use the use-pkgconfig feature. So they're never used in bundled. |
So basically they are used when there is now way to detect where they are installed? Is that the rationale? |
That is correct, but for now there are no ways for the build.rs to know if you have SDL2 installed without explicitely enabling the feature "use-pkgconfig", which is disabled by default even in linux environments. In the end if you don't feel up to it (updating the headers), it's a relatively minor matter that we could take care of only later. It's up to you to decide, it's your PR. |
As per the comment in #808 (comment), please remove:
After that, I'll ping someone with macOS to test whether the changes break anything on macOS or not. Otherwise, it's a straightforward PR so looks good to me. |
No it’s ok I was just trying to understand the context. If I update the embedded headers to 2.0.9, what happens if somebody uses them against a previous version? Wouldn’t bindgen generate bindings for functions that then don’t exist? |
If someone uses the new headers with an old version of SDL2, they'll get either a linker error, or a runtime error (depending if the old version is on the host or the client, if both, they'll get a linker error). If you ever encounter this problem, you can use the "bindgen" + "use-pkgconfig" feature to use both the pkgconfig headers for the bindgen generation. This time, if you try to use sdl2 functions (such as vulkan) that are not in the old version of SDL2, you'll get a compile time error (linker error). If you don't have access to pkg-config, there is an env variable that allows you to override the default headers ( |
Done, I've pushed a commit that upgrades embedded headers to 2.0.9. |
FWIW, I work on MacOS, and I've personally tested this PR only on MacOS, but of course double checks always help (especially since I've not personally experimented the problem that caused the reversion). |
I've made this comment in case you hadn't seen it the first time. By the way, you'll need to rebase upon master, I've merged another PR that changes build.rs |
@Cobrand done, removed the patch and rebased. |
LGTM! I'll merge whenever CI's ready |
Upgrade to SDL 2.0.9
Among many other things, this fixes an annoying bug on MacOS (where all new SDL windows are full black until moved), and adds Vulkan support.
Fixes #808
Closes #816
As explained in #808 (comment), SDL 2.0.9 contains the patch that fixes build on Mac. Verified that I can run
cargo build --features=bundled,static-link
on Mac.