Skip to content

SDL_compat: set rpath during installation; add tests#405305

Merged
pbsds merged 3 commits intoNixOS:masterfrom
marcin-serwin:push-qqpvkyokukql
May 10, 2025
Merged

SDL_compat: set rpath during installation; add tests#405305
pbsds merged 3 commits intoNixOS:masterfrom
marcin-serwin:push-qqpvkyokukql

Conversation

@marcin-serwin
Copy link
Contributor

@marcin-serwin marcin-serwin commented May 8, 2025

This should fix darwin builds, making #404948 no longer needed.

ZHF: #403336

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels May 8, 2025
@nix-owners nix-owners bot requested a review from peterhoeg May 8, 2025 17:42
@LordGrimmauld
Copy link
Contributor

The rpath things currently cause build failures on darwin, see https://hydra.nixos.org/build/296088873
Do you have a darwin machine to test this?

Tagging ZHF because this is an existing failure: #403336
Though i can't test this actually fixes darwin... A darwin build on this PR would be much appreciated!

@LordGrimmauld LordGrimmauld added the 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign label May 8, 2025
@marcin-serwin
Copy link
Contributor Author

marcin-serwin commented May 8, 2025

The rpath things currently cause build failures on darwin

That was the motivation, see the description.

Do you have a darwin machine to test this?

I'm running nixpkgs-review-gha but it may timeout if it causes too many rebuilds

@marcin-serwin
Copy link
Contributor Author

I'm running nixpkgs-review-gha but it may timeout if it causes too many rebuilds

Darwin runners fail during check phase with the error below. I can disable checkPhase for darwin as a workaround.

Details
SDL_compat> Running phase: checkPhase
SDL_compat> 2025-05-08 17:48:22.864 testver[13927:50580] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Critical error: required built-in appearance SystemAppearance not found'
SDL_compat> *** First throw call stack:
SDL_compat> (
SDL_compat>     0   CoreFoundation                      0x00007ff80b8b60aa __exceptionPreprocess + 242
SDL_compat>     1   libobjc.A.dylib                     0x00007ff80b3db0b7 objc_exception_throw + 48
SDL_compat>     2   CoreFoundation                      0x00007ff80b8b5f10 +[NSException raise:format:] + 214
SDL_compat>     3   libdispatch.dylib                   0x00007ff80b5c2033 _dispatch_client_callout + 8
SDL_compat>     4   libdispatch.dylib                   0x00007ff80b5c3267 _dispatch_once_callout + 20
SDL_compat>     5   AppKit                              0x00007ff80e8c9d7d +[NSAppearance _aquaAppearance] + 52
SDL_compat>     6   AppKit                              0x00007ff80e8a67cc +[NSAppearance appearanceNamed:] + 21
SDL_compat>     7   AppKit                              0x00007ff80e8a60e6 -[NSSystemAppearanceProxy init] + 130
SDL_compat>     8   AppKit                              0x00007ff80e8a605b __38+[NSSystemAppearanceProxy systemProxy]_block_invoke + 16
SDL_compat>     9   libdispatch.dylib                   0x00007ff80b5c2033 _dispatch_client_callout + 8
SDL_compat>     10  libdispatch.dylib                   0x00007ff80b5c3267 _dispatch_once_callout + 20
SDL_compat>     11  AppKit                              0x00007ff80e8a6049 +[NSSystemAppearanceProxy systemProxy] + 42
SDL_compat>     12  AppKit                              0x00007ff80e8a5ff5 -[NSApplication(NSApplicationAppearance_Internal) _registerForAppearanceNotifications] + 34
SDL_compat>     13  AppKit                              0x00007ff80e8a3be7 -[NSApplication init] + 571
SDL_compat>     14  AppKit                              0x00007ff80e8a378e +[NSApplication sharedApplication] + 120
SDL_compat>     15  testver                             0x000000010037bc2e main + 302
SDL_compat>     16  dyld                                0x00007ff80b408418 start + 1896
SDL_compat> )
SDL_compat> libc++abi: terminating due to uncaught exception of type NSException
SDL_compat> /nix/store/q5v8ifvm6mymx6nzmhrwm5a5awxammc3-stdenv-darwin/setup: line 1771: 13927 Abort trap: 6           ./testver

@LordGrimmauld
Copy link
Contributor

I know too little darwin things to judge whether this indicates actual breakage on darwin or just a failed check. But it does make sense to disable the checks on darwin. We previously didn't have any checks, so having linux checks is already a massive improvement.

Copy link
Contributor

@LordGrimmauld LordGrimmauld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost looking good, have some nits.

