# CI fails to build GLMakie dependency

**URL:** <https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125>\
**Category:** General Usage\
**Tags:** question, ci, glmakie\
**Created:** [April 27, 2022, 11:20am UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125 "2022-04-27T11:20:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 27, 2022, 11:20am UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/1 "2022-04-27T11:20:07Z")

</div>

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

```julia
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](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](https://github.com/aenarete/KiteViewers.jl/blob/main/.github/workflows/CI.yml)

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [April 27, 2022, 11:29am UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/2 "2022-04-27T11:29:53Z")

</div>

The warning in the log is pretty clear:

```julia
┌ 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](https://github.com/JuliaPlots/Makie.jl/blob/3e4ae3227f3eb4bb507627cd8e41a0850a515f44/.github/workflows/glmakie.yaml).

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 27, 2022, 1:01pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/3 "2022-04-27T13:01:33Z")

</div>

But I did:

```julia
      - 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

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 27, 2022, 3:08pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/4 "2022-04-27T15:08:32Z")

</div>

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

```julia
      - 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?

---

<div class="post-metadata">

**Author:** ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)\
**Post date:** [November 1, 2024, 1:57pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/5 "2024-11-01T13:57:27Z")

</div>

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](https://github.com/aris-mav/NMRInversions.jl/actions/runs/11628578832/workflow) 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:

> <https://github.com/aris-mav/NMRInversions.jl/actions/runs/11628578832/job/32385083626#step:5:970>

Re-running the previous commit’s workflow, which was [previously passing](https://github.com/aris-mav/NMRInversions.jl/actions/runs/11535090762/attempts/1) without any issues, now [leads to the same error](https://github.com/aris-mav/NMRInversions.jl/actions/runs/11535090762/attempts/2).  
Thus I believe it has nothing to do with my package, but it’s probably about the line :

```julia
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?

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 1, 2024, 2:28pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/6 "2024-11-01T14:28:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)\
**Post date:** [November 1, 2024, 2:45pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/7 "2024-11-01T14:45:47Z")

</div>

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

> <https://github.com/aris-mav/NMRInversions.jl/actions/runs/11631064417/job/32391320764>

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 1, 2024, 3:15pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/8 "2024-11-01T15:15:22Z")

</div>

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

> <https://github.com/MakieOrg/Makie.jl/blob/master/.github/workflows/reference_tests.yml#L67-L117>

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

---

<div class="post-metadata">

**Author:** ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)\
**Post date:** [November 1, 2024, 4:23pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/9 "2024-11-01T16:23:53Z")

</div>

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

```julia
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!

---

<div class="post-metadata">

**Author:** ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)\
**Post date:** [November 3, 2024, 12:56pm UTC](https://discourse.julialang.org/t/ci-fails-to-build-glmakie-dependency/80125/10 "2024-11-03T12:56:55Z")

</div>

For future reference:

Turns out that changing

```julia
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

```julia
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.
