CI fails to build GLMakie dependency

I am trying to set up a CI pipeline for a package that depends on GLMakie. So far this fails with

ERROR: LoadError: Failed to precompile GLMakie [e9467ef8-e4e7-5192-8a1a-b1aee30e663a] to /home/runner/.julia/compiled/v1.7/GLMakie/jl_hvqBqq.

See: https://github.com/aenarete/KiteViewers.jl/runs/6192295040?check_suite_focus=true

How can I fix that?

My current CI.yml: https://github.com/aenarete/KiteViewers.jl/blob/main/.github/workflows/CI.yml

The warning in the log is pretty clear:

┌ Warning:     OpenGL/GLFW wasn't loaded correctly or couldn't be initialized.
│     This likely means, you're on a headless server without having OpenGL support setup correctly.
│     Have a look at the troubleshooting section in the readme:
│     https://github.com/JuliaPlots/Makie.jl/tree/master/GLMakie#troubleshooting-opengl.
└ @ GLMakie ~/.julia/packages/GLMakie/pFGSp/src/gl_backend.jl:4

You’ll need, at least, to deploy an X server with sofware GL rendering. Look for xvfb in the Makie CI scripts, https://github.com/JuliaPlots/Makie.jl/blob/3e4ae3227f3eb4bb507627cd8e41a0850a515f44/.github/workflows/glmakie.yaml.

But I did:

      - run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev

Figured it out. Using the following three lines it works.

      - run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
      - run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project -e 'using Pkg; Pkg.instantiate()'
      - run: DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project -e "using TestEnv; TestEnv.activate(); include(\"test/runtests.jl\")"

Well, on Linux. Any chance to make this work on Windows or Mac?

2 Likes

Sorry for necroposting, not sure whether I should create a new thread for it, but here goes:

I’ve got something very similar in a package of my own which has a GLMakie dependency for an extension.

This is the yml file for the documentation.
It was working alright so far, but on the most recent push, it failed with the following error:

Re-running the previous commit’s workflow, which was previously passing without any issues, now leads to the same error.
Thus I believe it has nothing to do with my package, but it’s probably about the line :

run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev

@ufechner7 , would it be possible to re-run one of your workflows to see if you can reproduce this?

You shouldn’t use ubuntu-latest, but just as in the GLMakie ci:
ubuntu-20.04

1 Like

Thanks for the input Simon.
Unfortunately it seems the issue persists:

Hm, I’m not sure what you do differently then…
I just know that this:

Works fine (tested just now), so I guess you do something slightly differently, which breaks things.

Tried playing around with different ubuntu versions but I just get:

Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/x/xorg-server/xserver-xorg-dev_21.1.4-2ubuntu1.7%7e22.04.11_amd64.deb

I’ve got no idea how to approach this issue.
Any ideas on where to look would be more than appreciated!

For future reference:

Turns out that changing

run: >
    julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
    sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev

to

run: |
    sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev xsettingsd x11-xserver-utils
    DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

solved the issue.

1 Like