Skip to content

Build failure: python3Packages.pysdl2 on *-darwin (fixed upstream by sdl2-compat) #402811

@Rhys-T

Description

@Rhys-T

Nixpkgs version

  • Unstable (25.05)

Steps to reproduce

With flakes:

nix build 'nixpkgs#python3Packages.pysdl2'

With channels:

NIX_PATH='nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz' \
    nix-build '<nixpkgs>' -A python3Packages.pysdl2

Can Hydra reproduce this build failure?

Yes, Hydra can reproduce this build failure.

Link to Hydra build job

x86_64: https://hydra.nixos.org/build/295906100 aarch64: https://hydra.nixos.org/build/295904613

Relevant log output

[The actual build and install phases run okay, but then:]
Running phase: pytestCheckPhase
Executing pytestCheckPhase
pytest flags: -m pytest -k not\ \(test_SDL_GetPrefPath\)\ and\ not\ \(test_SDL_AddDelHintCallback\)\ and\ not\ \(test_SDL_HasIntersectionF\)\ and\ not\ \(test_SDL_IntersectFRect\)\ and\ not\ \(test_SDL_UnionFRect\)\ and\ not\ \(test_SDL_EncloseFPoints\)\ and\ not\ \(test_SDL_IntersectFRectAndLine\)\ and\ not\ \(test_SDL_GetSetTextureScaleMode\)\ and\ not\ \(test_init\)\ and\ not\ \(test_logical_size\)\ and\ not\ \(test_copy\)\ and\ not\ \(test_create_sprite\)\ and\ not\ \(test_create_software_sprite\)\ and\ not\ \(test_create_texture_sprite\)\ and\ not\ \(test_from_image\)\ and\ not\ \(test_from_surface\)\ and\ not\ \(test_from_text\)\ and\ not\ \(test_SDL_Init\)\ and\ not\ \(test_SDL_InitSubSystem\)\ and\ not\ \(test_SDL_SetWindowIcon\)
============================= test session starts ==============================
platform darwin -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0
rootdir: /private/tmp/nix-build-python3.13-pysdl2-0.9.17-unstable-2025-04-03.drv-0/source
configfile: pytest.ini
collected 1101 items / 59 deselected / 1 skipped / 1042 selected               

