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

Gtk window contents not rendering on MacOS (Mojave) #414

Closed
IanButterworth opened this issue Apr 30, 2019 · 37 comments · Fixed by #435 or #436
Closed

Gtk window contents not rendering on MacOS (Mojave) #414

IanButterworth opened this issue Apr 30, 2019 · 37 comments · Fixed by #435 or #436

Comments

@IanButterworth
Copy link
Collaborator

IanButterworth commented Apr 30, 2019

Is the error we're seeing here a bug or misuse issue via VideoIO or ImageView?
JuliaIO/VideoIO.jl#150

julia> VideoIO.viewcam()
FATAL ERROR: Gtk state corrupted by error thrown in a callback:
ERROR: AssertionError: g_stack === nothing && !prev
Stacktrace:
 [1] g_sigatom(::Any) at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/signals.jl:165
 [2] macro expansion at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/signals.jl:191 [inlined]
 [3] show at /Users/ian/.julia/packages/Gtk/aP55V/src/base.jl:35 [inlined]
 [4] Gtk.GtkWindowLeaf(::String, ::Int64, ::Int64, ::Bool, ::Bool) at /Users/ian/.julia/packages/Gtk/aP55V/src/windows.jl:14
 [5] Type at /Users/ian/.julia/packages/Gtk/aP55V/src/windows.jl:2 [inlined]
 [6] #GtkWindow#188 at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/gtype.jl:226 [inlined]
 [7] Type at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/gtype.jl:226 [inlined]
 [8] #imshow_gui#26(::String, ::Symbol, ::Function, ::Tuple{Int64,Int64}, ::ImageView.SliceData{false,0,Tuple{}}, ::Tuple{Int64,Int64}) at /Users/ian/.julia/packages/ImageView/1uiRS/src/ImageView.jl:295
 [9] #imshow_gui at ./none:0 [inlined] (repeats 2 times)
 [10] #imshow#17(::String, ::Symbol, ::Function, ::SubArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,MappedArrays.ReadonlyMappedArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,(2, 1),(2, 1),Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}},typeof(identity)},Tuple{Base.OneTo{Int64},StepRange{Int64,Int64}},false}, ::Reactive.Signal{CLim{ColorTypes.RGB{Float64}}}, ::Reactive.Signal{GtkReactive.ZoomRegion{RoundingIntegers.RInt64}}, ::ImageView.SliceData{false,0,Tuple{}}, ::Reactive.Signal{Dict{UInt64,Any}}) at /Users/ian/.julia/packages/ImageView/1uiRS/src/ImageView.jl:200
 [11] #imshow at ./none:0 [inlined] (repeats 2 times)
 [12] #imshow#13(::Tuple{Int64,Int64}, ::String, ::Function, ::Symbol, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol,Symbol},NamedTuple{(:flipx, :interactive),Tuple{Bool,Bool}}}, ::Function, ::PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,(2, 1),(2, 1),Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}}) at /Users/ian/.julia/packages/ImageView/1uiRS/src/ImageView.jl:177
 [13] (::getfield(ImageView, Symbol("#kw##imshow")))(::NamedTuple{(:flipx, :interactive),Tuple{Bool,Bool}}, ::typeof(imshow), ::PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,(2, 1),(2, 1),Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}}) at ./none:0
 [14] play(::VideoIO.VideoReader{true}, ::Bool) at /Users/ian/Documents/GitHub/VideoIO.jl/src/VideoIO.jl:84
 [15] viewcam(::String, ::Ptr{VideoIO.AVFormat.AVInputFormat}) at /Users/ian/Documents/GitHub/VideoIO.jl/src/VideoIO.jl:101
 [16] viewcam() at /Users/ian/Documents/GitHub/VideoIO.jl/src/VideoIO.jl:100
 [17] top-level scope at none:0

