diff mbox series

[bug#49339,core-updates] gnu: mesa: Update to 21.1.4.

Message ID 87r1ggkayo.fsf@irfus.in
State Accepted
Headers show
Series [bug#49339,core-updates] gnu: mesa: Update to 21.1.4. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Irfan S July 2, 2021, 3:10 p.m. UTC
(arguments
      `(#:configure-flags
@@ -663,7 +663,8 @@ rasterisation.")
                   (replace 'check
                     (lambda _
                       (invoke "meson" "test" "--timeout-multiplier" 
                       "5"))))))
-    (inputs
+    (propagated-inputs
+     ;; libpciaccess is in Requires.private of libdrm_intel.pc
      `(("libpciaccess" ,libpciaccess)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))

Comments

John Kehayias July 2, 2021, 7:29 p.m. UTC | #1
I can confirm this builds for me on different computers as well, and would be great to have updated in guix. This is a bigger version jump since the current version is more than 6 months old and upstream continues with frequent bug fix releases.
John Kehayias July 5, 2021, 3:35 p.m. UTC | #2
libepoxy doesn't build (patch paths?). On #guix there was discussion of fixing these problems, could an updated patch be sent here for testing?
John Kehayias July 8, 2021, 1:35 a.m. UTC | #3
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Monday, July 5th, 2021 at 11:35 AM:

> libepoxy doesn't build (patch paths?). On #guix there was discussion of fixing these problems, could an updated patch be sent here for testing?

This was easy to solve: I switched where libepoxy was looking for EGL and GL libraries to use libglvnd rather than mesa, as well as adding libglvnd as an input. Also added libglvnd as an input into xorg-server.

Looking at other packages that depend on e.g. libepoxy/mesa/etc. seems like many will need libglvnd as an input now? Is that what we want to move to (I take it is optional, but perhaps a move in the right direction)?

In either case, I'd love to see this in core-updates so we can make fixes to dependent packages as needed, since there are many that depend on mesa, libepoxy, xorg-server, and so on.
John Kehayias July 8, 2021, 2:24 a.m. UTC | #4
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Wednesday, July 7th, 2021 at 9:35 PM:

> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Monday, July 5th, 2021 at 11:35 AM:
>
> > libepoxy doesn't build (patch paths?). On #guix there was discussion of fixing these problems, could an updated patch be sent here for testing?
>
> This was easy to solve: I switched where libepoxy was looking for EGL and GL libraries to use libglvnd rather than mesa, as well as adding libglvnd as an input. Also added libglvnd as an input into xorg-server.
>
> Looking at other packages that depend on e.g. libepoxy/mesa/etc. seems like many will need libglvnd as an input now? Is that what we want to move to (I take it is optional, but perhaps a move in the right direction)?
>
> In either case, I'd love to see this in core-updates so we can make fixes to dependent packages as needed, since there are many that depend on mesa, libepoxy, xorg-server, and so on.

As a followup, looks like libglvnd is optional for building mesa, and without that change I think it is just a drop in version bump. I'm not sure about dependents generally, but libepoxy and xorg-server needed no changes.

So, shall we reduce this patch to just a Mesa update, and then libglvnd as a separate issue? I think that one would require changing/adding inputs to all GL packages, as they should link to libglvnd rather than any vendor's GL directly, if I understand correctly.

With just a version change I think this should be easily merged, can anyone else weigh in on that?
M July 8, 2021, 8:55 p.m. UTC | #5
John Kehayias via Guix-patches via schreef op do 08-07-2021 om 01:35 [+0000]:
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
> On Monday, July 5th, 2021 at 11:35 AM:
> 
> > libepoxy doesn't build (patch paths?). On #guix there was discussion of fixing these problems, could an updated patch be sent here for testing?
> 
> This was easy to solve: I switched where libepoxy was looking for EGL and GL libraries to use libglvnd rather than mesa, as well as adding libglvnd as an input. Also added libglvnd as an input into xorg-server.
> 
> Looking at other packages that depend on e.g. libepoxy/mesa/etc. seems like many will need libglvnd as an input now? Is that what we want to move to (I take it is optional, but perhaps a move in the right direction)?

If with this update of mesa, (almost) every package using mesa also needs libglvnd,
then why not add 'libglvnd' to the propagated-inputs mesa, for about the same reasons
that 'atk' has 'glib' in 'propagated-inputs'?

Not sure if the comparison applies though.

Greetings,
Maxime
John Kehayias July 9, 2021, 2:41 a.m. UTC | #6
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Thursday, July 8th, 2021 at 4:55 PM, Maxime Devos wrote:

> John Kehayias via Guix-patches via schreef op do 08-07-2021 om 01:35 [+0000]:
>
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> >
> > On Monday, July 5th, 2021 at 11:35 AM:
> >
> > > libepoxy doesn't build (patch paths?). On #guix there was discussion of fixing these problems, could an updated patch be sent here for testing?
> >
> > This was easy to solve: I switched where libepoxy was looking for EGL and GL libraries to use libglvnd rather than mesa, as well as adding libglvnd as an input. Also added libglvnd as an input into xorg-server.
> >
> > Looking at other packages that depend on e.g. libepoxy/mesa/etc. seems like many will need libglvnd as an input now? Is that what we want to move to (I take it is optional, but perhaps a move in the right direction)?
>
> If with this update of mesa, (almost) every package using mesa also needs libglvnd,
>
> then why not add 'libglvnd' to the propagated-inputs mesa, for about the same reasons
>
> that 'atk' has 'glib' in 'propagated-inputs'?
>
> Not sure if the comparison applies though.
>
> Greetings,
>
> Maxime

Hi Maxime,

That sounds like a good idea, but I think there may be some kinks to work out. Adding libglvnd to propagated-inputs of Mesa does lead to the successful building of dependents (tested on libepoxy and virtualgl, for example). However, libepoxy fails on a test because it doesn't find libGL. That is no longer in Mesa's lib but from libglvnd if I'm understanding correctly. May just be a problem with the test since building works (which checks for GL).

Anyway, perhaps we want to tackle libglvnd separately? I don't think it is specific to the Mesa version change, but more of how we want to handle gl across packages. Still, it will involve changes to how we build Mesa as well as possibly other packages. I'm not sure that the Mesa version change will require other changes in dependent packages (I can only test a few on my own).

How do you think we should proceed?

John
M July 9, 2021, 12:48 p.m. UTC | #7
John Kehayias schreef op vr 09-07-2021 om 02:41 [+0000]:
> 
[...]
> > If with this update of mesa, (almost) every package using mesa also needs libglvnd,
> > 
> > then why not add 'libglvnd' to the propagated-inputs mesa, for about the same reasons
> > 
> > that 'atk' has 'glib' in 'propagated-inputs'?
> > 
> > Not sure if the comparison applies though.
> > [...]

> That sounds like a good idea, but I think there may be some kinks to work out. Adding libglvnd to propagated-inputs of Mesa does lead to the successful building of dependents (tested on libepoxy and virtualgl, for example).
> However, libepoxy fails on a test because it doesn't find libGL.
> That is no longer in Mesa's lib but from libglvnd if I'm understanding correctly. May just be a problem with the test since building works (which checks for GL).

Warning: I've no idea how building mesa and libglvnd works,
how linking against mesa and libglvnd works, and how mesa and libglvnd
work, besides ‘you can use the GL_... functions to do GL stuff’.

That said, it appears some package definitions expect "libGL.so" to be in mesa.
(Search for "/lib/libGL" and "lib/libEGL" with 'git grep -F"').
I've found about twenty such occurences, including libepoxy.

So it appears that adding libglvnd to the propagated-inputs and fixing
these twenty package definitions should be doable.

Looking at libepoxy in particular:

             (let ((python (assoc-ref inputs "python"))
                   (mesa (assoc-ref inputs "mesa")))
               (substitute* "src/gen_dispatch.py"
                 (("/usr/bin/env python") python))
               (substitute* (find-files "." "\\.[ch]$")
                 (("libGL.so.1") (string-append mesa "/lib/libGL.so.1"))
                 (("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1")))
               #t))))))

it seems like the test failure isn't a false positive, as libGL.so.1 is searched
for in the wrong location.

> 
> Anyway, perhaps we want to tackle libglvnd separately? I don't think it is specific to the Mesa version change, but more of how we want to handle gl across packages. Still, it will involve changes to how we build Mesa as well as possibly other packages. I'm not sure that the Mesa version change will require other changes in dependent packages (I can only test a few on my own).
> 
> How do you think we should proceed?

I'd suggest adding libglvnd to propagated-inputs
and adjusting the twenty package definitions to refer
to libglvnd, and testing some graphical applications.

"mesa-utils" has "glxdemo" and "glxheads" and has few dependencies,
maybe start with that?

Greetings,
Maxime.
John Kehayias July 9, 2021, 3:34 p.m. UTC | #8
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, July 9th, 2021 at 8:48 AM, Maxime Devos wrote:

> Warning: I've no idea how building mesa and libglvnd works,
>
> how linking against mesa and libglvnd works, and how mesa and libglvnd
>
> work, besides ‘you can use the GL_... functions to do GL stuff’.
>
No worries, I also know very little here (just learning about libglvnd), so I'm no expert. However, I think it will be a little more complicated because libglvnd is meant to dispatch to a vendor's GL libraries at runtime. Meaning it will need to know where these libraries exist, which may require some changes for Guix.

> That said, it appears some package definitions expect "libGL.so" to be in mesa.
>
> (Search for "/lib/libGL" and "lib/libEGL" with 'git grep -F"').
>
> I've found about twenty such occurences, including libepoxy.
>
> So it appears that adding libglvnd to the propagated-inputs and fixing
>
> these twenty package definitions should be doable.
>
> Looking at libepoxy in particular:
>
> (let ((python (assoc-ref inputs "python"))
>
> (mesa (assoc-ref inputs "mesa")))
>
> (substitute* "src/gen_dispatch.py"
>
> (("/usr/bin/env python") python))
>
> (substitute* (find-files "." "\\.[ch]$")
>
> (("libGL.so.1") (string-append mesa "/lib/libGL.so.1"))
>
> (("libEGL.so.1") (string-append mesa "/lib/libEGL.so.1")))
>
> #t))))))
>
> it seems like the test failure isn't a false positive, as libGL.so.1 is searched
>
> for in the wrong location.
>
While I think getting builds and tests to pass is not so bad, I don't know that it will actually work the way it is supposed to (see above). I'm also a bit limited in what I can test directly. (For one thing, I'm on a foreign distro right now, which complicates GL testing. For example, Nix has https://github.com/guibou/nixGL for the "OpenGL problem" which may be something we should look at for this as well.)

> > Anyway, perhaps we want to tackle libglvnd separately? I don't think it is specific to the Mesa version change, but more of how we want to handle gl across packages. Still, it will involve changes to how we build Mesa as well as possibly other packages. I'm not sure that the Mesa version change will require other changes in dependent packages (I can only test a few on my own).
> >
> > How do you think we should proceed?
>
> I'd suggest adding libglvnd to propagated-inputs
>
> and adjusting the twenty package definitions to refer
>
> to libglvnd, and testing some graphical applications.
>
> "mesa-utils" has "glxdemo" and "glxheads" and has few dependencies,
>
> maybe start with that?
>
The more I think about it, the more I think we should tackle a change to Guix's GL system separately. The original patch enabled libglvnd in Mesa, but that has been around for a while and is not new to 21.1.x. I worry doing them at the same time would introduce two sources for anything breaking, though I hope the move to 21.1.x doesn't require any big changes elsewhere.

Personally, I'd like to see Mesa 21.1.x updated and make sure dependents are okay. We can then have a separate patch series that enables libglvnd in Mesa and adjusts all packages. We would need some people who can test that actually use different GL vendors to see that libglvnd does what it is supposed to. Perhaps Irfan can weigh in, since in their original patch they did have libglvnd and may have tested that it works.

Any experts on Mesa/libglvnd here to chime in? Is the minimal Mesa version update patch okay if we want to libglvnd separately?

Thanks,
John
Irfan S July 13, 2021, 4:45 a.m. UTC | #9
I did test building some dependents of mesa with libglvnd. 
libepoxy, in particular, needed the change that Maxime points out 
will affect some 20 or so other packages as well. With that made, 
I was able to build and boot into a functioning graphical 
environment on xorg-server. I can work on patching all packages 
that look for libgl.so/libegl.so from mesa to use libglvnd 
instead, as Maxime suggested. But I agree with John that getting 
an updated mesa, with or without libglvnd, into core-updates now 
would be preferable than being delayed to the next freeze cycle. 
If that is a concern, then maybe this patch can be pushed as is.

Cheers,
Irfan
John Kehayias July 13, 2021, 3:42 p.m. UTC | #10
Hi everyone,

Final update, we still need the mesa-skip-tests.patch, but only for the i686 part (second half). The other part of the patch is not needed as the test passes.

Here is the final version of the patch to just update Mesa to 21.1.4. Note this depends on the libdrm update of https://issues.guix.gnu.org/49412 Mesa builds as well as descendants I've tried (like xorg and friends).

Shall we get this merged and set the libglvnd updates after (in case we run into the core-updates freeze)? That would work well for me at least.

Thanks everyone,
John
Kaelyn Takata July 28, 2021, 9:35 p.m. UTC | #11
Hi,

As a bit of bug-tracking reference, this patch supersedes the 20.3.4 update submitted back in Feb (that judging from the comments didn't land because of a core-updates freeze at the time): https://issues.guix.gnu.org/46672

There are also several older mesa update tickets that are still open but can probably be closed since the main branch has 20.2.4 built against LLVM 11:
* https://issues.guix.gnu.org/44558 "Mesa isn't update to date"
* https://issues.guix.gnu.org/44584 "[PATCH] Update mesa to 20.2.2"
* https://issues.guix.gnu.org/44585 "[PATCH] Update mesa to use LLVM 11"
* https://issues.guix.gnu.org/44586 "[PATCH] Mesa updated to 20.2.2 (staging)"

Cheers,
Kaelyn
diff mbox series

Patch

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index cc5131b28d..bd4c8a381a 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -237,7 +237,7 @@  also known as DXTn or DXTC) for Mesa.")
 (define-public mesa
   (package
     (name "mesa")
-    (version "20.2.6")
+    (version "21.1.4")
     (source
       (origin
         (method url-fetch)
@@ -249,9 +249,7 @@  also known as DXTn or DXTC) for Mesa.")
                                   version "/mesa-" version ".tar.xz")))
         (sha256
          (base32
- 
           "1nw5k2qrlcrp5bljy1lmyybgl525y0h44synkbbirw92qv3a6b7i"))
-        (patches
-         (search-patches "mesa-skip-tests.patch"))))
+ 
"02z9g6zpkg1p1sm8f84xdi7v2n7x534x9pn565bvcr411527y5qz"))))
     (build-system meson-build-system)
     (propagated-inputs
       `(;; The following are in the Requires.private field of 
       gl.pc.
@@ -278,7 +276,9 @@  also known as DXTn or DXTC) for Mesa.")
             (_
              `()))
         ("wayland" ,wayland)
