Skip to content
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-pixdump possibly not installed correctly #121

Closed
bjarthur opened this issue Jul 7, 2016 · 26 comments
Closed

gdk-pixdump possibly not installed correctly #121

bjarthur opened this issue Jul 7, 2016 · 26 comments

Comments

@bjarthur
Copy link

bjarthur commented Jul 7, 2016

when testing Gtk.jl, i get the following error:

(<unknown>:92780): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file '/Users/arthurb/.julia-test/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /Users/arthurb/.julia-test/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.

there are two problems here i believe. first is that nominally gdk-pixbuf 2.34.0 is installed, yet the loader files are stored in a directory named 2.10.0. second is that loaders.cache does not exist.

the relevant issue over at Gtk.jl is JuliaGraphics/Gtk.jl#242. what should i set these variables too?

ENV["GDK_PIXBUF_MODULEDIR"] = joinpath("$(Homebrew.brew_prefix)", "lib/gdk-pixbuf-2.0/2.10.0/loaders")
ENV["GDK_PIXBUF_MODULE_FILE"] = joinpath("$(Homebrew.brew_prefix)", "lib/gdk-pixbuf-2.0/2.10.0/loaders.cache")
@staticfloat
Copy link
Member

@bjarthur I apologize for the late response, feel free to ping me via @staticfloat if an issue goes this long without me answering it; it's probably because I just haven't been on github recently, so please do get my attention, as I (annoyingly) don't get emails when new issues are opened.

If you run the following, do things work as expected?

using Homebrew
Homebrew.postinstall("gdk-pixbuf")
Pkg.test("Gtk")

@bjarthur
Copy link
Author

Homebrew.postinstall("gdk-pixbuf") says it runs

/Users/arthurb/.julia/v0.4/Homebrew/deps/usr/Cellar/gdk-pixbuf/2.34.0/bin/gdk-pixbuf-query-loaders --update-cache

but it appears to do nothing, so i run this same command on the unix command line and get Failed to create file '/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.514HLY': No such file or directory.

so i manually redirect to where i think it should be:

/Users/arthurb/.julia/v0.4/Homebrew/deps/usr/Cellar/gdk-pixbuf/2.34.0/bin/gdk-pixbuf-query-loaders > /Users/arthurb/.julia/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache

now Pkg.test("Gtk") results in a new error:

Gtk-WARNING **: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/check-symbolic.svg. This may indicate that pixbuf loaders or the mime database could not be found.

@staticfloat
Copy link
Member

When you say "it appears to do nothing" what do you mean? It should be creating that loaders.cache file when you run postinstall. Is it not?

@bjarthur
Copy link
Author

correct. i do not see a loaders.cache file anywhere. but perhaps i'm not looking in the right place?

@staticfloat
Copy link
Member

staticfloat commented Jul 24, 2016

@bjarthur Ah, you're probably looking in the wrong place. You should be looking in this directory:

$ ls -la ~/.julia/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0
total 8
drwxr-xr-x   4 sabae  staff   136 Jul 20 22:55 .
drwxr-xr-x   3 sabae  staff   102 Jul 20 22:52 ..
drwxr-xr-x  41 sabae  staff  1394 Jul 20 22:52 loaders
-rw-r--r--   1 sabae  staff  3288 Jul 20 22:55 loaders.cache

That should be generated by the postinstall step we manually ran. If that's not being generated, then we have bigger problems. What the postinstall step does is run this ruby code, which should be equivalent to the following:

export GDK_PIXBUF_MODULE_FILE="$(echo ~)/.julia/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
export GDK_PIXBUF_MODULEDIR="$(echo ~)/.julia/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders"
~/.julia/v0.4/Homebrew/deps/usr/bin/gdk-pixbuf-query-loaders --update-cache

Let's try deleting the loaders.cache file that you have right now, and seeing how we can generate it. The .svg file that's missing I think can be ignored for now.

@bjarthur
Copy link
Author

bigger problems i think. with a fresh install of Homebrew, i build Gtk and there is no loaders.cache in that directory. there is the loaders subdirectory though. nothing changes with the manual postinstall. this is with the master branch of Homebrew and Gtk on julia 0.4. has something changed recently, because i do remember seeing that file awhile back. also, shouldn't it be in a directory called 2.34.0 to match the installed version of gdk-pixbuf?

@staticfloat
Copy link
Member

Nope, unfortunately, the 2.10.0 is a different version number than the actual version of gdk-pixbuf. Stupid, I know.

What happens if you run it manually, e.g. with the three bash lines at the end of my last message?

@bjarthur
Copy link
Author

bjarthur commented Jul 24, 2016

w00t! the path is wrong. it should be Homebrew/deps/usr/bin/gdk-pixbuf-query-loaders --update-cache. everything works when i do that manually. EDIT: and preceed it by the two exports ofc.

@staticfloat
Copy link
Member

staticfloat commented Jul 24, 2016

Ah, shoot, you're right, I mistyped that. I've edited my code snippet above so that there's no confusion in the future. I believe I have found a bug in the gdk-pixbuf formula that is causing this file to not be generated, I've opened a PR to the mainline Homebrew guys here, hopefully we'll have this worked out so we don't have to manually run the postinstall step soon!