sdl2/test/audio_test.py .......ssss.........sssssssssssssssssssssss      [  4%]
sdl2/test/blendmode_test.py s                                            [  4%]
sdl2/test/clipboard_test.py s.                                           [  4%]
sdl2/test/cpuinfo_test.py ....................ss                         [  6%]
sdl2/test/endian_test.py .....                                           [  7%]
sdl2/test/error_test.py ..                                               [  7%]
sdl2/test/events_test.py .............................ssssssssssssssss   [ 11%]
sdl2/test/filesystem_test.py .                                           [ 11%]
sdl2/test/gamecontroller_test.py ss.........s....................sss..ss [ 15%]
ssssssssss.....ss                                                        [ 16%]
sdl2/test/guid_test.py ..                                                [ 17%]
sdl2/test/hidapi_test.py ...ssssssssss                                   [ 18%]
sdl2/test/hints_test.py .......                                          [ 19%]
sdl2/test/joystick_test.py .........................................s... [ 23%]
...s.                                                                    [ 23%]
sdl2/test/keyboard_test.py .................                             [ 25%]
sdl2/test/locale_test.py .                                               [ 25%]
sdl2/test/log_test.py ............                                       [ 26%]
sdl2/test/metal_test.py xxx                                              [ 27%]
sdl2/test/mouse_test.py sssssssssssssssss                                [ 28%]
sdl2/test/pixels_test.py .............................                   [ 31%]
sdl2/test/platform_test.py F                                             [ 31%]
sdl2/test/power_test.py .                                                [ 31%]
sdl2/test/rect_test.py ....................................              [ 35%]
sdl2/test/render_test.py ............s.......sssss....sss......sssssssss [ 39%]
ssssssssss..sssssss.                                                     [ 41%]
sdl2/test/rwops_test.py ..s.............................                 [ 44%]
sdl2/test/sdl2ext_algorithms_test.py ....                                [ 45%]
sdl2/test/sdl2ext_array_test.py ............                             [ 46%]
sdl2/test/sdl2ext_color_test.py .............................            [ 48%]
sdl2/test/sdl2ext_displays_test.py .s...ss                               [ 49%]
sdl2/test/sdl2ext_draw_test.py ...                                       [ 49%]
sdl2/test/sdl2ext_ebs_test.py ............                               [ 51%]
sdl2/test/sdl2ext_events_test.py ......                                  [ 51%]
sdl2/test/sdl2ext_font_test.py ..................                        [ 53%]
sdl2/test/sdl2ext_image_test.py ......                                   [ 53%]
sdl2/test/sdl2ext_input_test.py ......                                   [ 54%]
sdl2/test/sdl2ext_mouse_test.py .....s                                   [ 55%]
sdl2/test/sdl2ext_msgbox_test.py ..ss                                    [ 55%]
sdl2/test/sdl2ext_particles_test.py ......                               [ 56%]
sdl2/test/sdl2ext_pixelaccess_test.py ....                               [ 56%]
sdl2/test/sdl2ext_renderer_test.py .ss......sss                          [ 57%]
sdl2/test/sdl2ext_resources_test.py ..........                           [ 58%]
sdl2/test/sdl2ext_sprite_test.py .........                               [ 59%]
sdl2/test/sdl2ext_spritesystem_test.py s.ss..ss                          [ 60%]
sdl2/test/sdl2ext_surface_test.py .                                      [ 60%]
sdl2/test/sdl2ext_test.py ...                                            [ 60%]
sdl2/test/sdl2ext_uisystem_test.py ssssssssssss                          [ 61%]
sdl2/test/sdl2ext_window_test.py ..sss....                               [ 62%]
sdl2/test/sdlgfx_test.py ..x.ssssssssssssssssssssssssssssssssss....      [ 66%]
sdl2/test/sdlimage_test.py ........s.....s...........s.................. [ 70%]
s...........                                                             [ 72%]
sdl2/test/sdlmixer_test.py ....s......sss..........sssssssssssssssssssss [ 76%]
sssssssssssssssssssssssssssssss.ssssssssssssss                           [ 80%]
sdl2/test/sdlttf_test.py ..............ss............................... [ 85%]
.......                                                                  [ 85%]
sdl2/test/sensor_test.py .ssssss                                         [ 86%]
sdl2/test/surface_test.py ......s...ss...............s..sssss            [ 90%]
sdl2/test/syswm_test.py s                                                [ 90%]
sdl2/test/timer_test.py .....xx                                          [ 90%]
sdl2/test/touch_test.py ......                                           [ 91%]
sdl2/test/version_test.py .......                                        [ 92%]
sdl2/test/video_test.py ................s...s...s...................ss.. [ 96%]
ss......ssss.s...ss..ssssssss                                            [ 99%]
sdl2/test/vulkan_test.py ssssss                                          [100%]

=================================== FAILURES ===================================
_____________________________ test_SDL_GetPlatform _____________________________

    def test_SDL_GetPlatform():
        retval = sdl2.SDL_GetPlatform()
        if sys.platform in ("win32", "cygwin"):
            assert retval == b"Windows"
        elif sys.platform.startswith("linux"):
            assert retval == b"Linux"
        elif sys.platform.startswith("freebsd"):
            assert retval == b"FreeBSD"
        elif sys.platform.startswith("darwin"):
>           assert retval == b"Mac OS X"
E           AssertionError: assert b'macOS' == b'Mac OS X'
E             
E             At index 0 diff: b'm' != b'M'
E             Use -v to get more diff

sdl2/test/platform_test.py:15: AssertionError
=========================== short test summary info ============================
FAILED sdl2/test/platform_test.py::test_SDL_GetPlatform - AssertionError: assert b'macOS' == b'Mac OS X'
= 1 failed, 718 passed, 318 skipped, 59 deselected, 6 xfailed in 66.93s (0:01:06) =

Additional context

Not a duplicate of #399851 - this one is a new, Darwin-specific error that seems to be caused by libsdl-org/sdl2-compat#473. SDL3's version of SDL_GetPlatform() returns macOS instead of Mac OS X, which causes the SDL_GetPlatform() test case in pysdl2 to fail now that it's being built against sdl2-compat instead of SDL2_classic.

libsdl-org/sdl2-compat@ff10e31 fixes this upstream, but it hasn't made it into a release yet.

System metadata

  • system: "x86_64-darwin"
  • host os: Darwin 24.4.0, macOS 10.16
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.24.14
  • channels(root): "nixpkgs-24.11-darwin"
    • No problem on that channel - only when manually testing against nixpkgs-unstable.
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs

Notify maintainers

@pmiddend


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: build failureA package fails to build6.topic: pythonPython is a high-level, general-purpose programming language.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions