Skip to content

sdl3: avoid transitive gtk dependency#413222

Merged
pbsds merged 3 commits intoNixOS:stagingfrom
LordGrimmauld:ibus-split
Jun 3, 2025
Merged

sdl3: avoid transitive gtk dependency#413222
pbsds merged 3 commits intoNixOS:stagingfrom
LordGrimmauld:ibus-split

Conversation

@LordGrimmauld
Copy link
Copy Markdown
Contributor

@LordGrimmauld LordGrimmauld commented Jun 2, 2025

Motivation: ibus carries lots of dependencies on various versions of gtk.
These dependencies become transitive dependencies for sdl3, which causes quite expensive compiles in the sdl3 closure. Particularly, this means gtk (and, in turn, gstreamer and everything else) become part of e.g. ffmpeg.

sdl3 itself uses ibus almost exclusively via dbus, and reimplements some of the most important features. It does depend on ibus only to use some of the constants defined in headers. It does not actually load ibus libraries.

This means, as long as the headers are identical, all the gtk dependencies can be removed in the ibus for sdl3. This requires this split.

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. labels Jun 2, 2025
@LordGrimmauld LordGrimmauld force-pushed the ibus-split branch 2 times, most recently from cb117ff to e118f55 Compare June 2, 2025 12:56
@LordGrimmauld LordGrimmauld changed the title sdl3: avoid transient gtk dependency sdl3: avoid transitive gtk dependency Jun 2, 2025
Copy link
Copy Markdown
Member

@getchoo getchoo Jun 2, 2025

Choose a reason for hiding this comment

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

The tests above shouldn't be run on libOnly builds, since they don't produce the install tests

This also gives us an excuse to run OfBorg again...weird

error: file 'nar/0qlmqx0zzwx915r5byksf3amq1c4k5x78q8pmp4b4r70czqxnp4g.nar?hash=igis2zjnph73mddw7nl80fpf1y14wxjb' does not exist in binary cache 'http://build02.ofborg.org'
copying path '/nix/store/pfaqz742z4f37fyyzw0kzpck6ikf80zv-audit-4.0.3-lib' from 'http://build03.ofborg.org'...
copying path '/nix/store/mr9ir1liiavmh0nf82g6d59j5m4mzd6y-bash-interactive-5.2p37-dev' from 'http://build03.ofborg.org'...
copying path '/nix/store/hrr0b027v6gy4bnzjkx4a7dfbd1lvaz3-source' from 'https://cache.nixos.org'...
copying path '/nix/store/74x4rpqdv48d91w68v868ln2n8kawq93-unbound-1.23.0-lib' from 'http://build03.ofborg.org'...
error: Nix daemon disconnected unexpectedly (maybe it crashed?)

Motivation: `ibus` carries lots of dependencies on various versions of gtk.
These dependencies become transitive dependencies for sdl3, which causes
quite expensive compiles in the sdl3 closure. Particularly, this means gtk
(and, in turn, gstreamer and everything else) become part of e.g. ffmpeg.

`sdl3` itself uses ibus almost exclusively via dbus, and reimplements some
of the most important features. It does depend on ibus only to use some
of the constants defined in headers. It does not actually load ibus libraries.

This means, as long as the headers are identical, all the gtk dependencies
can be removed in the ibus for sdl3. This requires this split.
`sdl3` only relies on constant definitions in the ibus headers,
which does not require ibus to be compiled with gtk support.
This means we can shrink the unnecessarily large closure.
Copy link
Copy Markdown
Contributor

@marcin-serwin marcin-serwin left a comment

Choose a reason for hiding this comment

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

Diff lgtm, I also couldn't find any usage of the ibus lib beyond the headers constants. Tests for ibusMinimal and sdl3 run successfully on aarch64-linux.

@pbsds
Copy link
Copy Markdown
Member

pbsds commented Jun 3, 2025

built

Details

ibus
ibus-engines.anthy
ibus-engines.bamboo
ibus-engines.cangjie
ibus-engines.hangul
ibus-engines.libpinyin
ibus-engines.libthai
ibus-engines.m17n
ibus-engines.mozc
ibus-engines.mozc-ut
ibus-engines.openbangla-keyboard
ibus-engines.pinyin
ibus-engines.rime
ibus-engines.typing-booster
ibus-engines.typing-booster-unwrapped
ibus-engines.uniemoji
ibusMinimal
ibus-theme-tools
ibus-with-plugins
SDL
SDL2
sdl2-compat
SDL2_gfx
SDL2_image
SDL2_mixer
SDL2_net
SDL2_Pango
SDL2_sound
SDL2_ttf
sdl3
sdl3-image
sdl3-ttf
SDL_audiolib
SDL_compat
SDL_gfx
SDL_image
SDL_mixer
SDL_net
SDL_Pango
SDL_sixel
SDL_sound
SDL_stretch
SDL_ttf

and ran a eval locally

:shipit:

@pbsds pbsds merged commit 5d7ef15 into NixOS:staging Jun 3, 2025
16 of 18 checks passed
@getchoo getchoo added the 8.has: port to stable This PR already has a backport to the stable release. label Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants