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

adw_init causes g_settings_schema_source_lookup: assertion 'source != NULL' failed due to missing glib schema file on Windows / MacOS #38

Closed
Clemapfel opened this issue Aug 16, 2023 · 2 comments

Comments

@Clemapfel
Copy link

Clemapfel commented Aug 16, 2023

Calling adw_init using the libadwaita_jll causes the following error message:

using libadwaita_jll
ccall(("adw_init", libadwaita_jll.libadwaita), Cvoid, ())
(process:10512): GLib-GIO-CRITICAL **: 15:29:41.923: g_settings_schema_source_lookup: assertion 'source != NULL' failed

This is only the case for Windows and MacOS.

I investigated this and the reason is a missing schema file in the Glib_jll on those platforms.

The solution would be to add a build step to the Glib_jll build_tarballs.jl that downloads the following files:

Places them in \share\glib-2.0\schema, then uses the aready available glib-compile-schema executable in the glibs /bin directory to compile the above files into gschemas.compiled, which should be placed in glib-2.0/schemas

I tried this solution which was suggested here on windows and it does work, though I modified the already installed artifact folder, which is not a feasible fix. This should happen during the GLib_jll build step, which requires modification of the binary builder script, it should only be a few lines.

Would it be possible to modify the glib and libadwaita jlls to address this? If not, where would I submit a pull request for this? I think you guys are doing the gnome jlls so I'm unsure of where to ask except here.

@jwahlstrand
Copy link
Member

I have been updating the jll's but would be thrilled to have help getting them working better. Issues about jll's are usually filed at https://github.com/JuliaPackaging/Yggdrasil and that's where you would submit a PR to modify the Glib_jll build.

@jwahlstrand
Copy link
Member

I plan to update the Glib_jll version for my own reasons and just looked at this request in detail. It's not typical to copy over files from other libraries during a build, and I would like to humbly suggest a different solution.

In Gtk.jl and Gtk4.jl, the environmental variable XDG_DATA_DIRS is set in __init__() to include artifact directories with schemas and icons: https://github.com/JuliaGtk/Gtk4.jl/blob/1c80984c1bc50bd2fd425439891ca827a278483c/src/Gtk4.jl#L123C5-L129C38

On Linux this does have side effects: see JuliaGraphics/Gtk.jl#647. But perhaps you could adopt this approach on Windows and Mac? If I understand things correctly, the reason you don't see those errors on Linux is because the schemas are already installed in a standard directory like /usr/share/glib-2.0/schemas (which assumes that Linux users have GTK4 installed through their distribution).

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

2 participants