Plots issues using wayland on arch

Hi everyone, I am running an arch-linux machine using wayland for my display manager, and sway for my windows manager. I DO have the QT5 support package installed as well (qt5-wayland). That being said whenever I run a script trying to generate a plot using Plots I receive an error telling me Julia could not launch qt-5.

According to my research at the link posted here, this error is occuring because the does not include support for the wayland backend. Their purposed solution is to do the following:

] build GR

They suggest that this uses the sciapp tarball which does include support for wayland. While this builds fine, the next time I try to run anything generating plots julia tells me that my GR package is not completely built and then it rebuilds it to point back to the source!

It also might be worth knowing that when I first installed julia I used the official arch repositories and plots worked fine, however, I had other errors so I followed the best practice of using paru and got the julia-bin from AUR instead (after uninstalling the original). It’s been working well up till now.

TL;DR Need help setting up my julia environment on arch using wayland!

EDIT: here is the error in question

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""

I’m on arch using sway as well. I never use the GR backend though but Makie and specifically GLMakie. If you’ve tarball installed Julia then in arch I often have to go in and update the outdated .so files that comes with the Julia tarball. Basically copying them from my ‘/use/lib’ to the Julia lib folder. This has fixed many problems with Makie for me. Not sure if it works for you though.

Thanks DoctorMike. I’m still pretty new to arch and learning a lot so this might be dumb but I have a few follow up questions.

The archwiki suggests installing julia-bin from the AUR as opposed to using pacman to directly install the version maintained in the arch repositories. I notice that my /usr/lib/ has a qt folder but my /bin/julia/ does not, are you saying that i should copy the qt folder into my julia directory?

This is the specific error I am getting

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""

I have done some more digging and I see that maybe replacing the julia is a good idea. Are you copying from /usr/lib to usr/lib/julia/ ?

You might need to build GR against your QT library.

I found a simple solution that works. I had xorg-xwayland installed just because of such compatibility issues, but I had set an environment variable in my .bash_profile to basically force the session to be in wayland:

if [ "$(tty)" = "/dev/tty1" ] ; then
        #Your environment variables
        export QT_QPA_PLATFORM=wayland
        export MOZ_ENABLE_WAYLAND=1
        export MOZ_WEBRENDER=1
        export XDG_SESSION_TYPE=wayland
        export XDG_CURRENT_DESKTOP=sway
        exec sway

Once I commented out that first line everything worked fine.

That being said I really don’t know what it means to build a package against another packages library, and I feel like that is something I should know how to do. Would I just follow the directions in your link but switch out python for julia like below?

PYTHONPATH=${PYTHONPATH}:/usr/local/gr/lib/python becomes JULIAPATH=${JULIAPATH}:/usr/local/gr/lib/julia

Or is python essential to the build and I just replace some of the Qt files in the git clone with some from my stem library and then do everything else the same?

I’m glad that you found a solution.

Essentially, binary files contain embedded links to other binaries. @jheinen would be the best person to answer these questions.

He may answer here, but you may also want to consider opening a Github issue on either on these repositories.

I’ll look into that, thanks again!

Yes. That’s what I’m doing. :slight_smile:

Just to be clear, I never install julia from AUR or using pacman. I always download the tarball from and untar it and link it to my own ~/bin folder.

Great! Just two follow up follow up questions (sorry!).

When you untarball it where do you choose to put the destination? $HOME/julia?

I have done a lot of reading on the process of linking and the difference between symbolic and hard links and I still find it a bit intimidating. Because we are linking directories I am assuming we are creating a softlink. We are tying to create a softlink between our /bin and our $HOME/julia/bin correct? Are you just doing ln -s /bin $HOME/julia/?

Could I link it to /usr/bin/ instead?

Finally how do you know which .so files to copy over? Thanks again for all your patience and help :slight_smile:

and now im just adding things because I accidentally deleted this post and now it won’t let me add it again becuse “the body is too similar to what I previously posted!”

@charperflow : Feel free to open an issue on one sciapp/gr. The best solution, in my opinion, would be to add the Wayland plugin to the BinaryBuilder Qt build configuration.

Mixing binaries from different sources is always problematic. That’s why in GR we provide both self-contained and OS specific variants for the most popular platforms. A single distribution can then be used from different languages (Julia, Python, Ruby, C/C++).

@jheinen Thanks for your reply! I’m still learning how the organization of all these file systems works and exactly whats happening when I “build” my own packages. Would you mind clarifying a few points for me?

Mixing binaries from different sources is always problematic.

What exactly does this mean? Is this what I would be doing by creating a symbolic link between a binary folder in wherever I build julia and my /usr/bin/? Won’t my system binary’s be different . Whenever I build a new package it creates a new directory in /usr/bin/<new_package> so don’t I already have a bunch of different binaries from different sources? Sorry Im just a bit confused :sweat_smile:

The best solution, in my opinion, would be to add the Wayland plugin to the BinaryBuilder Qt build configuration.

How would one go about doing this? I have tried to read a lot of documentation on the build process, and have read ArchWiki’s page on MakePKG, but there is so much going on in this process! My understanding is really surface level, but here is my current best take.

You should create a ~/bin directory and inside of that soft link the julia binary from the extracted tarball. Then you should make sure that your bin directory is in your path. Then you can start Julia from your terminal.

If you use binaries from different sources, there might be incompatibilities during run-time due to different source versions or build options. The Qt Wayland plugin is such an example - it seems not to be enabled for the BinaryBuild Qt5 build. As a solution, Wayland users should make a feature request here. It seems to me, that the BB Qt distribution only provides a minimal Qt environment.

@giordano Would you like to comment on building QT on Wayland support in BinaryBuilder?

If I knew anything about building Qt I could answer, but I don’t.

Well thanks for all the feedback everyone. I genuinely appreciate it. Maybe one day I’ll understand the build process enough to do some of these things. But at least I have a work around for the time being :slight_smile:

I assume, the --skip-wayland option has to be removed here. However, I do not know if this has side effects and could not test it.

@charperflow : May be you can make a merge request.