Closed mcepl closed 2 years ago
Hey @mcepl, it's not 100% clear from the build logs since pytest isn't set to report captured print()
output (a few tests print messages describing feature support in the linked SDL2 binaries), but this looks like SDL2_mixer
either a) wasn't built with MP3 support, or b) has MP3 support broken for whatever reason.
I can make a patch to skip the MP3-dependent tests if MP3 support is absent in a given Mixer binary, but you may also want to check on openSUSE's current Mixer package to make sure MP3 support isn't unexpectedly broken.
Hmm, I am really not a specialist on SDL2 (I work on Python packages for SUSE), so I am not sure what to think about this ./configure
line of SDL2_mixer
:
./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu
--program-prefix= --disable-dependency-tracking --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
--libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib
--mandir=/usr/share/man --infodir=/usr/share/info --disable-music-ogg-stb
--enable-music-ogg-vorbis --disable-music-flac-drflac
--enable-music-flac-libflac --disable-music-mp3-drmp3 --enable-music-mp3-mpg123
--disable-music-mod-modplug --enable-music-mod-xmp
--disable-music-mod-xmp-shared --disable-music-midi-fluidsynth-shared
--disable-music-ogg-shared --disable-music-flac-shared
--enable-music-mp3-mpg123-shared --disable-static
@mcepl Thanks, that helps a lot! That tells me Mixer is being built with dynamic support for libmpg123
as an MP3 decoder backend, but I can't find a reference to that library in the build log so it's probably a question of Mixer being unable to read MP3 files without that library.
Since I guess it's perfectly valid for a given distro to make mp3 support dynamic/optional, I'll count this as a valid bug in PySDL2's test suite. Here's a patch that should fix this for now, and I'll make sure it's addressed in the next release!
Hmm, I don’t know what’s wrong, but it seems your patch didn’t help at all
@mcepl Sorry for the delay, been taking some time off! Can you run the tests locally with pytest -vl -rxXP sdl2/test/sdlmixer_test.py
and send me the logs? That'll give me a much more informative look at what actually's going wrong with those tests so I can make a proper fix.
Interesting, so it is missing video, not audio device. And yes, I have my serious doubts that we have any video devices accessible in our build machines. Or is it some missing library supporting video?
@mcepl Looks like some tests are failing in that last log that were working fine in your earlier ones: can you try re-running with the following environment variables set? These are what I use for headless CI testing:
SDL_VIDEODRIVER=dummy
SDL_AUDIODRIVER=dummy
SDL_RENDER_DRIVER=software
Also, based on the output I was right that MP3 support is missing, so unless I missed something the patch I made should detect that and skip all MP3-requiring tests (the ones that were failing in the original log).
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy SDL_RENDER_DRIVER=software
Actually, I had these variables set in my SPEC file (so you should see them in the log from this comment), but when I set in the build environment and run your command again, I got pretty much the same
Ahhh I see, I wrote my patch wrong: apparently Mix_Init
still indicates that MP3 support is loaded correctly even if the required dynamic library isn't available. I rewrote the "check for MP3 support" logic to hopefully be more reliable, let me know if this works!
Yes, that helped. I don’t need to skip those few tests.
Great, so it's fully working now? Or are there any other issues to fix?
Yes, this problem is gone. We are still skipping plenty of tests. See our SPEC file from line 73 onwards, but I guess it is mostly given some old libs we use or weird architectures you don’t support.
@mcepl Glad to hear it! Also, some of those skipped tests (apart from the PowerInfo segfault) look like bugs that have been fixed in the past few PySDL2 releases (e.g. certain tests failing on big-endian, I actually set up Void PPC64 on my old PowerMac G5 to sort that out), so you may be able to remove those lines if you want. There could be bugs I haven't caught yet, though.
@mcepl Glad to hear it! Also, some of those skipped tests (apart from the PowerInfo segfault) look like bugs that have been fixed in the past few PySDL2 releases (e.g. certain tests failing on big-endian, I actually set up Void PPC64 on my old PowerMac G5 to sort that out), so you may be able to remove those lines if you want. There could be bugs I haven't caught yet, though.
And what do you think? I don’t have to exclude ANY test and it still passes. Thank you, very much.
Just a nit:
[ 109s] python310-PySDL2.noarch: W: hidden-file-or-dir /usr/share/doc/packages/python310-PySDL2/doc/.DS_Store
I don’t think you want to leave these around.
@mcepl Ah yep, whoops! I thought I set up things to exclude those, but apparently it didn't work. I'll try to fix that for future releases.
Fix included in PySDL2 0.9.14, closing this!
When packaging the package (from tarball 0.9.13 from PyPI) I get these errors when running the test suite:
Complete build log with all versions of packages used and steps taken.
Platform (if relevant):