@bjarthur
Copy link
Author

bjarthur commented Aug 1, 2016

the homebrew guys have merged, and checking out the latest Homebrew.jl fixes this issue, so i'll close it. but one question: Gtk travis tests are still failing because of this issue. will they work again once you've tagged another version of Homebrew.jl? thanks.

@bjarthur bjarthur closed this as completed Aug 1, 2016
@staticfloat
Copy link
Member

Yes, but a good way to test that is to make a branch of Gtk.jl, and add a Pkg.checkout("Homebrew") before you run your tests.

@bjarthur
Copy link
Author

bjarthur commented Aug 2, 2016

i take it back. the loaders.cache file is still not generated after the following sequence:

;rm -rf Homebrew
Pkg.add("Homebrew")
Pkg.checkout("Homebrew")
Pkg.build("Homebrew")
using Homebrew
Homebrew.update()
Homebrew.add("gdk-pixmap")
Homebrew.postinstall("gdk-pixbuf")

only when i do the following is it there:

export GDK_PIXBUF_MODULE_FILE="$(echo ~)/.julia/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
export GDK_PIXBUF_MODULEDIR="$(echo ~)/.julia/v0.4/Homebrew/deps/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders"
Homebrew/deps/usr/bin/gdk-pixbuf-query-loaders --update-cache

@staticfloat
Copy link
Member

Thanks for the follow-through @bjarthur, can you check to see if it is placed in $(echo ~)/.julia/v0.4/Homebrew/deps/usr/Cellar/gdk-pixbuf/2.34.0/lib/gdk-pixbuf-2.0/2.10.0? (Note, I may have mistyped that a bit, but the general idea is that it may be getting placed within the <brew prefix>/Cellar/gdk-pixbuf/ location instead of the global <brew prefix>/lib location)

@bjarthur
Copy link
Author

bjarthur commented Aug 2, 2016

bingo. that's precisely where it is, in deps/usr/Cellar. in fact, if i change the GTK exports to look there, everything works. is that what i should do? or should Homebrew be changed to put loaders.cache in deps/usr/lib ?

@staticfloat
Copy link
Member

I think we should change Homebrew to symlink it in properly after it creates that file. I'm adding this to my TODO list. :) Thanks for the confirmation!

@staticfloat
Copy link
Member

The reason Homebrew doesn't put it in there in the first place, is because non-symlink files in the global Homebrew directory make it suspicious, but it looks like the automatic symlink step got re-arranged sometime in the past, leaving this file out to dry.

@staticfloat
Copy link
Member

I've asked for guidance on the right way to fix the formula here: Homebrew/homebrew-core#3279 (comment).

@staticfloat
Copy link
Member

New PR to Homebrew: Homebrew/homebrew-core#4259

@bjarthur
Copy link
Author

bjarthur commented Sep 6, 2016

GTK tests pass now! thanks for submitting the PR to homebrew!!

not sure this is a concern, but there is still a warning emitted though:

(<unknown>:32193): Gtk-WARNING **: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/check-symbolic.svg.
This may indicate that pixbuf loaders or the mime database could not be found.

@staticfloat
Copy link
Member

I haven't had time to dig in and investigate how to deal with that warning, but I've never had any ill effects from it, so I've grown to ignore it. :)

@Hombre57
Copy link

Hombre57 commented Oct 15, 2016

Hi @bjarthur,

I'm trying to complete the port of an open source project to Gtk3, and I'm facing this Gtk-WARNING **: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/check-symbolic.svg. This may indicate that pixbuf loaders or the mime database could not be found. message. I'm building our application on Windows using MSYS2, which provides a precompiled Gtk/Gtkmm 3.22.0.

Google brought me here, and I'd appreciate if you could drop me a line whether or not you managed to fix this, and how. Any help will be appreciated.

@bjarthur
Copy link
Author

Gtk3 works for me on Windows (and OS X and Linux). all i did was install Julia from the precompiled 0.5.0 binary and use Pkg.add("Gtk"). you might need to Pkg.checkout("Gtk"). are you actually experience problems, or is that warning just innocuous?

@Hombre57
Copy link

We've made a custom theme based on Adwaita, but it isn't rendered at all and we have the default Adwaita theme instead. Since I have other errors in the code, I can't say if it's warning only or more than this.

We do not use Julia, and my Gtk package has been successfully downloaded and installed by pacman. I'll make another try when Gtk3.22.1 will be available into MSYS2.

Also, could you confirm me which version of Gtk you're using ? Gtk3.18 works fine here, but I have troubles with 3.22.0 (don't know for 3.20).

@bjarthur
Copy link
Author

3.18.2

@Hombre57
Copy link

Ok, that's why it's still working fine for you. I shouldn't have updated to the latest gtk version through MSYS2 😞 Anyway, thanks for the clarification.

@heartofrainbow
Copy link

If you are using macOS with homebrew, just install the adwaita-icon-theme package.
(brew install adwaita-icon-theme)

That fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants