Repository navigation
mesa-aurora: bring llvmpipe back, linked to the system LLVM - #1711
Conversation
[Medium impact] The PR appears safe to merge with the upgrade delays that SummaryRestores
|
maralcbr
left a comment
There was a problem hiding this comment.
Thanks @scottjones, this is the right way to bring llvmpipe back. Linking the one system LLVM and letting makepkg version libLLVM.so from libgallium turns the 32ae19d failure, a GPU driver that silently stops loading, into a loud pacman refusal. The note on why a frozen llvm22-libs can't work is useful. No code blockers.
Checked and fine
check()(PKGBUILD:67-101) does what the commit says. Each of these fails the build: SPIRV-Tools anywhere, LLVM outside libgallium, two LLVMs or a soname that isn'tmajor.minor, a non-executable libgallium, and a libgallium without LLVM.cp -aatPKGBUILD:110keeps the exec bit that makepkg needs to version the depend.rebuild_on: llvm-libsreads the samearm-mirror.omarchy.orgas the edge builder (bin/sync-rebuilds:26,helpers/fast-ring-check.sh:41). So the rebuild sees the LLVM that edge users get.- The Mesa recipe test in
tests/aurora-edge/review.pypasses locally. Three other cases in that file (the kernel headers and m1n1) also fail on my Mac at the base, so they come from my environment, not this PR.
Before merge
- CI hasn't run yet. The mesa-aurora build,
self-testsandbuild-isolationare still pending, andresulthasn't reported. Please tick the.PKGINFOitem from the CI artifact: it should saydepend = libLLVM.so=23.1-64, not a barelibLLVM.so. Only that line proves the hold works. If makepkg leaves the depend unversioned, an LLVM bump brings back exactly the 32ae19d failure. - Please make the PR body precise about the hold. pacman doesn't just hold back
llvm-libs: the wholepacman -Syufails with "breaks dependency 'libLLVM.so=23.1-64' required by mesa-aurora" until the rebuild publishes, and fresh installs fail the same way. The rebuild check runs every 6 hours (ci/README.md:108). A failed rebuild waits as a red PR for a maintainer, so the window has no hard upper bound.
Still open, and not code issues
- Accepting that hold is a maintainer call. I think a refused upgrade is a better failure than a missing GPU driver, but I want that decision made explicitly before this merges.
- rc and stable on aarch64 run their own Arch Linux ARM snapshots (
helpers/fast-ring-check.sh:39-41), andbin/promote-channeldoesn't compare sonames. So mesa-aurora has to be promoted in step with each snapshot's LLVM. A promotion guard would belong in a separate PR, since it'sbin/. That PR could also fixREADME.md:229, which still says every aarch64 channel runs the same live repositories. - This edits existing tests under
tests/aurora-edge/, so auto-merge won't arm (.github/scripts/auto-merge-pr.cjs:34). I'll merge it by hand once it's green.
Nits, fine as follow-ups:
PKGBUILD:81: underpipefail, thegrep | sedpipeline abortscheck()on the first library without LLVM. makepkg doesn't setpipefailtoday, but a singlesed -nE 's/.*NEEDED.*\[(libLLVM[^]]*)\].*/\1/p'avoids the question and keeps the two-LLVM case failing.
For release (not the merge): before promoting to rc or stable, please confirm that channel's snapshot ships llvm-libs 23.1. The two unticked hardware items are also still needed: a Neo or M1 with a working GPU unchanged after the upgrade, and an app that loads LLVM 23 itself running next to GL, both on the CI build.
| echo "Unexpected compiler runtime dependency: $binary" >&2 | ||
| return 1 | ||
| fi | ||
| llvm=$(grep -oE 'NEEDED.*\[libLLVM[^]]*\]' <<<"$dependencies" | sed -E 's/.*\[(.*)\]/\1/') |
There was a problem hiding this comment.
nit: under pipefail this pipeline fails on every library without LLVM. llvm=$(sed -nE 's/.*NEEDED.*\[(libLLVM[^]]*)\].*/\1/p' <<<"$dependencies") gives the same result without depending on shell options.
There was a problem hiding this comment.
Done in cedcc6e. One sed now, so a library without LLVM no longer aborts check() under errexit with pipefail. Two LLVM sonames still fail.
| pkgdesc='Aurora native Asahi Gallium and Zink OpenGL drivers' | ||
| depends=('expat' 'glibc' 'gcc-libs' 'libdrm' 'libglvnd' 'libx11' 'libxcb' 'libxext' | ||
| 'libxshmfence' 'libxxf86vm' 'lm_sensors' 'wayland' 'zlib' 'zstd' | ||
| 'libxshmfence' 'libxxf86vm' 'libLLVM.so' 'lm_sensors' 'wayland' 'zlib' 'zstd' |
There was a problem hiding this comment.
This is the line the hold depends on. Please confirm from the CI artifact's .PKGINFO that it comes out as libLLVM.so=23.1-64.
There was a problem hiding this comment.
Confirmed on cedcc6e's CI artifact (run 40611672833): depend = libLLVM.so=23.1-64.
|
Here's where each of your points landed, Marcelo.
Thanks for the careful review, this PR is better for it. |
cedcc6e to
ec3972f
Compare
maralcbr
left a comment
There was a problem hiding this comment.
Thanks @scottjones, everything from my last review is addressed. The .PKGINFO shows depend = libLLVM.so=23.1-64, and the Neo, M3 Air and M2 Max checks cover what I asked for. No code blockers at ec3972f.
Before merge
- It conflicts with master since #1798 moved the Mesa pin. Please rebase onto master's
pkgver=26.3.0_devel.20261029.231476.672657e05e6and_commit=672657e05e6b…, keepingpkgrel=2so it upgrades over the published-1. Then reconfirm the versionedlibLLVM.sodepend in the rebased build's.PKGINFO. rebuilt_againstsaysllvm-libs23.1.3-4.1, but edge now serves23.1.4-1.1.sync-rebuildscompares full versions, so this would open a redundant rebuild PR right after merge. Please record the version the rebased build actually used.
Channels, checked today
- The 404 is gone: arm-mirror serves
llvm-libs-23.1.4-1.1. rc and stable serve23.1.3-3. All three are soname 23.1, so the-2build installs on any of them. - rc is safe for now because
release/mac-inventory.txtpins mesa-aurora to-1, which has no LLVM.-2reaches rc only when someone qualifies it on purpose. - #1745's
check-mac-setdoes not close the LLVM gap, because it skips dependencies the channel itself doesn't provide, andllvm-libscomes from Arch Linux ARM. Thepromote-channelsoname guard is still worth its own PR. Until it exists, whoever qualifies a new mesa-aurora checks the target snapshot's LLVM.
The only thing left is the hold trade-off, which is a maintainer decision. I'll approve once that's made and the rebase is green.
A Mac without a working GPU renders its desktop with Gallium's software fallback. Since 32ae19d that fallback has been softpipe, which can't keep up with a Mac's panel (omacom#1474): on an M3 Air with its GPU off, Hyprland pins a core under softpipe. llvmpipe (tested from an earlier LLVM 22 build) is noticeably better, though not smooth with blur and animations on. 32ae19d dropped llvmpipe because it links LLVM, and llvm-libs changes its soname every major: an Arch Linux ARM bump would remove the libLLVM this package was built against, and libgallium, with the Asahi GPU driver in it, would stop loading until a rebuild. Link llvmpipe to the system LLVM anyway, as Arch's own mesa does, so every process has one LLVM. mesa-aurora depends on 'libLLVM.so', which makepkg versions from libgallium's NEEDED soname (libLLVM.so=23.1-64 today, which llvm-libs provides), not on llvm-libs by name. So when Arch Linux ARM moves to the next major, pacman refuses the upgrade until this package is rebuilt for it, instead of leaving libgallium without its LLVM. That is the cost: an LLVM major bump holds back -Syu, and fresh installs, on these Macs until the rebuild publishes. llvm-libs joins rebuild_on, so that rebuild starts by itself when llvm-libs moves, and needs no edit for a new major. With llvmpipe built, Gallium's draw module also JITs through this LLVM, so on the GPU path feedback, select and RasterPos under a shader use it too, as in Arch's mesa. A frozen compat LLVM (llvm22-libs) next to the system one was tried and dropped: two LLVM majors can't share a process here. Each libLLVM exports objects with STB_GNU_UNIQUE binding, which glibc unifies by name across libraries regardless of symbol version, so libLLVM.so.22.1 bound 111 of its own references to libLLVM.so.23.1's differently laid out tables. llvmpipe then aborted with LLVM 23 in the process, the stock Mesa segfaulted with LLVM 22 in it, and the GPU path's draw module JIT aborted too. Any process that loads lavapipe, rusticl or another LLVM 23 user next to GL would have crashed. check() now allows LLVM only in libgallium, exactly one libLLVM.so.<major>.<minor>, and requires libgallium to be executable, because makepkg versions the libLLVM.so depend only from executable files; otherwise it would ship unversioned. It fails on SPIRV-Tools anywhere, and fails if libgallium doesn't link LLVM at all, so a libgallium without llvmpipe can't ship unnoticed. The recipe and metadata tests cover each rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check() found the libLLVM soname with grep piped to sed. For a library without LLVM the grep exits 1, so under errexit with pipefail the assignment would abort check(). One sed gives the same result without depending on shell options. Two LLVM sonames still come out as two lines, which the anchored match rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ec3972f to
d2edc91
Compare
|
Rebased onto master after #1798, now at d2edc91.
|
maralcbr
left a comment
There was a problem hiding this comment.
Thanks @scottjones, the rebase is clean. At d2edc91 both of my earlier conditions are met, and there are no code blockers.
- Against ec3972f, the only change is
rebuilt_against, whosellvm-libsis now23.1.4-1.1. The branch is up to date with master, andpkgver/_commitmatch the #1798 pin withpkgrel=2. - I checked CI's artifact from run 40863665253 myself:
- mesa-aurora
1:26.3.0_devel.20261029.231476.672657e05e6-2hasdepend = libLLVM.so=23.1-64and was built againstllvm-libs-23.1.4-1.1; - vulkan-aurora has no LLVM depend.
- mesa-aurora
rebuilt_againstmatches what edge serves, so there won't be a redundant rebuild after merge.
The only thing left is the maintainer decision on the LLVM upgrade hold. Since this edits existing tests under tests/aurora-edge/, it will be merged by hand.
maralcbr
left a comment
There was a problem hiding this comment.
Approving at d2edc91. I accept the LLVM upgrade hold: a refused pacman -Syu after an LLVM major bump is a better failure than a GPU driver that silently stops loading. Whoever qualifies this mesa-aurora for rc or stable checks that the channel's snapshot ships llvm-libs 23.1, until a promote-channel soname guard exists.
Moves the qualified mesa-aurora from -1 to -2 (#1711): the same mesa#19 pin, with llvmpipe linked to the system LLVM. It depends on libLLVM.so=23.1-64, which rc's and stable's llvm-libs 23.1.3-3 provide.
Fixes #1474. A Mac whose GPU doesn't start renders its desktop with Gallium's software fallback, and since 32ae19d that's been softpipe, which can't keep up with a Mac's panel. This brings llvmpipe back in mesa-aurora, linked to the system LLVM like Arch's own mesa, so those Macs get llvmpipe instead.
Eryk dropped llvmpipe in 32ae19d for a good reason: llvm-libs changes its soname every major, and a Mesa built against the old one stops loading, GPU driver included. So mesa-aurora now depends on LLVM's soname (makepkg writes
libLLVM.so=23.1-64) and rebuilds on llvm-libs. That turns an LLVM major bump from a silent GPU failure into a loud refusal, and the refusal is the trade-off: until the rebuilt mesa-aurora publishes, the wholepacman -Syufails with "breaks dependency 'libLLVM.so=23.1-64' required by mesa-aurora", and fresh installs fail the same way. The rebuild check runs every 6 hours, and a rebuild that fails waits as a red PR for a maintainer, so that window has no hard upper bound. Whether to accept it is a maintainer call.We tried a frozen
llvm22-libsnext to the system LLVM first, but two LLVM versions in one process crash because their shared objects clash, in both orders.On an M3 Air with the GPU switched off (
chosen.asahi,t8122-gpu=0), the desktop was barely usable on softpipe and noticeably better on this build's llvmpipe (LLVM 23, one libLLVM in Hyprland); with the GPU back on it renders on the Apple M3 GPU as before. On the M2 Max,check()passes 111/111, llvmpipe draws about 17,000 fps against softpipe's 319 on a simple draw, the GPU path is unchanged, and LLVM 23 in the same process passes.One thing to watch when promoting: each channel's mesa-aurora has to match that channel's Arch Linux ARM LLVM. Promoting an LLVM 24 build before the channel's snapshot moves, or the reverse, holds back
-Syuthere, and promote-channel doesn't check for it.Test plan
check()passes, and the built mesa-aurora's.PKGINFOhasdepend = libLLVM.so=<major.minor>-64, not barechosen.asahi,t8122-gpu=0): the session renderer is llvmpipe (LLVM 23), not softpipe, and the desktop is usable🤖 Generated with Claude Code