Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Initial shot at using Gtk on Julia 1.3+ #447

Merged
merged 18 commits into from
Nov 28, 2019

Conversation

staticfloat
Copy link
Contributor

@staticfloat staticfloat commented Oct 3, 2019

Note that this requires the Julia 1.3+ version of cairo as well (which is why the Project.toml shows Cairo.jl as being dev'ed)

This doesn't work totally yet; it crashes halfway through the tests on my mac because it can't load some icons.

This now passes all tests locally, but the windows that pop up are never drawn into; they remain white. More debugging information below.

@giordano giordano mentioned this pull request Oct 9, 2019
src/Gtk.jl Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
staticfloat and others added 4 commits October 17, 2019 09:35
Co-Authored-By: Mosè Giordano <giordano@users.noreply.github.com>
To attract a wild Mose to your project, leave a newline at the end of
your `.gitignore` as a gentle offering.
Project.toml Show resolved Hide resolved
@tknopp
Copy link
Collaborator

tknopp commented Oct 18, 2019

For reference here is a list of TODO items:

  • Make it work on Windows, Travis could be enabled
  • Make it work on Linux
  • We get on Mac this warning: gdk-pixdump possibly not installed correctly JuliaPackaging/Homebrew.jl#121 (comment). If I recall we did not have this with the working homebrew setup. From that link one can crawl the history since maybe @staticfloat has resolved this at that time
  • Package loading went from 2s to 12s. This is not really acceptable given that the linux setup currently runs fine.
  • Fix the warning: (julia:4891): Gtk-WARNING **: 21:55:48.913: infinite surface size not supported

src/Gtk.jl Outdated
dirname(hicolor_icons_dir),
joinpath(dirname(GTK3_jll.libgdk3_path), "..", "share"),
get(ENV, "XDG_DATA_DIRS", nothing),
]), ":")
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the separator be a semicolon on Windows? @ianshmean can you please check if this fixes the issue you reported yesterday? As far as I can see, this variable is not currently set on Windows, so I'm not sure this will be sufficient...

@codecov
Copy link

codecov bot commented Oct 21, 2019

Codecov Report

Merging #447 into master will increase coverage by 0.53%.
The diff coverage is 58.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #447      +/-   ##
==========================================
+ Coverage    47.5%   48.03%   +0.53%     
==========================================
  Files          31       31              
  Lines        2128     2117      -11     
==========================================
+ Hits         1011     1017       +6     
+ Misses       1117     1100      -17
Impacted Files Coverage Δ
src/GLib/GLib.jl 70% <ø> (ø) ⬆️
src/events.jl 50.7% <ø> (-2.63%) ⬇️
src/gtktypes.jl 78.57% <ø> (ø) ⬆️
src/boxes.jl 5.4% <0%> (ø) ⬆️
src/cairo.jl 42.1% <0%> (ø) ⬆️
src/GLib/signals.jl 75.11% <100%> (+0.35%) ⬆️
src/Gtk.jl 90.47% <100%> (+30.47%) ⬆️
src/displays.jl 9.52% <12.5%> (ø) ⬆️
src/selectors.jl 21.42% <0%> (-1.83%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfcfdf5...da2cea7. Read the comment docs.

@staticfloat
Copy link
Contributor Author

On my linux desktop, using Gtk on this branch takes 15s, which is abysmal.

We know that at least 30% of this is due to a regression in type inference, at least 10% of it is due to missing precompile statements in Pkg, and there is a suspiciously large amount of code being generated within the JLL precompilation files. We're looking into it, but these issues almost certainly will not be fixed in 1.3, but will have to be addressed with a 1.3.1 release.

@staticfloat
Copy link
Contributor Author

Windows seems to be failing to create the gdk-pixbuf cache. I'm investigating.

@tknopp
Copy link
Collaborator

tknopp commented Oct 25, 2019

Windows seems to be failing to create the gdk-pixbuf cache. I'm investigating.

Just on AppVeyor, right? On Travis CI its is working on windows. The only thing is that one warning we see on all platforms.

@staticfloat
Copy link
Contributor Author

staticfloat commented Oct 25, 2019

That's correct; I'm guessing there's some kind of DLL missing in the cut-down Travis environment or something, because in my test on a full windows workstation, it works just fine. I'm not going to look into it anymore then. :)

@tknopp
Copy link
Collaborator

tknopp commented Oct 25, 2019

If Travis runs reliably, there is no need for appVeyor.

@giordano
Copy link
Contributor

If Travis runs reliably, there is no need for appVeyor.

In my all-platforms build Travis timed out on Windows (but cannot see why on the phone): https://travis-ci.com/giordano/Gtk.jl/builds/133476408

@staticfloat
Copy link
Contributor Author

It looks like the while sleep 540 ; do echo "===== saying hello to Travis ====="; done loop keeps running in the background forever.