-        ("wayland-protocols" ,wayland-protocols)))
+        ("wayland-protocols" ,wayland-protocols)
+        ("libglvnd" ,libglvnd)          ;required for glvnd 
support
+        ("libclc" ,libclc)))            ;required for opencl 
support
     (native-inputs
       `(("bison" ,bison)
         ("flex" ,flex)
@@ -307,15 +307,16 @@  also known as DXTn or DXTC) for Mesa.")
          ;; omx requires libomxil-bellagio
          "-Dplatforms=x11,wayland"
          "-Dglx=dri"        ;Thread Local Storage, improves 
          performance
-         ;; "-Dopencl=true"
+         "-Dopencl=true"
          ;; "-Domx=true"
-         "-Dosmesa=gallium"
-         "-Dgallium-xa=enabled"
+         "-Dosmesa=true"
+         "-Dgallium-xa=true"
+         "-Dglvnd=true"
 
          ;; features required by wayland
-         "-Dgles2=enabled"
-         "-Dgbm=enabled"
-         "-Dshared-glapi=enabled"
+         "-Dgles2=true"
+         "-Dgbm=true"
+         "-Dshared-glapi=true"
 
          ;; Explicitly enable Vulkan on some architectures.
          ,@(match (%current-system)
@@ -417,8 +418,8 @@  also known as DXTn or DXTC) for Mesa.")
              (let ((out (assoc-ref outputs "out"))
                    (bin (assoc-ref outputs "bin")))
                ;; Not all architectures have the Vulkan overlay 
                control script.
-               (mkdir-p (string-append bin "/bin"))
-               (call-with-output-file (string-append bin 
                "/bin/.empty")
+               (mkdir-p (string-append out "/bin"))
+               (call-with-output-file (string-append out 
"/bin/.empty")
                  (const #t))
                (copy-recursively (string-append out "/bin")
                                  (string-append bin "/bin"))
diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 97fc921436..f7b4e95b9c 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -638,7 +638,7 @@  rasterisation.")
 (define-public libdrm
   (package
     (name "libdrm")
-    (version "2.4.104")
+    (version "2.4.106")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -646,7 +646,7 @@  rasterisation.")
                     version ".tar.xz"))
               (sha256
                (base32
- 
                 "1jqvx9c23hgwhq109zqj6vg3ng40pcvh3r1k2fn1a424qasxhsnn"))))
+ 
"1m3vwpabjg3az84vmyxi96jyd7rrqm6qkhk1gq41w5wv89aarn4j"))))
     (build-system meson-build-system)