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
gdk-pixbuf: fix loader.cache on darwin #41559
Conversation
This reverts commit 6d3b976. See the next commit.
This reverts commit 6bb08e8. See the next commit.
gdk-pixbuf-query-loaders looks for .so files even on darwin, but after the switch to meson the loaders are installed with .dylib extension. Fixes NixOS#41314
Meson produces faulty loaders on Darwin, building them into the library bypasses that. 4b2f397
# Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them. | ||
stdenv.lib.optionalString stdenv.isDarwin '' | ||
for f in $out/${passthru.moduleDir}/*.dylib; do | ||
install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f |
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.
Should not the install_name also have so extension?
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.
No, it is a normal lib, not a GLib module, and it was .dylib
in gdk-pixbuf-2.36.7.
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.
Oh, I thought the install_name
needs to match the filename.
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.
I'm not sure that you got this right. The old libs looked like this:
/nix/store/bkw80djwwgi868v02nd9xhizbxbj6f22-gdk-pixbuf-2.36.7/lib
├── gdk-pixbuf-2.0
│ └── 2.10.0
│ ├── loaders
…
│ │ ├── libpixbufloader-png.la
│ │ ├── libpixbufloader-png.so
…
│ └── loaders.cache
├── libgdk_pixbuf-2.0.0.dylib
├── libgdk_pixbuf-2.0.dylib -> libgdk_pixbuf-2.0.0.dylib
…
and the new libs look like this:
/nix/store/xr59fg3v6js0kkpbvsdvfn8382fsqqz0-gdk-pixbuf-2.36.12/lib
├── gdk-pixbuf-2.0
│ └── 2.10.0
│ ├── loaders
…
│ │ ├── libpixbufloader-png.dylib (after this PR becomes .so)
…
│ └── loaders.cache
├── libgdk_pixbuf-2.0.0.dylib
├── libgdk_pixbuf-2.0.dylib -> libgdk_pixbuf-2.0.0.dylib
…
install_name_tool
updates libpixbufloader-png.dylib
et al. to load $out/lib/libgdk_pixbuf-2.0.dylib
.
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.
Of course, you are right, I was misreading that.
@GrahamcOfBorg eval |
Was this tested? From my debugging it looked like the meson build was generating invalid loader libraries. |
Yes, I "built on platform(s): macOS", "tested compilation of |
This has fixed librsvg: https://hydra.nixos.org/eval/1461585#tabs-now-succeed |
Ok, just wanted to make sure because the loader libraries still look weird. They don't have a
|
Motivation for this change
gdk-pixbuf-query-loaders looks for .so files even on darwin, but after the switch to meson the loaders are installed with .dylib extension.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)Tested compilation of
gdk_pixbuf
,gtk2
(reported to fail in #41314).