Relocatable Makie app

I want to share some results with a college so that he can have a look at the data himself.
Plotly can export an HTML which is interactive, but WGLMakie can not (as far as I known). It is mainly time series charts where it would be nice to pan and zoom around.

I have this very basic app to test the approach, but it appears to be not relocatable.

module MakieTestApp

using GLMakie

function julia_main()::Cint
    # do something based on ARGS?

    fig1 = Figure()
    ax1 = Axis(fig1[1, 1])
    lines!(ax1, cumsum(randn(100)))
    lines!(ax1, cumsum(randn(100)))
    lines!(ax1, cumsum(randn(100)))

    screen2 = GLMakie.Screen()
    display(screen2, fig1)

    fig2 = Figure()
    ax1 = Axis(fig2[1, 1])
    lines!(cumsum(randn(100)))
    lines!(cumsum(randn(100)))
    lines!(cumsum(randn(100)))

    screen1 = GLMakie.Screen()
    display(screen1, fig2)

    wait(screen1)
    wait(screen2)

    return 0 # if things finished successfully
end

end # module MakieTestApp
import PackageCompiler
PackageCompiler.create_app(
    "MakieTestApp",
    "MakieTestAppCompiled",
)

When I run the app after compiling I see this screen:

I had an issue with this Glib warning here already: GLib-GIO-WARNING · Issue #4049 · MakieOrg/Makie.jl · GitHub

Nevertheless, on another machine, I get this:

SystemError: opening file "C:\\Users\\KaisermayerV\\.julia\\packages\\GLMakie\\QOOnq\\assets\\shader\\postprocessing/fullscreen.vert": No such file or directory 

What can I do?

BTW there app directory has 1.5GB!

We do have a test for this:

Which should test for not existing ./julia/packages/**
Not sure what’s going wrong in your case… Could you maybe try the code from the test and see if that passes, and then figure out what you do differently from there?

Oh I just realize our test may be incorrect, since the GLMakie source code doesn’t live in .julia/packages/** on the CI.

Maybe; the build options are different

Nop, same problem!

Any recommendations?
I considered WGLMakie but the HTML export appears to be not sufficient for my needs. I want a zoomable time series plot.

I’m guessing, that this part isn’t relocatable anymore:

I’m not 100% sure why, so this is where I would spend the time debugging.

Building new paths from, for example, ASSETS in the above example will return a String containing the resolved path rather than a Path object. Doing this at the module-level will result in hardcoded paths that will run into relocatability issues as discussed above. Always create a new @path for each resource you wish to reference rather than building them in parts, e.g.

So I’m guessing this is the problem:

julia> typeof(GLMakie.SHADER_DIR)
RelocatableFolders.Path

julia> typeof(joinpath(GLMakie.SHADER_DIR, "postprocessing/fullscreen.vert"))
String

This is fixed in the current master of GLMakie.

Thx @sdanisch

BTW, since the relocatability is a job for each and every package, I still do not see that a general Julia app will ever be relocatable out of the box - unless Julia handles this at a high level.

The current plan is to get a helper into Julia 1.12 to deal with the exact issue from this post.

2 Likes