Comment on lines +82 to +86
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
checkPhase = ''
runHook preCheck
./testver
runHook postCheck
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;

The version check hook is probably the more-correct way of doing this check

Copy link
Contributor Author

@marcin-serwin marcin-serwin May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

versionCheckHook runs the installed executable of the package with --version argument, the testver is just one of many example programs that are built alongside the lib and never installed. Most of them are displaying something on the screen or are benchmarking so they're not very useful for us.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay fair! Just feels a bit weird: sdl-config has a --version flag you can give it, so versionCheckHook do the same thing at a glance. Might need a comment explaining you want the example program explicitly, not simply a version check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that it installs sdl-config. Looking at the code, the --version argument just echoes the hardcoded version so testver, which actually links to the built library, is a better indication that it works. We can still add versionCheckHook as a separate test to check if sdl-config is installed.

@marcin-serwin
Copy link
Contributor Author

Linuxes are still running but SDL_compat built on darwin runners. There are other failures though. Link to the job.


aarch64-darwin

⏩ 14 packages marked as broken and skipped:
  • SDL_stretch
  • barrage
  • blender
  • freedroid
  • guile-sdl
  • hheretic
  • hhexen
  • hivelytracker
  • onscripter-en
  • powermanga
  • pterm
  • sfxr
  • tecnoballz
  • tinyemu
❌ 29 packages failed to build:
  • btanks
  • dosbox
  • egoboo
  • frozen-bubble
  • frozen-bubble.devdoc
  • gmu
  • gnuradio
  • gnuradioMinimal
  • gnuradioPackages.lora_sdr
  • gnuradioPackages.lora_sdr.dev
  • gnuradioPackages.osmosdr
  • gnuradioPackages.osmosdr.dev
  • gqrx (gqrx-portaudio)
  • gqrx-gr-audio
  • grafx2
  • grafx2.man
  • jimtcl
  • keen4
  • mp3blaster
  • open-watcom-v2
  • open-watcom-v2-unwrapped
  • openocd
  • openocd-rp2040
  • perl538Packages.SDL
  • perl538Packages.SDL.devdoc
  • perl540Packages.SDL
  • perl540Packages.SDL.devdoc
  • tinygo
  • trunk-recorder
✅ 48 packages built:
  • SDL (SDL_compat)
  • SDL_Pango
  • SDL_gfx
  • SDL_image
  • SDL_image.dev
  • SDL_mixer
  • SDL_mixer.dev
  • SDL_net
  • SDL_sound
  • SDL_ttf
  • asap
  • asap.dev
  • ballerburg
  • cgterm
  • chickenPackages_5.chickenEggs.sdl-base
  • curseofwar-sdl
  • dgen-sdl
  • goattracker
  • goattracker-stereo
  • haskellPackages.SDL
  • haskellPackages.SDL-gfx
  • haskellPackages.SDL-gfx.data
  • haskellPackages.SDL-gfx.doc
  • haskellPackages.SDL-image
  • haskellPackages.SDL-image.data
  • haskellPackages.SDL-image.doc
  • haskellPackages.SDL-ttf
  • haskellPackages.SDL-ttf.data
  • haskellPackages.SDL-ttf.doc
  • haskellPackages.SDL.data
  • haskellPackages.SDL.doc
  • haskellPackages.elerea-sdl
  • haskellPackages.elerea-sdl.doc
  • hyperrogue
  • mjpegtoolsFull
  • mjpegtoolsFull.lib
  • odamex
  • perl538Packages.AlienSDL
  • perl538Packages.AlienSDL.devdoc
  • perl540Packages.AlienSDL
  • perl540Packages.AlienSDL.devdoc
  • qodem
  • rott
  • rott-shareware
  • smpeg
  • smpeg.dev
  • unscii
  • unscii.extra

x86_64-darwin

⏩ 14 packages marked as broken and skipped:
  • SDL_stretch
  • barrage
  • blender
  • freedroid
  • guile-sdl
  • hheretic
  • hhexen
  • hivelytracker
  • onscripter-en
  • powermanga
  • pterm
  • sfxr
  • tecnoballz
  • tinyemu
