-
Notifications
You must be signed in to change notification settings - Fork 463
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
Build fails on linux with 'error: ‘SIO_DEVANY’ undeclared' #777
Comments
I have looked into it, and for your second problem it looks like SDL 2.0.8 outputs "libSDL2maind.a" and "libSDL2d.a" instead of "libSDL2main.a" and "libSDL2.a" like it used to. I have a branch with your changes and #765 as well, will post it soon, would you mind having a look at it then? |
@bgourlie Can you check this branch and tell me if it works? https://github.com/Rust-SDL2/rust-sdl2/tree/unstable-build-rs-work If possible, try to test it on as many platforms as you can, I only have a linux handy personally. |
I'll do some testing on Windows and OS X and let you know what I find. I had a linux partition on my desktop as well but it appears to be borked. Thanks for looking into this! |
Tested on Window 10 and OS X. Examples run, and there is only a single test regression on both platforms:
|
I've actually got the same error with
|
One more thing: I merged your changes into my branch and added another commit. It turns out we still need to link |
So the "d" stands for debug! I see. Maybe it would be best to compile directly sdl2 in release mode everytime with the "bundled" feature. It doesn't really make sense to compile in debug mode SDL2 when we are in debug mode ourselves, does it? |
To be honest, I'm not sure! I'm relatively new to the world of compiled languages, and am unfamiliar with release/debug build conventions. What you suggest seems totally reasonable. I'll update my branch to always build SDL in release mode. |
Would y'all mind popping open a PR for this? I'm pinned to the fork @bgourlie put up to keep travis happy, and I'd like to note the PR number in a comment next to the pin so I can come back and clean it up later. Copypasta friendly if anybody else is using bundled builds: # Override sdl2 to get 2.0.8 (fixes libsndio missing define in travis) rust-sdl2#777
[patch.crates-io]
sdl2 = { git = 'https://github.com/bgourlie/rust-sdl2', branch="sdl-upgrade" } |
Related thought — @Cobrand how would you feel about your travis builds using the If you're amenable, I'll make a PR for that. |
I think that was actually planned at first -- now I can't really say if there is a good reason we didn't do that, or just we didn't have the time do change travis to do that. Please, feel free to write a PR! They are always welcome. For this ticket, we're so close from merging this, we just have to figure out why |
#781 adds a travis matrix dimension on environment variables and promotes feature flags to that, so that ought to take care of CI for this use case in the future. I left static-link off for now since it's broken in trunk (hence this issue) but it's easy enough to add once this is fixed. |
After some testing I can confirm that this test that fails:
is caused by upgrading from 2.0.5 to 2.0.6 or higher (in our case 2.0.8). I'm trying to figure out if this is a bug, if the test needs some changes or if the bindings need some changes themselves now. It has been tested with the master branch, by changing the bundled version from 2.0.5 (which works) to 2.0.6 (which fails). Note that the SDL2.so libraries on my system were messing with dynamic linking, so I had to resort to static linking, but the result should be the same. |
The implementation of the source definitely changed... I think I've got an idea to fix this test, however there is still something that surprises me with the converted audio: #[cfg(test)]
mod test {
use super::{AudioCVT, AudioFormat};
#[test]
fn test_audio_cvt() {
use std::iter::repeat;
// 0,1,2,3, ...
let buffer: Vec<u8> = (0..255).collect();
// 0,0,1,1,2,2,3,3, ...
let new_buffer_expected: Vec<u8> = (0..255).flat_map(|v| repeat(v).take(2)).collect();
let cvt = AudioCVT::new(AudioFormat::U8, 1, 44100, AudioFormat::U8, 2, 44100).unwrap();
assert!(cvt.is_conversion_needed());
// assert_eq!(cvt.capacity(255), 255*2);
let new_buffer = cvt.convert(buffer);
assert_eq!(new_buffer.len(), new_buffer_expected.len());
assert_eq!(new_buffer[0..256], new_buffer_expected[0..256]); The test above fails with:
(while it succeeded before). AudioConvert now outputs 4 times "64" instead of 2 times, but I don't see any reason why it does that. As a result the last two 127, 127 are truncated while they shoudn't be. I tested with 48000 as a frequency to make sure this wasn't that. I will try to post this "bug" upstream, but in the meantime be aware that AudioCVT may not work very well. You may want to use something like https://crates.io/crates/sample to help you convert audio if you're not confident SDL2 does a good job with it. |
I posted this weird behavior upstream, I hope we get an answer soon! https://discourse.libsdl.org/t/change-of-behavior-in-audiocvt-sdl-convertaudio-from-2-0-5-to-2-0-6/24682 I'll try to fix the test suite in the meantime. |
This is causing my travis-ci build to fail, and occurs when building with features
bundled
andstatic-link
(full build output here). SDL fixed this issue here, but the version that rust-sdl2 depends on doesn't include the fix.I have a branch that upgrades SDL to 2.0.8 here, but my build now fails with a different error, which I'm not sure is a regression relative to the original issue or a followup issue that needs addressing:
You can find the full build output here
The text was updated successfully, but these errors were encountered: