SDL_compat: use SDL3 through sdl2-compat#386495
Conversation
There was a problem hiding this comment.
Do we actually need this option?
There was a problem hiding this comment.
i believe not; .override { sdl2-compat = SDL2; } is simple enough if needed occasionally, and could always be an alias in all-packages.nix if it ever becomes a recurring pattern.
There was a problem hiding this comment.
Same vibe. Lets just drop it.
|
This was previously blocked because it depended on #386759, but that has been merged four days ago. What is the status on this? Any blockers? I am also a little concerned about the seemingly flaky tests reported in #386759 (comment). If this becomes a channel blocker over at hydra, things will be ugly. |
|
|
I now set my main system to use SDL_compat through sdl12-compat, and everything still builds and works perfectly. Including bottles, which sometimes can be fragile to dosbox changes. From a functionality perspective, i call this ready. |
1fa8edc to
bebc7a2
Compare
Good point. There is an environment variable that skips timer tests. Perhaps we should set it preemptively. |
if this is as easy as an |
Done |
|
Oh uh... Crap, you are setting yourself up for merge conflicts. This commit should probably go into #388079 now that i think about it? Or you rebase one of the two PRs when the other gets the merge. but currently this will conflict. I am an idiot for telling you to do it in here, sorry! Eh, you are smart, you'll figure it out. |
There was a problem hiding this comment.
Assuming there is no harm in setting the environment variable at the build stage, we should just do
env.SDL_TESTS_QUICK = 1;
There was a problem hiding this comment.
i just tested, either works perfectly. Your approach is cleaner.
There was a problem hiding this comment.
Done, but I moved it to #388079 to avoid merge conflicts.
There was a problem hiding this comment.
Where does libx11 come from here? Was it propagated by normal SDL2 or something?
There was a problem hiding this comment.
it was, see
nixpkgs/pkgs/development/libraries/SDL2/default.nix
Lines 114 to 119 in e3e32b6
It might however make sense to do the following:
# SDL_compat
propagatedBuildInputs = sdl2-compat.propagatedBuildInputs ++ [ ... ];# sdl2-compat
propagatedBuildInputs = sdl3.propagatedBuildInputs ++ [ ... ];This adds extra complexity, but would allow us to not maintain multiple lists of the same thing.
There was a problem hiding this comment.
(not quite familiar with how propagatedBuildInputs works, there might be better ways.)
There was a problem hiding this comment.
This shouldn't be necessary though, that's what propagation does already - if sdl2-compat is in sdl-compat's propagatedBuildInputs, sdl2's propagatedBuildInputs will also be propagated.
There was a problem hiding this comment.
Ah, thats the issue!!
See
nixpkgs/pkgs/by-name/sd/sdl2-compat/package.nix
Lines 36 to 38 in 74b648b
sdl2-compat is not listing sdl3 as propagated build input. THAT is the issue and should be fixed. Then explicit libX11 can be dropped here.
There was a problem hiding this comment.
It should, however, propagate libX11, because include/SDL2/SDL_syswm.h refers to xlib includes.
There was a problem hiding this comment.
sdl2-compat also does a dlopen on sdl3 at runtime, see #388079. The fact that is currently missing is more a mistake/bug than anything.
(these two PRs really should have been one, huh?)
There was a problem hiding this comment.
i need to do some testing. But either way, libX11 being in SDL_compat explicitly seems to not be the correct solution.
There was a problem hiding this comment.
sdl2-compat also does a dlopen on sdl3 at runtime, see #388079. The fact that is currently missing is more a mistake/bug than anything.
But that is handled by rpath and doesn't really have to do with propagated build inputs, or am I missing something?
But either way, libX11 being in SDL_compat explicitly seems to not be the correct solution.
I'm still a bit fuzzy on how exactly propagated build inputs work but I don't understand why that wouldn't be the correct approach. It seems like sdl2-compat doesn't need to propagate libX11, since I've managed to build some games without it, but SDL1 does so that's why it appears here. It's a bit weird that SDL2 propagated libX11 but maybe that was the issue in the first place and now it got accidentally corrected in sdl2-compat?
There was a problem hiding this comment.
SDL2 propagated libX11. If sdl2-compat is supposed to be a drop-in replacement, it should do the same imo.
9ff7b00 to
bebc7a2
Compare
|
#388079 addresses the libx11 thing, correct? |
i just tried, and no; commenting out |
|
After some experimenting and reading about dependency propagation my current My reasoning: Package B should add package A to `*-config` outputs$ sdl-config --libs
-L/nix/store/ryxfmihhya90il7fij24g5l5l23vql9s-SDL-1.2.15/lib -Wl,-rpath,/nix/store/ryxfmihhya90il7fij24g5l5l23vql9s-SDL-1.2.15/lib -lSDL -lpthread -L/nix/store/nhrql1l31nyz7hg8n16mw3g4vza0r8zy-SDL-1.2.15-dev/lib -L/nix/store/nhrql1l31nyz7hg8n16mw3g4vza0r8zy-SDL-1.2.15-dev/lib -L/nix/store/nhrql1l31nyz7hg8n16mw3g4vza0r8zy-SDL-1.2.15-dev/lib
$ sdl2-config --libs
-L/nix/store/0k3g1sgznf7mpz1ycg0sdnlfb3r5405f-SDL2-2.32.0/lib -Wl,-rpath,/nix/store/0k3g1sgznf7mpz1ycg0sdnlfb3r5405f-SDL2-2.32.0/lib -Wl,--enable-new-dtags -lSDL2
$ pkg-config --libs sdl3
-L/nix/store/1lc2wbfgf3ll0qa5capjkp1b0dhi81m3-sdl3-3.2.6-lib/lib -Wl,-rpath,/nix/store/1lc2wbfgf3ll0qa5capjkp1b0dhi81m3-sdl3-3.2.6-lib/lib -Wl,--enable-new-dtags -lSDL3It makes sense that this is the case: If an SDL app wants to create a window Of course, some packages may break the abstraction and choose to talk to I have managed to build some simple applications after removing propagated build Is this correct or is there some other reason requiring the SDL packages to |
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292729609
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292729441
|
Some context about these: https://github.com/libsdl-org/sdl12-compat/blob/35ef746cf1a4fde8c442dc92fe9b18c3f90d7855/include/SDL/SDL_opengl.h#L51 |
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292730126
This is an optional include file and if a package uses it then it should declare OpenGL in its dependencies. This is also the position of the SDL contributors: libsdl-org/sdl2-compat#405 (comment).
If a package uses it and does not depend on libGL then it's a problem with the derivation. Failures like these were expected. |
|
Yeah, I don't think it makes sense to propagate optional dependencies that are not used by a lot of things. |
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292734958
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292743187
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292743363
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292810698
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292771916
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292732003
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build Hydra fail: https://hydra.nixos.org/build/292728946
commit 7aeac03 (PR NixOS#386495) dropped libX11 and libGLU from propagatedBuildInputs in SDL_compat, and NixOS#389106 pointed SDL to SDL_compat, which broke this build
I have manually tested all the packages depending on
SDL_compat:rott(shareware version): menu doesn't render with the currently packagedsdl2-compatversion (2.30.52), but upgrading to 2.32.52 fixes the issuedosbox: runs fineopenxcom(with "X-COM: UFO Defense" Steam files): runs finekatawa-shoujo: boots to black screen with the currently packagedsdl2-compatversion (2.30.52), but upgrading to 2.32.52 fixes the issuezandronum(with Doom 1 shareware): runs fineThings done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.