❌ 42 packages failed to build:
  • SDL_mixer
  • SDL_mixer.dev
  • btanks
  • dosbox
  • dwarf-fortress (dwarf-fortress-packages.dwarf-fortress, dwarf-fortress-packages.dwarf-fortress_0_47_05)
  • dwarf-fortress-packages.dwarf-fortress-original
  • dwarf-fortress-packages.dwarf-fortress_0_44_12
  • dwarf-therapist (dwarf-fortress-packages.dwarf-therapist)
  • egoboo
  • frozen-bubble
  • frozen-bubble.devdoc
  • gmu
  • gnuradio
  • gnuradioMinimal
  • gnuradioPackages.lora_sdr
  • gnuradioPackages.lora_sdr.dev
  • gnuradioPackages.osmosdr
  • gnuradioPackages.osmosdr.dev
  • gqrx (gqrx-portaudio)
  • gqrx-gr-audio
  • grafx2
  • grafx2.man
  • hyperrogue
  • jimtcl
  • keen4
  • mp3blaster
  • np2kai
  • odamex
  • open-watcom-v2
  • open-watcom-v2-unwrapped
  • openocd
  • openocd-rp2040
  • perl538Packages.SDL
  • perl538Packages.SDL.devdoc
  • perl540Packages.SDL
  • perl540Packages.SDL.devdoc
  • rott
  • rott-shareware
  • tinygo
  • trunk-recorder
  • unscii
  • unscii.extra
✅ 42 packages built:
  • SDL (SDL_compat)
  • SDL_Pango
  • SDL_gfx
  • SDL_image
  • SDL_image.dev
  • SDL_net
  • SDL_sound
  • SDL_ttf
  • asap
  • asap.dev
  • ballerburg
  • cgterm
  • cheesecutter
  • chickenPackages_5.chickenEggs.sdl-base
  • curseofwar-sdl
  • dgen-sdl
  • goattracker
  • goattracker-stereo
  • haskellPackages.SDL
  • haskellPackages.SDL-gfx
  • haskellPackages.SDL-gfx.data
  • haskellPackages.SDL-gfx.doc
  • haskellPackages.SDL-image
  • haskellPackages.SDL-image.data
  • haskellPackages.SDL-image.doc
  • haskellPackages.SDL-ttf
  • haskellPackages.SDL-ttf.data
  • haskellPackages.SDL-ttf.doc
  • haskellPackages.SDL.data
  • haskellPackages.SDL.doc
  • haskellPackages.elerea-sdl
  • haskellPackages.elerea-sdl.doc
  • katawa-shoujo
  • mjpegtoolsFull
  • mjpegtoolsFull.lib
  • perl538Packages.AlienSDL
  • perl538Packages.AlienSDL.devdoc
  • perl540Packages.AlienSDL
  • perl540Packages.AlienSDL.devdoc
  • qodem
  • smpeg
  • smpeg.dev

@LordGrimmauld
Copy link
Contributor

This PR shouldn't break outwards API as far as i can tell, so these other failures likely have other issues that are not directly related to this PR

@marcin-serwin
Copy link
Contributor Author

Looking at the logs, some are caused by runner terminating too early causing missing logs (e.g. SDL_mixer which built successfully on aarch64 runner). dosbox is weird though with undefined symbols during linking and warnings like this:

ld: warning: ignoring file hardware/libhardware.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64

Seems unrelated to this PR though.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 8, 2025
@grimmauld-bot
Copy link

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 405305


aarch64-linux

⏩ 5 packages marked as broken and skipped:
  • gravit
  • libagar_test
  • quantumminigolf
  • zandronum
  • zandronum-alpha
❌ 18 packages failed to build:
  • directvnc
  • freewheeling
  • frozen-bubble
  • frozen-bubble.devdoc
  • gnss-sdr
  • gnu-smalltalk
  • guile-sdl
  • odamex
  • perl538Packages.SDL
  • perl538Packages.SDL.devdoc
  • perl540Packages.SDL
  • perl540Packages.SDL.devdoc
  • scorched3d
  • t4kcommon
  • tuxtype
  • uae
  • urbanterror
  • xwax