ERROR: AssertionError: g_stack === nothing && !prev
Stacktrace:
 [1] g_sigatom(::Any) at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/signals.jl:165
 [2] macro expansion at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/signals.jl:191 [inlined]
 [3] show at /Users/ian/.julia/packages/Gtk/aP55V/src/base.jl:35 [inlined]
 [4] Gtk.GtkWindowLeaf(::String, ::Int64, ::Int64, ::Bool, ::Bool) at /Users/ian/.julia/packages/Gtk/aP55V/src/windows.jl:14
 [5] Type at /Users/ian/.julia/packages/Gtk/aP55V/src/windows.jl:2 [inlined]
 [6] #GtkWindow#188 at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/gtype.jl:226 [inlined]
 [7] Type at /Users/ian/.julia/packages/Gtk/aP55V/src/GLib/gtype.jl:226 [inlined]
 [8] #imshow_gui#26(::String, ::Symbol, ::Function, ::Tuple{Int64,Int64}, ::ImageView.SliceData{false,0,Tuple{}}, ::Tuple{Int64,Int64}) at /Users/ian/.julia/packages/ImageView/1uiRS/src/ImageView.jl:295
 [9] #imshow_gui at ./none:0 [inlined] (repeats 2 times)
 [10] #imshow#17(::String, ::Symbol, ::Function, ::SubArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,MappedArrays.ReadonlyMappedArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,(2, 1),(2, 1),Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}},typeof(identity)},Tuple{Base.OneTo{Int64},StepRange{Int64,Int64}},false}, ::Reactive.Signal{CLim{ColorTypes.RGB{Float64}}}, ::Reactive.Signal{GtkReactive.ZoomRegion{RoundingIntegers.RInt64}}, ::ImageView.SliceData{false,0,Tuple{}}, ::Reactive.Signal{Dict{UInt64,Any}}) at /Users/ian/.julia/packages/ImageView/1uiRS/src/ImageView.jl:200
 [11] #imshow at ./none:0 [inlined] (repeats 2 times)
 [12] #imshow#13(::Tuple{Int64,Int64}, ::String, ::Function, ::Symbol, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol,Symbol},NamedTuple{(:flipx, :interactive),Tuple{Bool,Bool}}}, ::Function, ::PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,(2, 1),(2, 1),Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}}) at /Users/ian/.julia/packages/ImageView/1uiRS/src/ImageView.jl:177
 [13] (::getfield(ImageView, Symbol("#kw##imshow")))(::NamedTuple{(:flipx, :interactive),Tuple{Bool,Bool}}, ::typeof(imshow), ::PermutedDimsArray{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2,(2, 1),(2, 1),Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}}) at ./none:0
 [14] play(::VideoIO.VideoReader{true}, ::Bool) at /Users/ian/Documents/GitHub/VideoIO.jl/src/VideoIO.jl:84
 [15] viewcam(::String, ::Ptr{VideoIO.AVFormat.AVInputFormat}) at /Users/ian/Documents/GitHub/VideoIO.jl/src/VideoIO.jl:101
 [16] viewcam() at /Users/ian/Documents/GitHub/VideoIO.jl/src/VideoIO.jl:100
 [17] top-level scope at none:0

@kmsquire

@timholy
Copy link
Member

timholy commented Apr 30, 2019

I have not routinely seen that with ImageView and "straightforward" image series (e.g., stored as mmapped files). You can play with testimages("mri") if you need a simple, small demo.

@IanButterworth
Copy link
Collaborator Author

@timholy It seems I should've checked the basics first! Images aren't rendering in the window for me JuliaImages/ImageView.jl#175

@IanButterworth IanButterworth changed the title VideoIO -> ImageView -> Gtk error. Gtk bug or misuse? Gtk window contents not rendering on MacOS (Mojave) May 2, 2019
@IanButterworth
Copy link
Collaborator Author

IanButterworth commented May 2, 2019

This issue seems to stem from Gtk.jl given the following:

Cairo
All tests pass and this example renders properly
image

Gtk
All tests pass, but no examples I've tried render anything in the window. For instance, the first example:

using Gtk

win = GtkWindow("My First Gtk.jl Program", 400, 200)

b = GtkButton("Click Me")
push!(win,b)

showall(win)

image

GtkReactive
Tests fail due to canvas size issue

using GtkReactive, Gtk.ShortNames, Graphics, Test

c = canvas(208, 207)
win = Window(c)
Gtk.showall(win)
sleep(0.1)
@test Graphics.width(c) == 208
@test Graphics.height(c) == 207
Expression: Graphics.width(c) == 208
Evaluated: 1 == 208

Expression: Graphics.height(c) == 207
Evaluated: 1 == 207

JuliaGizmos/GtkReactive.jl#87
JuliaImages/ImageView.jl#175
JuliaGizmos/GtkReactive.jl#86

@timholy
Copy link
Member

