Improve SDL setup hook#254465
Conversation
FliegendeWurst
left a comment
There was a problem hiding this comment.
LGTM 👍
Since this fix causes a lot of rebuilds, please rebase the PR onto staging (howto).
|
Thanks for the review! I've rebased onto staging and changed merge target to staging as well. |
FliegendeWurst
left a comment
There was a problem hiding this comment.
Per https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions the first line of the commit message should be: "SDL: put only SDL-related paths in SDL_LIB_PATH" (or similar).
It's very good that you included some context in the commit description!
|
Renamed the commit and rebased on staging once more. |
|
Probably won't work with a split dev though, I don't know a way around that. |
|
Oh huh good catch |
|
Good point about packages with split dev, I didn't give them a thought before. However I'm probably missing something yet it seems they won't cause a problem: the SDL's setup hook initializes As far as I understood from mentions of the environment variables the hook is intended to make packages like |
|
Add a comment that it's doesn't work with split dev because include and lib aren't in the same $1 |
|
I've added a note about split dev in the setup hook. |
Co-authored-by: SomeoneSerge <sergei.kozlukov@aalto.fi>
Co-authored-by: matthewcroughan <matt@croughan.sh>
…ckages.autoflake python311Packages.autoflake: 2.3.0 -> 2.3.1
clash-geoip: 20240212 -> 20240312
re-flex: 4.0.1 -> 4.1.0
plfit: 0.9.4 -> 0.9.6
python3Packages.tinygrad: init at 0.8.0
|
A bot seems to have merged this with extra commits... |
|
@sergv Seems you rebased incorrectly and dropped your changes and github thought the pr was already merged :/ Can you make a new pr reconstructed from Here's how you can rebase without dropping commits BTW https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#rebasing-between-branches-ie-from-master-to-staging |

Summary
SDL setup hook does more work that required by putting more entries into SDL_LIB_PATH than needed. This contributes to bloated environment that leads to #41340.
Details
Before f7fdc99 the SDL setup hook looked like this (literally it was a bit different but logically
SDL_LIB_PATHwas modified only whenSDL_PATHwas too) :The last commit (f7fdc99) in the relevant PR #72812 changed the logic to:
I was unable to find any justification for this change and the commit message looks suspicious:
Merge commit 'afa48f16f265fd3e88073bca7929e1e103bd3dc3' into bash-no-undef-vars. The mentioned commit afa48f1 is not related to SDL so it seems like merge ought to have left SDL as is.The way hook looks now, any package that has
/libgets added toSDL_LIB_PATHwhich is only used for SDL purposes within nixpkgs as far as I can tell. It seems that only SDL-related things should go there, likeSDL_image,SDL_mixer, etc - basically the packages that have corresponding/include/SDL. Putting everything in there the way it works now is likely redundant.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)