✅ 197 packages built:
  • SDL (SDL_compat)
  • SDL_Pango
  • SDL_gfx
  • SDL_image
  • SDL_image.dev
  • SDL_mixer
  • SDL_mixer.dev
  • SDL_net
  • SDL_sound
  • SDL_stretch
  • SDL_ttf
  • _1oom
  • _1oom.doc
  • agg
  • airstrike
  • armagetronad
  • asap
  • asap.dev
  • asc
  • atari800
  • ataripp
  • azimuth
  • ballerburg
  • barrage
  • blackvoxel
  • bloodspilot-client
  • bottles
  • btanks
  • caprice32
  • cgterm
  • chickenPackages_5.chickenEggs.sdl-base
  • curseofwar-sdl
  • cuyo
  • desmume
  • dgen-sdl
  • directfb
  • dosbox
  • egoboo
  • fim
  • fish-fillets-ng
  • flowblade
  • freedink
  • freedroid
  • freedroidrpg
  • fuse-emulator
  • gav
  • gl117
  • globulation2
  • gltron
  • gmu
  • gnujump
  • gnuradio
  • gnuradioMinimal
  • gnuradioPackages.bladeRF
  • gnuradioPackages.fosphor
  • gnuradioPackages.lora_sdr
  • gnuradioPackages.lora_sdr.dev
  • gnuradioPackages.osmosdr
  • gnuradioPackages.osmosdr.dev
  • goattracker
  • goattracker-stereo
  • gqrx
  • gqrx-gr-audio
  • gqrx-portaudio
  • grafx2
  • grafx2.man
  • hase
  • haskellPackages.SDL
  • haskellPackages.SDL-gfx
  • haskellPackages.SDL-gfx.data
  • haskellPackages.SDL-gfx.doc
  • haskellPackages.SDL-image
  • haskellPackages.SDL-image.data
  • haskellPackages.SDL-image.doc
  • haskellPackages.SDL-mixer
  • haskellPackages.SDL-mixer.data
  • haskellPackages.SDL-mixer.doc
  • haskellPackages.SDL-mpeg
  • haskellPackages.SDL-mpeg.data
  • haskellPackages.SDL-mpeg.doc
  • haskellPackages.SDL-ttf
  • haskellPackages.SDL-ttf.data
  • haskellPackages.SDL-ttf.doc
  • haskellPackages.SDL.data
  • haskellPackages.SDL.doc
  • haskellPackages.elerea-sdl
  • haskellPackages.elerea-sdl.doc
  • hex-a-hop
  • hheretic
  • hhexen
  • hikounomizu
  • hivelytracker
  • hyperrogue
  • inspectrum
  • jack_oscrolloscope
  • jimtcl
  • kdePackages.kdenlive
  • kdePackages.kdenlive.debug
  • kdePackages.kdenlive.dev
  • kdePackages.kdenlive.devtools
  • kdePackages.mlt (qt6Packages.mlt)
  • kdePackages.mlt.dev (qt6Packages.mlt.dev)
  • keen4
  • kobodeluxe
  • krita
  • krita-plugin-gmic
  • lbreakout2
  • libagar
  • libagar.devdoc
  • libsForQt5.kdenlive (plasma5Packages.kdenlive)
  • libsForQt5.mlt (plasma5Packages.mlt)
  • libsForQt5.mlt.dev (plasma5Packages.mlt.dev)
  • libtcod
  • linuxConsoleTools
  • liquidwar
  • matrix-brandy
  • meritous
  • meterbridge
  • mjpegtoolsFull
  • mjpegtoolsFull.lib
  • mlt
  • mlt.dev
  • nexuiz
  • njam
  • onscripter-en
  • open-watcom-v2
  • open-watcom-v2-unwrapped
  • openboard
  • openlierox
  • openocd
  • openocd-rp2040
  • opentx
  • openxcom
  • oversteer
  • perl538Packages.AlienSDL
  • perl538Packages.AlienSDL.devdoc
  • perl540Packages.AlienSDL
  • perl540Packages.AlienSDL.devdoc
  • plib
  • pokerth
  • pokerth-server
  • powermanga
  • pterm
  • python312Packages.mlt
  • python312Packages.mlt.dev
  • python313Packages.mlt
  • python313Packages.mlt.dev
  • qodem
  • qradiolink
  • quakespasm
  • rili
  • rott
  • rott-shareware
  • rrootage
  • sdl-jstest
  • sfxr
  • sfxr-qt
  • shotcut
  • simgear
  • simutrans_binaries
  • smpeg
  • smpeg.dev
  • soi
  • soundtracker
  • sparrow3d
  • sparrow3d.dev
  • stardust
  • synaesthesia
  • synfigstudio
  • tecnoballz
  • teetertorture
  • tennix
  • tiny8086
  • tinyemu
  • tinygo
  • titanion
  • torus-trooper
  • trunk-recorder
  • tumiki-fighters
  • uhexen2
  • ultimatestunts
  • unscii
  • unscii.extra
  • vectoroids
  • vice
  • vp
  • vp.man
  • vpWithSixel
  • vpWithSixel.man
  • warmux
  • xpilot-ng
  • xsw
  • zandronum-alpha-server
  • zandronum-server
  • zaz
  • zgv
  • zod

@LordGrimmauld
Copy link
Contributor

And the winner is: the community builder!
On a more serious note: The failures look fine, most of these are known already. Some even have fixes ready, like freewheeling (#404620) and xwax (#402378).
Perl SDL and directvnc fails to Gcc14.

@pbsds
Copy link
Member

pbsds commented May 10, 2025

double checked SDL_mixer on aarch64-darwin, lgtm 👍

@pbsds pbsds merged commit cb1697b into NixOS:master May 10, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants