-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve SDL setup hook #254465
Improve SDL setup hook #254465
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
I think that was just a sloppy merge "huh, conditioning -L on include path? that looks like I made a mistake."
Good sleuthing, and thanks for catching my mistake.
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 <[email protected]>
Co-authored-by: matthewcroughan <[email protected]>
…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_PATH
was modified only whenSDL_PATH
was 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
/lib
gets added toSDL_LIB_PATH
which 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 = true
set 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/
)