timholy commented May 4, 2019

Since OSX worked at one point, in the absence of better ideas I'd recommend checking out older versions and testing them.

@IanButterworth
Copy link
Collaborator Author

In search of reasons... It looks like my gtk+3 brew install is broken.

julia> Homebrew.brew(`reinstall gtk+3`)
==> Reinstalling gtk+3 
==> Downloading https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.8.tar.xz
Already downloaded: /Users/ian/Library/Caches/Homebrew.jl/downloads/e962619b2823e9ecdba6611331876cf0daa34bebcfaa921eb61d03d300b1c22b--gtk -3.24.8.tar.xz
==> ./configure --enable-debug=minimal --prefix=/Users/ian/.julia/packages/Homebrew/s09IX/deps/usr/Cellar/gtk+3/3.24.8 --disable-glibtest --enable-introspection=yes --disable-schemas-compile --enable-qua
==> make install
Last 15 lines from /Users/ian/Library/Logs/Homebrew/gtk+3/02.make:
  CC       libgdk_3_la-gdkenumtypes.lo
  CC       libgdk_3_la-gdkmarshalers.lo
  CC       libgdk_3_la-gdkresources.lo
  GEN      gdkconfig.h
  CC       deprecated/libgdk_3_la-gdkcolor.lo
  CCLD     libgdk-3.la
  GISCAN   Gdk-3.0.gir
gdkversionmacros.h:35: Warning: Gdk: multiple comment blocks documenting 'GDK_DISABLE_DEPRECATION_WARNINGS:' identifier (already seen at gdk.c:106).
  GICOMP   Gdk-3.0.gir
Could not find GIR file 'GdkPixbuf-2.0.gir'; check XDG_DATA_DIRS or use --includedir
error parsing file Gdk-3.0.gir: Failed to parse included gir GdkPixbuf-2.0
make[3]: *** [Gdk-3.0.typelib] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1

READ THIS: https://docs.brew.sh/Troubleshooting

ERROR: failed process: Process(`/Users/ian/.julia/packages/Homebrew/s09IX/deps/usr/bin/brew reinstall gtk+3`, ProcessExited(1)) [1]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:785 [inlined]
 [3] #run#515(::Bool, ::Function, ::Cmd) at ./process.jl:726
 [4] run at ./process.jl:724 [inlined]
 [5] #brew#4(::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Function, ::Cmd) at /Users/ian/.julia/packages/Homebrew/s09IX/src/API.jl:19
 [6] brew(::Cmd) at /Users/ian/.julia/packages/Homebrew/s09IX/src/API.jl:11
 [7] top-level scope at none:0

Running Homebrew.brew(`reinstall gdk-pixbuf`) finishes successfully, but doesn't fix the above

@IanButterworth
Copy link
Collaborator Author

And I tried rolling back to all v1.0 compatible Gtk.jl releases and that didn't fix it, so seems like an issue with underlying Gtk or a homebrew dep

@tknopp
Copy link
Collaborator

tknopp commented May 5, 2019

I am on OSX Mojave and Gtk.jl is working fine here.

@IanButterworth
Copy link
Collaborator Author

Ah.. @damiansp is experiencing the same issue over at JuliaImages/ImageView.jl#175 so at least I'm not alone..

@IanButterworth
Copy link
Collaborator Author

Perhaps the GdkPixbuf-2.0.gir issue above is linked to the following build step not running, given ENV["XDG_DATA_DIRS"] isn't defined for me after build..

Gtk.jl/deps/build.jl

Lines 47 to 56 in 636d0fe

function __init__bindeps__()
if "XDG_DATA_DIRS" in keys(ENV)
ENV["XDG_DATA_DIRS"] *= ":" * joinpath("$(Homebrew.brew_prefix)", "share")
else
ENV["XDG_DATA_DIRS"] = joinpath("$(Homebrew.brew_prefix)", "share")
end
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")
run(`$(joinpath("$(Homebrew.brew_prefix)", "bin/gdk-pixbuf-query-loaders")) --update-cache`)
end

How should __init__bindeps__() be being called? I can't find any calls. Apart from a call to the same named function from the Glib submodule, which appears to be missing:

GLib.__init__bindeps__()

@berndblasius
Copy link

I have the same issue on OSX Mojave.