@giordano
Copy link
Contributor

That was to keep Travis awake in the aarch64 build 😩

@staticfloat
Copy link
Contributor Author

I think you're going to need to do a little bit of job control on windows; after the main script has ended, you'll need to kill your background task. This is probably only a problem on windows.

@jonathanBieler
Copy link
Collaborator

jonathanBieler commented Nov 28, 2019

I'm trying this on windows 10 (julia v1.3 and Cairo master) but I'm getting this :

julia> using Gtk
[ Info: Precompiling Gtk [4c0ca9eb-093a-5379-98c5-f87ac0bbbf44]
WARNING: redefining constant libgdk
WARNING: redefining constant libgtk

(julia.exe:9416): GLib-GObject-WARNING **: 21:11:40.394: cannot register existing type 'GApplication'

(julia.exe:9416): GLib-GObject-WARNING **: 21:11:40.395: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(julia.exe:9416): GLib-GObject-WARNING **: 21:11:40.396: cannot register existing type 'GActionGroup'

(julia.exe:9416): GLib-GObject-CRITICAL **: 21:11:40.396: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(julia.exe:9416): GLib-CRITICAL **: 21:11:40.396: g_once_init_leave: assertion 'result != 0' failed

(julia.exe:9416): GLib-GObject-CRITICAL **: 21:11:40.396: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(julia.exe:9416): GLib-GObject-WARNING **: 21:11:40.396: cannot register existing type 'GActionMap'

(julia.exe:9416): GLib-GObject-CRITICAL **: 21:11:40.396: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

(julia.exe:9416): GLib-CRITICAL **: 21:11:40.397: g_once_init_leave: assertion 'result != 0' failed

(julia.exe:9416): GLib-GObject-CRITICAL **: 21:11:40.398: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(julia.exe:9416): GLib-CRITICAL **: 21:11:40.398: g_once_init_leave: assertion 'result != 0' failed

(julia.exe:9416): GLib-GObject-CRITICAL **: 21:11:40.399: g_type_register_static: assertion 'parent_type > 0' failed

(julia.exe:9416): GLib-GObject-WARNING **: 21:11:40.400: cannot add private field to invalid (non-instantiatable) type '<invalid>'

(julia.exe:9416): GLib-CRITICAL **: 21:11:40.400: g_once_init_leave: assertion 'result != 0' failed
ERROR: LoadError: LoadError: Could not find gtk_application in libgtk. This is likely a issue with a missing Gtk.jl version check.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] top-level scope at C:\Users\User\.julia\dev\Gtk\src\gtktypes.jl:17
 [3] include at .\boot.jl:328 [inlined]
 [4] include_relative(::Module, ::String) at .\loading.jl:1105
 [5] include at .\Base.jl:31 [inlined]
 [6] include(::String) at C:\Users\User\.julia\dev\Gtk\src\Gtk.jl:2
 [7] top-level scope at C:\Users\User\.julia\dev\Gtk\src\Gtk.jl:53
 [8] include at .\boot.jl:328 [inlined]
 [9] include_relative(::Module, ::String) at .\loading.jl:1105
 [10] include(::Module, ::String) at .\Base.jl:31
 [11] top-level scope at none:2
 [12] eval at .\boot.jl:330 [inlined]
 [13] eval(::Expr) at .\client.jl:425
 [14] top-level scope at .\none:3
in expression starting at C:\Users\User\.julia\dev\Gtk\src\gtktypes.jl:117
in expression starting at C:\Users\User\.julia\dev\Gtk\src\Gtk.jl:53
ERROR: Failed to precompile Gtk [4c0ca9eb-093a-5379-98c5-f87ac0bbbf44] to C:\Users\User\.julia\compiled\v1.3\Gtk\Vjnq0_6yYR4.ji.
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1283
 [3] _require(::Base.PkgId) at .\loading.jl:1024
 [4] require(::Base.PkgId) at .\loading.jl:922
 [5] require(::Module, ::Symbol) at .\loading.jl:917

Is it supposed to work ? Maybe I should try with a clean install.

@giordano
Copy link
Contributor

giordano commented Nov 28, 2019

WARNING: redefining constant libgdk
WARNING: redefining constant libgtk

doesn't sound right I think. Do you still have something in deps/?

Maybe I should try with a clean install.

That would make sure that you're not messing up with some leftover of previous installations

@tknopp
Copy link
Collaborator

tknopp commented Nov 28, 2019

Current travis run looks ok despite x86 on windows.

@tknopp tknopp merged commit b00658d into JuliaGraphics:master Nov 28, 2019
@tknopp
Copy link
Collaborator

tknopp commented Nov 29, 2019

@jonathanBieler: The JLL branch had an issue with existing deps/* files which were in the gitignore. Try switch to master where I have fixed this and make sure that there is no deps directory anymore.

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

Successfully merging this pull request may close these issues.

4 participants