NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.49k stars 13.68k forks source link

(future) mesa: 24.2.0(-rc1) derivation/usage needs attention #330997

Open colemickens opened 1 month ago

colemickens commented 1 month ago

Project description

Hi! I know I'm early on this, but wanted to open an issue for attention and/or as a rallying point.

I am (likely very temporarily) in possession of a Yoga 7x (a Snapdragon X1 Elite device). I am pretty close to having NixOS booted/installed on it. I think initial enablement for the device landed in 24.2.0, with a Gallium driver landing shortly after on main.

Thus I of course became interested in 24.2.x builds of mesa. However, it seems it's not trivial. There's a new dril thing, and I neither understand what build adjustments need to be made (zink_dri.so is not produced, at the very least), nor if there are runtime/loader implications.

ref: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30296#note_2497661

and: https://gitlab.freedesktop.org/mesa/mesa/-/tree/staging/24.2?ref_type=heads

It builds everything, and then fails because it specifically patches zink_dri.so which no longer exists:

patching script interpreter paths in /nix/store/47vd7cbyx00rxbwhhjm76nq6934ddwz0-mesa-24.2.0-spirv2dxil
calling 'fixupOutput' function hook '_pruneLibtoolFiles'
calling 'fixupOutput' function hook '_doStrip'
stripping (with command strip and flags -S -p) in  /nix/store/47vd7cbyx00rxbwhhjm76nq6934ddwz0-mesa-24.2.0-spirv2dxil/lib /nix/store/47vd7cbyx00rxbwhhjm76nq6934ddwz0-mesa-24.2.0-spirv2dxil/bin
calling 'fixupOutput' function hook '_separateDebugInfo'
evaling 'fixupOutput' string hook 'if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi'
shrinking RPATHs of ELF executables and libraries in /nix/store/4cg5ia5mdv6lv50frh0gfl1hpgqqd696-mesa-24.2.0-debug
evaling 'fixupOutput' string hook 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi'
checking for references to /build/ in /nix/store/4cg5ia5mdv6lv50frh0gfl1hpgqqd696-mesa-24.2.0-debug...
evaling 'fixupOutput' string hook 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi'
calling 'fixupOutput' function hook '_moveLib64'
calling 'fixupOutput' function hook '_moveSbin'
calling 'fixupOutput' function hook '_moveSystemdUserUnits'
calling 'fixupOutput' function hook 'patchShebangsAuto'
patching script interpreter paths in /nix/store/4cg5ia5mdv6lv50frh0gfl1hpgqqd696-mesa-24.2.0-debug
calling 'fixupOutput' function hook '_pruneLibtoolFiles'
calling 'fixupOutput' function hook '_doStrip'
stripping (with command strip and flags -S -p) in  /nix/store/4cg5ia5mdv6lv50frh0gfl1hpgqqd696-mesa-24.2.0-debug/lib
evaling implicit 'postFixup' string hook
patching script interpreter paths in /nix/store/64rxm7vk13bhq717cxn0iagfz0wwpmzl-mesa-24.2.0/bin/mesa-overlay-control.py
^MScanning: 0 files, 1 dirs (in 1 specified)^MScanning: 35 files, 12 items (in 2 specified)
^MProgress [0/35, 0 pairs matched] 0%^M                                                            ^MNo duplicates found.
patchelf: getting info about '/nix/store/gql5vbq4bgl8w61hzdksh99jhv6wvkq5-mesa-24.2.0-drivers/lib/dri/zink_dri.so': No such file or directory
colemickens commented 1 month ago

It's not much, but here's my branch: https://github.com/NixOS/nixpkgs/compare/master...colemickens:nixpkgs:colemickens/mesa-24.2

had to:

eclairevoyant commented 1 month ago

https://www.supergoodcode.com/long-road-to-DRIL/ explains what dril is meant to do

Also, great news:

How many of you have gotten the error DRI driver not from this Mesa build when trying to use your custom Mesa build?

With this MR, that error is going away. Permanently. Now you can have as many Mesa builds on your system as you want. No longer do you need to set LIBGL_DRIVERS_PATH for any reason.

Atemu commented 1 month ago

cc @K900

K900 commented 1 month ago

Rebased my libgbm thing, test PR here: https://github.com/NixOS/nixpkgs/pull/332413

devurandom commented 3 weeks ago

Rebased my libgbm thing, test PR here: #332413

The libgbm part was split off into https://github.com/NixOS/nixpkgs/pull/338109.