This happened three days ago. I had Gtk running, but drawing on Canvas was about factor 10 slower than on Linux machine. So I updated and rebuild Gtk, which produced exactly the same error of canvas not rendering.

Yesterday I tried to go to older Gtk version but then Cairo has build errors. That is, I removed all julia packages and did ] add [email protected] , which resulted in "Error building Cairo.
When I do ] add Gtk, I receive no build errors, but Gtk fails to render on Canvas.

Btw, I my case ENV["XDG_DATA_DIRS"] is defined after build to ".julia/packages/Homebrew/s09IX/deps/usr/share"

@berndblasius
Copy link

Ok, I managed to get it working on OSX Mojave.

[email protected] depends on [email protected]
Trying to install [email protected] I ran into:
https://github.com/JuliaGraphics/Cairo.jl/issues/279
and https://github.com/JuliaGraphics/Cairo.jl/issues/271

Following the hints in these issues, I downgraded glib from v.2.6 to 2.58.3 (both on systemwide homebrew and on julia's local Homebrew), after which I could build Cairo 0.5.6 and then Gtk 0.56.
After this, Gtk is working again.

Note though, that I again experience the performance issues: rendering some images on Canvas is about a factor 10 slower than on a comparable Linux machine.

@IanButterworth
Copy link
Collaborator Author

ok. Good to know, but the slowdown you see is concerning.

I had initially thought that Gtk v0.17.0 was just a Project.toml & travis update, from the release tag notes, but it seems the release notes missed a lot of other changes.

@tknopp I'm wondering why you don't experience this. Is your homebrew up to date etc.? I would assume that breaks it, if you aren't.

@tknopp
Copy link
Collaborator

tknopp commented May 6, 2019

I am not sure if my Homebrew setting is up to date. Currently, I need a working environment and will therefore not update in the next couple of weeks.

@logankilpatrick
Copy link
Contributor

@tknopp Hey! I think this is still and issue. I cannot get anything to show up on Mojave.

@tknopp
Copy link
Collaborator

tknopp commented Jun 5, 2019

I have upgraded to Mojave and it still works.

@logankilpatrick
Copy link
Contributor

I should rephrase, a window renders, but that is all. What version of homebrew are you using? I will check mine and report back tonight. @ianshmean are you able to get the example on the Gtk.jl docs to render a functional button?

@mattphilly
Copy link

@tknopp I am also having this issue. I am running Julia 1.0.1 on Mojave. I have tried to download both my Cairo and Gtk packages, but they keep defaulting to the #master package even when I try to add an older version. Attached is my code below.

(v1.1) pkg> add [email protected]
Resolving package versions...
Updating ~/.julia/environments/v1.1/Project.toml
[159f3aea] + Cairo v0.6.0 #master (https://github.com/JuliaGraphics/Cairo.jl.git)
Updating ~/.julia/environments/v1.1/Manifest.toml
[4c0ca9eb] ~ Gtk v0.17.0 #master (https://github.com/JuliaGraphics/Gtk.jl.git) ⇒ v0.17.0 #master (https://github.com/JuliaGraphics/Gtk.jl.git)

julia> Pkg.status()
Status ~/.julia/environments/v1.1/Project.toml
[ad839575] Blink v0.10.1
[336ed68f] CSV v0.4.3
[159f3aea] Cairo v0.6.0 #master (https://github.com/JuliaGraphics/Cairo.jl.git)
[5ae59095] Colors v0.9.5
[5a033b19] CurveFit v0.3.2
[a93c6f00] DataFrames v0.18.2
[39dd38d3] Dierckx v0.4.1
[b4f34e82] Distances v0.8.0
[31c24e10] Distributions v0.19.2
[5789e2e9] FileIO v1.0.6
[a2bd30eb] Graphics v0.4.0
[27996c0f] GtkReactive v0.6.0
[d9be37ee] Homebrew v0.7.1
[7073ff75] IJulia v1.18.1
[4381153b] ImageDraw v0.2.0
[6a3955dd] ImageFiltering v0.6.2
[6218d12a] ImageMagick v0.7.3
[787d08f9] ImageMorphology v0.2.3
[80713f31] ImageSegmentation v1.2.0
[86fae568] ImageView v0.9.0
[916415d5] Images v0.18.0
[c601a237] Interact v0.10.2
[2fda8390] LsqFit v0.8.1
[76087f3c] NLopt v0.5.1
[58dd65bb] Plotly v0.2.0
[f0f68f2c] PlotlyJS v0.12.4
[91a5bcdd] Plots v0.25.0
[438e738f] PyCall v1.91.2
[d330b81b] PyPlot v2.8.1
[1fd47b50] QuadGK v2.0.3
[dca85d43] QuartzImageIO v0.6.0
[a223df75] Reactive v0.8.3
[2913bbd2] StatsBase v0.30.0
[5e47fb64] TestImages v0.5.1
[ade2ca70] Dates

@tknopp
Copy link
Collaborator

tknopp commented Jun 7, 2019

the Gtk.jl version does not matter, see #421 (comment) what matters.

@ghost
Copy link

ghost commented Aug 17, 2019

I can confirm that downgrading glib to 2.58.3 fixes the issue:

using Homebrew
Homebrew.brew(`unlink glib`)
Homebrew.brew(`install https://raw.githubusercontent.com/Homebrew/homebrew-core/b27a055812fe620e0d3dbe67f2a424ed3a846ecf/Formula/glib.rb`)

Quit and relaunch Julia afterwards.

(Took a while to hunt down that URL, mainly due to having to download the entire non-shallow Git repository of Homebrew, Github not providing access to it. I don't know what the Homebrew devs are smoking having removed an easy way to install old versions. Git, nuts, and bolts, probably!)

@ghost
Copy link

ghost commented Aug 17, 2019

I can confirm that downgrading glib to 2.58.3 fixes the issue:

@logankilpatrick
Copy link
Contributor

Testing now!

This was referenced Aug 18, 2019
@ghost
Copy link

ghost commented Aug 27, 2019

Sorry but… you call #435 a fix? Just pushing the ball to the user who is still going to run into an error and then supposed to hunt around the web, now hopefully finding your index.md instead of this thread. No essential change to the current situation. #435 is a workaround that should never be used to “close” a bug. Sweeping things under the rug, beautifying the issues list.

@ghost
Copy link

ghost commented Aug 27, 2019

(I guess I'll just use external viewers, avoiding the plague-that-killed-Linux of Gtk that way as well. Julia has the same problems that Octave always had and which is why it never took over Matlab: absolutely shoddy and fragile graphics system. Just things put together with duct tape and cable ties… which closing this issue with #435 proves.)

@tknopp
Copy link
Collaborator

tknopp commented Aug 27, 2019

I agree that #435 is not fixed but please stop ranting over a project that is made by volunteers. Gtk.jl is currently more or less maintainer-less, so what do you expect?

@logankilpatrick
Copy link
Contributor

@vomout just trying to do what I can to help as many people as I can. I wish I had a better solution. Sorry if I made it seem like I “solved” the issue rather than just finding a workaround.

@logankilpatrick
Copy link
Contributor

I suppose I can write a custom script that checks the os and if you’re on a certain OS, it gives a warning and tells you to go run the file... @tknopp do you think this will help at all or no?

@IanButterworth
Copy link
Collaborator Author

There's renewed efforts into getting the deps of Cairo and Gtk built through BinaryBuilder. It's no small task, but if working should resolve this issue properly.

In the mean time, fixes like you suggest @logankilpatrick seem like a good idea, but implementing user warnings in build.jl aren't trivial as the output is sent to a log file during build. It may be better as an error..

@logankilpatrick
Copy link
Contributor

I'll take a look tonight @ianshmean

@tknopp
Copy link
Collaborator

tknopp commented Aug 27, 2019

As indicated in JuliaGraphics/Cairo.jl#229 (comment), the solution could be a BinaryProvider with existing binaries. This would be much easier than the BinaryBuilder solution. Its just that somebody needs to make this. Until now, nobody had bandwidth.

@IanButterworth
Copy link
Collaborator Author

Indeed. But also, check out the #binarybuilder slack channel for @giordano's progress on getting crosscompiling working

@jonathanBieler
Copy link
Collaborator

jonathanBieler commented Aug 27, 2019

@vomout to be clear this issue was closed automatically when merging because of the "close" keyword in the PR, it doesn't necessarily mean it's fixed. But having a workaround in the doc is better than not. We can reopen it if needed though.

@ghost
Copy link

ghost commented Aug 27, 2019

And what is that BinaryBuilder supposed to do? Distribute an obsolete version of glib just for JuliaGraphics? If so, how about actually figuring out what the real problem is and fixing it? Why does a newer version of glib not work? 2.58.3 is the last before 2.60.xx in Homebrew, so what happened between those? Did the glib authors completely change how functions are parameterised? If not, does Glib.jl directly access some data structures that were changed? If they did not change parameterisations/data structure contents, then was some function removed that Glib.jl is using? But shouldn't in that case Julia at least complain about it as a missing function?

If it's API binary incompatibility, then—while a fix is being worked on—why does something not detect it? Can't test cases be implemented (possibly in C) to check that the API is what is expected? Can't Glib.jl at least check the version and fail with a complaint if it's known not to be binary-compatible?

If it's not API incompatibility, and just on MacOS, then why is it just on MacOS? That would be very odd, Glib shouldn't be particularly OS-related at all.

And, please, everyone, complain to Homebrew devs about how they were smoking some seriously strongly iPhone-infused herbal things when they removed support for easily installing/requesting older versions. Wouldn't it be nice if—while support for latest versions of glib is being implemented—Glib.jl could simply ask for a specific version? It really gets me at least once month, having to dive into the histories and manually constructing URLs where to get old versions. (hg-git—the sane user interface to git, via Mercurial—is rarely compatible with latest Mercurial, and pinning in Homebrew is not reliable.)

(No, I'm not going to use serious amount of my time to learn and figure out Glib and whatever. If I use a lot of time it is better spent implementing something that doesn't depend on G-land.)

@giordano
Copy link
Contributor

giordano commented Aug 27, 2019

Disclaimer: I have no idea what was the problem discussed here, I'm only going to reply to one point.

And what is that BinaryBuilder supposed to do? Distribute an obsolete version of glib just for JuliaGraphics?

The goal of BinaryBuilder/BinaryProvider is to provide a single tested version of the library, pre-built for as many platforms as possible. When wrapping a library, it's important to target a specific version, it's going to be a mess if on a platform you have vX.Y.Z and on another one vA.B.C, because of API changes.

Regarding glib, currently we build v2.59.0 which is 8-month old (see https://github.com/JuliaPackaging/Yggdrasil/blob/1d5bfb92562a583988e630875d6ad5b6fcbe2873/G/Glib/build_tarballs.jl), just because it's the last one that can be built with Autotools. As soon as we get support for Meson in BinaryBuilder, we can move on to build more recent versions.

@lobingera
Copy link
Contributor

@vomout Do you volunteer to work on it and do answers to your questions speed up the process? Or do you just want to complain about the experimental state of providing binary dependencies in julia?

Because the second one has been done already a few times by a lot of people - incl. myself.

There was no BIG change in glib, but afair (in BinDeps/Homebrew and Mojave there are more problems) BinDeps opens libglib.so two times - the first time to check if it exists and the second time to work with it. Unfortunately libglib has some own memory management that is setup at opening time and surprise, surprise strange things start to happen if you open it a second time. These libs have not been designed to be reopened or initialized at runtime, but rather to be loaded by ld.so - so at the time of process initialization. Afaiu this is already true for long time and just by sheer luck never showed up as problem in julia/BinDeps on all plattforms.

@ghost
Copy link

ghost commented Aug 28, 2019

@lobingera oh, that could explain some other issues as well (high idle CPU usage after a while and occasional crashes with the whole G-land loaded as required by ImageView). Probably not #437, though, which I think is another similar fundamental error with how the G-land is being used.

As said in my earlier post, I won't waste my time on G-land, but I could possibly lend a hand with other more generally useful things—if it does not involve touching Git, doing rebase rubbish instead of standard merges, etc. (In other words, if I can work with the history-preserving non-garbage-collecting Mercurial and hg-git without messing things up.)

@lobingera
Copy link
Contributor

@vomout The high CPU i'd rather put on the (missing) integration of the Gtk event loop into the uv basis of the REPL.

@ghost
Copy link

ghost commented Aug 28, 2019

@vomout The high CPU i'd rather put on the (missing) integration of the Gtk event loop into the uv basis of the REPL.

So that would probably be the same as #437: window content is not refreshed in a computational loop (drawing results on each iteration of an algorithm) until returning to the command line or unless an (initial) sleep call is performed. That somehow seems to pass control to the Gtk event loop. Probably

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 a pull request may close this issue.

9 participants