unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2
@ 2024-09-06 15:00 John Kehayias via Guix-patches via
  2024-09-06 15:05 ` [bug#73071] [PATCH mesa-updates 1/8] gnu: libdrm: Update to 2.4.123 John Kehayias via Guix-patches via
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:00 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy, efraim

Hello Guix,

This is a series of patches to update mesa to the latest, 24.2.2, some
dependencies, and fix a vulkan issue <https://issues.guix.gnu.org/71109>.
Along the way I updated llvm-for-mesa and mesa inputs, which unifies the
changes made to build on aarch64-linux, for instance.  Hopefully this doesn't
introduce regressions.  To that end, I've pushed this series now to the
mesa-updates branch to see how building on Cuirass goes.  (A previous version
was there already, but I have updated/rebased and now finally sending this.)

Some notes:

1. The closure size of mesa has increased, something like from 374 MiB to 542
MiB, mostly due to itself (not sure why) and then also from llvm.  This is
from going from v15 to v18 and as you'll see in a patch I had to enable
building all targets.  Possibly this can be alleviated by building a smaller
clang for mesa?

2. Previous discussion was about getting NVK (which requires rust) built in
the last mesa update.  I'm not sure the current status but will check with
those that were working on it before <https://issues.guix.gnu.org/69637>.  I
believe it is no longer experimental, so we should try to include it.

Hopefully the patch changes and brief comments explain all, but please do
provide any feedback, changes, fixes, etc.  The branch has just been rebased
on master but we can rebase as needed or if there are some critical errors on
these patches I missed.

Thanks!
John

PS: I guess python-team will get this series as I added two comments (no code
changes) to python packages now needed for mesa.  One already has a huge
number of dependents anyway, but good to note I suppose.

John Kehayias (6):
  gnu: libdrm: Update to 2.4.123.
  gnu: wayland-protocols: Update to 1.37.
  gnu: Remove wayland-protocols-next.
  gnu: llvm-for-mesa: Update to llvm-18.
  gnu: llvm-for-mesa: Build all targets.
  gnu: mesa: Update to 24.2.2.

nathan (2):
  gnu: vulkan-headers: Hard-code libvulkan.so file name.
  gnu: volk: Hard-code path of vulkan-loader for dynamic loading

 gnu/packages/freedesktop.scm | 17 ++-----------
 gnu/packages/gl.scm          | 49 ++++++++++++++----------------------
 gnu/packages/kde-plasma.scm  |  2 +-
 gnu/packages/llvm.scm        | 29 ++++++++++-----------
 gnu/packages/python-xyz.scm  |  2 ++
 gnu/packages/vulkan.scm      | 41 ++++++++++++++++++++++++++----
 gnu/packages/xdisorg.scm     |  4 +--
 7 files changed, 75 insertions(+), 69 deletions(-)


base-commit: d4fbd1ab341de85c1e5c77e0f7adc5aae056be15
--
2.45.2






^ permalink raw reply	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 1/8] gnu: libdrm: Update to 2.4.123.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
@ 2024-09-06 15:05 ` John Kehayias via Guix-patches via
  2024-09-06 15:06 ` [bug#73071] [PATCH mesa-updates 2/8] gnu: wayland-protocols: Update to 1.37 John Kehayias via Guix-patches via
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:05 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy, efraim

* gnu/packages/xdisorg.scm (libdrm): Update to 2.4.123.

Change-Id: I28ace4f3f121a7177cfc78de8e50364753114e8c
---
 gnu/packages/xdisorg.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index c041ab1fc0..f78d06b32f 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -791,7 +791,7 @@ (define-public pixman
 (define-public libdrm
   (package
     (name "libdrm")
-    (version "2.4.120")
+    (version "2.4.123")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -799,7 +799,7 @@ (define-public libdrm
                     version ".tar.xz"))
               (sha256
                (base32
-                "0yijzgg6rdsa68bz03sw0lcfa2nclv9m3as1cja50wkcyxim7x9v"))))
+                "17mpmp59icp8vaa47dz9gdpdh583kigq47p9a07lp9s9l5kqbfd2"))))
     (build-system meson-build-system)
     (arguments
      (list #:configure-flags
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 2/8] gnu: wayland-protocols: Update to 1.37.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
  2024-09-06 15:05 ` [bug#73071] [PATCH mesa-updates 1/8] gnu: libdrm: Update to 2.4.123 John Kehayias via Guix-patches via
@ 2024-09-06 15:06 ` John Kehayias via Guix-patches via
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 3/8] gnu: Remove wayland-protocols-next John Kehayias via Guix-patches via
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:06 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy, efraim

* gnu/packages/freedesktop.scm (wayland-protocols): Update to 1.37.

Change-Id: I32837fc9c6609532557c31cf94b0f87e999680d8
---
 gnu/packages/freedesktop.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index cb1d625d24..de83ed95d6 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1367,7 +1367,7 @@ (define-public wayland
 (define-public wayland-protocols
   (package
     (name "wayland-protocols")
-    (version "1.32")
+    (version "1.37")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://gitlab.freedesktop.org/wayland/"
@@ -1375,7 +1375,7 @@ (define-public wayland-protocols
                                   name "-" version ".tar.xz"))
               (sha256
                (base32
-                "04dsn79409mryxs6maq9kfhca97gvl3pr1ggjnv9d0hc6jfpjnbl"))))
+                "09pk3qhpc29x1a6srpqqw9dcvalg33vfmp14d276is7j4klrn3m7"))))
     (build-system meson-build-system)
     (inputs
      (list wayland))
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 3/8] gnu: Remove wayland-protocols-next.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
  2024-09-06 15:05 ` [bug#73071] [PATCH mesa-updates 1/8] gnu: libdrm: Update to 2.4.123 John Kehayias via Guix-patches via
  2024-09-06 15:06 ` [bug#73071] [PATCH mesa-updates 2/8] gnu: wayland-protocols: Update to 1.37 John Kehayias via Guix-patches via
@ 2024-09-06 15:07 ` John Kehayias via Guix-patches via
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 4/8] gnu: vulkan-headers: Hard-code libvulkan.so file name John Kehayias via Guix-patches via
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:07 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy, efraim

The default wayland-protocols has been updated to the latest version.

* gnu/packages/freedesktop.scm (wayland-protocols-next): Delete variable.
* gnu/packages/kde-plasma.scm (kwin)[native-inputs]: Remove
wayland-protocols-next; add wayland-protocols.

Change-Id: I7620db01317c08ae6bce029dff4d482a7f868f5f
---
 gnu/packages/freedesktop.scm | 13 -------------
 gnu/packages/kde-plasma.scm  |  2 +-
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index de83ed95d6..d5b31bf837 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1395,19 +1395,6 @@ (define-public wayland-protocols
         . "https://wayland.freedesktop.org/releases.html")))
     (license license:expat)))

-(define-public wayland-protocols-next
-  (package (inherit wayland-protocols)
-           (name "wayland-protocols-next")
-           (version "1.36")
-           (source (origin
-                     (method url-fetch)
-                     (uri (string-append "https://gitlab.freedesktop.org/wayland/"
-                                         "wayland-protocols/-/releases/" version "/downloads/"
-                                         "wayland-protocols-" version ".tar.xz"))
-                     (sha256
-                      (base32
-                       "14kyxywpfkgpjpkrybs28q1s2prnz30k1b4zap5a3ybrbvh4vzbi"))))))
-
 (define-public wayland-utils
   (package
     (name "wayland-utils")
diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm
index 5e9b9688d1..7a35209da8 100644
--- a/gnu/packages/kde-plasma.scm
+++ b/gnu/packages/kde-plasma.scm
@@ -1451,7 +1451,7 @@ (define-public kwin
                          mesa-utils
                          pkg-config
                          qttools
-                         wayland-protocols-next
+                         wayland-protocols
                          xorg-server-for-tests
                          python-minimal
                          ;; for QtWaylandScanner
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 4/8] gnu: vulkan-headers: Hard-code libvulkan.so file name.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (2 preceding siblings ...)
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 3/8] gnu: Remove wayland-protocols-next John Kehayias via Guix-patches via
@ 2024-09-06 15:07 ` John Kehayias via Guix-patches via
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 5/8] gnu: volk: Hard-code path of vulkan-loader for dynamic loading John Kehayias via Guix-patches via
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:07 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, Ludovic Courtès, nathan, aurtzy, efraim

From: nathan <nathan_mail@nborghese.com>

* gnu/packages/vulkan.scm (vulkan-headers): Rename to…
(vulkan-headers/no-loader): … this.
(vulkan-headers): New variable.
(vulkan-loader): Depend on ‘vulkan-headers/no-loader’.

Change-Id: Ic674a4d965d8049e388d75137111ed0253ca3b18
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
---
 gnu/packages/vulkan.scm | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 1b69da1a4d..e76455a835 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -299,7 +299,8 @@ (define-public vkbasalt
     (license (list license:bsd-3    ; src/reshade/LICENSE.md
                    license:zlib)))) ; LICENSE

-(define-public vulkan-headers
+;; vulkan-headers, but without the path to vulkan-loader patched in.
+(define-public vulkan-headers/no-loader
   (package
     (name "vulkan-headers")
     (version "1.3.280.0")
@@ -316,6 +317,7 @@ (define-public vulkan-headers
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f))                    ; No tests.
+    (properties '((hidden? . #t)))
     (home-page
      "https://github.com/KhronosGroup/Vulkan-Headers")
     (synopsis "Vulkan Header files and API registry")
@@ -323,6 +325,25 @@ (define-public vulkan-headers
      "Vulkan-Headers contains header files and API registry for Vulkan.")
     (license (list license:asl2.0)))) ;LICENSE.txt

+(define-public vulkan-headers
+  (package
+    (inherit vulkan-headers/no-loader)
+    (arguments
+     (substitute-keyword-arguments (package-arguments vulkan-headers/no-loader)
+       ((#:phases phases #~%standard-phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'patch-libvulkan-file-name
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "include/vulkan/vulkan.hpp"
+                  (("dlopen\\( \"libvulkan.so")
+                   (string-append "dlopen(\""
+                                  (search-input-file
+                                   inputs "/lib/libvulkan.so"))))))))))
+    (inputs
+     (modify-inputs (package-inputs vulkan-headers/no-loader)
+       (prepend vulkan-loader)))
+    (properties '())))
+
 (define-public vulkan-loader
   (package
     (name "vulkan-loader")
@@ -383,7 +404,7 @@ (define-public vulkan-loader
            python
            wayland))
     (inputs
-     (list vulkan-headers libxrandr))
+     (list vulkan-headers/no-loader libxrandr))
     (native-search-paths
      (list (search-path-specification
             (variable "XDG_DATA_DIRS")
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 5/8] gnu: volk: Hard-code path of vulkan-loader for dynamic loading
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (3 preceding siblings ...)
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 4/8] gnu: vulkan-headers: Hard-code libvulkan.so file name John Kehayias via Guix-patches via
@ 2024-09-06 15:07 ` John Kehayias via Guix-patches via
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 6/8] gnu: llvm-for-mesa: Update to llvm-18 John Kehayias via Guix-patches via
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:07 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, Ludovic Courtès, nathan, aurtzy, efraim

From: nathan <nathan_mail@nborghese.com>

Until now, we’d get:

  $ guix shell vulkan-tools -- vulkaninfo
  ERROR at /tmp/guix-build-vulkan-tools-1.3.280.0.drv-0/source/vulkaninfo/./vulkaninfo.h:412: Failed to initialize: Vulkan loader is not installed, not found, or failed to load.

This patch fixes it and potentially for other programs as well.

* gnu/packages/vulkan.scm (volk)[arguments]: use gexp.
<#:phases>: Patch dlopen with libvulkan.so.
[input]: Add vulkan-loader.

Change-Id: I5ef0eb13d35e517b8947faddace641882a775b80
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
---
 gnu/packages/vulkan.scm | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index e76455a835..dd5b51c7fe 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -654,9 +654,19 @@ (define-public volk
                 "0x4jhc8n9c4k8svmmcaxxs613xbsav7wam94gacddlm738cwp13v"))))
     (build-system cmake-build-system)
     (arguments
-     '(#:tests? #f                      ;no test
-       #:configure-flags '("-DVOLK_INSTALL=ON" "-DVOLK_PULL_IN_VULKAN=ON")))
-    (inputs (list vulkan-headers))
+     (list
+      #:tests? #f                      ;no test
+      #:configure-flags #~(list "-DVOLK_INSTALL=ON" "-DVOLK_PULL_IN_VULKAN=ON")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-loader-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "volk.c"
+                (("dlopen\\(\"libvulkan.so")
+                 (string-append "dlopen(\""
+                                (search-input-file
+                                 inputs "/lib/libvulkan.so")))))))))
+    (inputs (list vulkan-headers vulkan-loader))
     (synopsis "Meta loader for Vulkan API")
     (description
      "Volk is a meta-loader for Vulkan.  It allows you to dynamically load
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 6/8] gnu: llvm-for-mesa: Update to llvm-18.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (4 preceding siblings ...)
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 5/8] gnu: volk: Hard-code path of vulkan-loader for dynamic loading John Kehayias via Guix-patches via
@ 2024-09-06 15:07 ` John Kehayias via Guix-patches via
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 7/8] gnu: llvm-for-mesa: Build all targets John Kehayias via Guix-patches via
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:07 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy, efraim

* gnu/packages/llvm.scm (llvm-for-mesa): Update to llvm-18.
* gnu/packages/gl.scm (mesa)[inputs]: Always use llvm-for-mesa (remove llvm-18
for aarch64 to use llvm-for-mesa).
(mesa-opencl)[native-inputs]: Remove clang-15.  Add clang-18.

Change-Id: I767d40d62a827864d3d109c44f82a43302875eb8
---
 gnu/packages/gl.scm   | 8 ++++----
 gnu/packages/llvm.scm | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index 849ca076dc..ab53b1761a 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -323,15 +323,15 @@ (define-public mesa
     (inputs
      (append
        (if (target-aarch64?)
-           (list clang-18
-                 llvm-18)
-           (list llvm-for-mesa))
+           (list clang-18)
+           '())
        (list elfutils                   ;libelf required for r600 when using llvm
              expat
              (force libva-without-mesa)
              libxml2
              libxrandr
              libxvmc
+             llvm-for-mesa
              vulkan-loader
              wayland
              wayland-protocols
@@ -602,7 +602,7 @@ (define-public mesa-opencl
      (if (target-aarch64?)
          (package-native-inputs mesa)
          (modify-inputs (package-native-inputs mesa)
-           (prepend clang-15))))))
+           (prepend clang-18))))))

 (define-public mesa-opencl-icd
   (package/inherit mesa-opencl
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index fd2e815fe0..7fcb15891d 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -2152,7 +2152,7 @@ (define-public emacs-clang-rename

 (define-public llvm-for-mesa
   ;; Note: update the 'clang' input of mesa-opencl when bumping this.
-  (let ((base-llvm llvm-15))
+  (let ((base-llvm llvm-18))
     (package
       (inherit base-llvm)
       (name "llvm-for-mesa")
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 7/8] gnu: llvm-for-mesa: Build all targets.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (5 preceding siblings ...)
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 6/8] gnu: llvm-for-mesa: Update to llvm-18 John Kehayias via Guix-patches via
@ 2024-09-06 15:07 ` John Kehayias via Guix-patches via
  2024-09-06 15:08 ` [bug#73071] [PATCH mesa-updates 8/8] gnu: mesa: Update to 24.2.2 John Kehayias via Guix-patches via
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:07 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy, efraim

This change is needed for updating mesa to 24.2.1.  Otherwise, mesa fails to
build.  For example, linking intel_clc fails with errors of libclang-cpp.so
having undefined references to various LLVM targets.

It is possible that just some LLVM targets could be built or a modified
version of the clang input for mesa (now required) could be used to try to
reduce the closure size as before.

* gnu/packages/llvm.scm (llvm-for-mesa)[arguments]: Don't set the
LLVM_TARGETS_TO_BUILD configure flag.  Also, don't remove it from the
inherited configure-flags.  Fix indentation.

Change-Id: I4a2b7239e6ea77b0d3bce10bdf945691faa84994
---
 gnu/packages/llvm.scm | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 7fcb15891d..800fe29599 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -22,7 +22,7 @@
 ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
 ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2022, 2024 Greg Hogan <code@greghogan.com>
-;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2022, 2024 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
 ;;; Copyright © 2023 Hilton Chain <hako@ultrarare.space>
@@ -2166,21 +2166,18 @@ (define-public llvm-for-mesa
             ,@modules))
          ((#:configure-flags cf ''())
           #~(cons*
-              ;; AMDGPU is needed by the vulkan drivers.
-              #$(string-append "-DLLVM_TARGETS_TO_BUILD="
-                               (system->llvm-target) ";AMDGPU")
-              #$@(if (%current-target-system)
-                     '("-DBUILD_SHARED_LIBS:BOOL=TRUE"
-                       "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
+             #$@(if (%current-target-system)
+                    '("-DBUILD_SHARED_LIBS:BOOL=TRUE"
+                      "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
                     '())
-              ;; Skipping tools and utils decreases the output by ~100 MiB.
-              "-DLLVM_BUILD_TOOLS=NO"
-              (remove
-               (cut string-match
-                    #$(if (%current-target-system)
-                          "-DLLVM_(LINK_LLVM_DYLIB|TARGETS_TO_BUILD|INSTALL_UTILS).*"
-                          "-DLLVM_(TARGETS_TO_BUILD|INSTALL_UTILS).*") <>)
-                      #$cf)))
+             ;; Skipping tools and utils decreases the output by ~100 MiB.
+             "-DLLVM_BUILD_TOOLS=NO"
+             (remove
+              (cut string-match
+                   #$(if (%current-target-system)
+                         "-DLLVM_(LINK_LLVM_DYLIB|INSTALL_UTILS).*"
+                         "-DLLVM_INSTALL_UTILS.*") <>)
+              #$cf)))
          ((#:phases phases '%standard-phases)
           #~(modify-phases #$phases
               #$@(if (%current-target-system)
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 8/8] gnu: mesa: Update to 24.2.2.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (6 preceding siblings ...)
  2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 7/8] gnu: llvm-for-mesa: Build all targets John Kehayias via Guix-patches via
@ 2024-09-06 15:08 ` John Kehayias via Guix-patches via
  2024-09-09  3:43 ` [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa " John Kehayias via Guix-patches via
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-06 15:08 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy, efraim

Note the clang input for mesa was in inputs for aarch64-linux but more
generally in native-inputs for mesa-opencl.  Moved to native-inputs for
all (mesa does not retain a reference to clang).

* gnu/packages/gl.scm (mesa): Update to 24.2.2.
[inputs]: Move clang-18 when building for aarch64-linux to ...
[native-inputs]: ... here for all architectures.  Add python-ply, and
python-pyyaml.  Use libclc for all architectures.
(mesa-opencl)[inputs, native-inputs]: Remove fields.
* gnu/packages/python-xyz.scm (python-pyyaml, python-ply): Add a comment about
being dependencies of mesa.

Change-Id: Ie262e6ea5a31fda0e410277256c203ea3caed96b
---
 gnu/packages/gl.scm         | 49 ++++++++++++++-----------------------
 gnu/packages/python-xyz.scm |  2 ++
 2 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index ab53b1761a..ab18a3e5a7 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -15,7 +15,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
-;;; Copyright © 2021, 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
+;;; Copyright © 2021-2024 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2023 Kaelyn Takata <kaelyn.alexi@protonmail.com>
 ;;; Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com>
@@ -298,7 +298,7 @@ (define libva-without-mesa
 (define-public mesa
   (package
     (name "mesa")
-    (version "24.0.4")
+    (version "24.2.2")
     (source
      (origin
        (method url-fetch)
@@ -308,7 +308,7 @@ (define-public mesa
                                  "mesa-" version ".tar.xz")))
        (sha256
         (base32
-         "1w25lwdrb0ffrx2fjk9izbvpcgf9ypfc7v32zybwvjwql0qbvzlh"))))
+         "00hxi7wjp368kh5qq2v25nyzjrf0grsx55w55fg4bgpd0hqps1zx"))))
     (build-system meson-build-system)
     (propagated-inputs
      ;; The following are in the Requires.private field of gl.pc.
@@ -321,35 +321,32 @@ (define-public mesa
            libxxf86vm
            xorgproto))
     (inputs
-     (append
-       (if (target-aarch64?)
-           (list clang-18)
-           '())
-       (list elfutils                   ;libelf required for r600 when using llvm
-             expat
-             (force libva-without-mesa)
-             libxml2
-             libxrandr
-             libxvmc
-             llvm-for-mesa
-             vulkan-loader
-             wayland
-             wayland-protocols
-             `(,zstd "lib"))))
+     (list elfutils                   ;libelf required for r600 when using llvm
+           expat
+           (force libva-without-mesa)
+           libxml2
+           libxrandr
+           libxvmc
+           llvm-for-mesa
+           vulkan-loader
+           wayland
+           wayland-protocols
+           `(,zstd "lib")))
     (native-inputs
      (append
       (list bison
+            clang-18
             flex
             gettext-minimal
             glslang
+            libclc
             pkg-config
             python-libxml2              ;for OpenGL ES 1.1 and 2.0 support
             python-mako
+            python-ply
+            python-pyyaml
             python-wrapper
             (@ (gnu packages base) which))
-      (if (target-aarch64?)
-          (list libclc)
-          '())
       (if (%current-target-system)
           (list cmake-minimal-cross
                 pkg-config-for-build
@@ -594,15 +591,7 @@ (define-public mesa-opencl
     (arguments
      (substitute-keyword-arguments (package-arguments mesa)
        ((#:configure-flags flags)
-        #~(cons "-Dgallium-opencl=standalone" #$flags))))
-    (inputs
-     (modify-inputs (package-inputs mesa)
-       (prepend libclc)))
-    (native-inputs
-     (if (target-aarch64?)
-         (package-native-inputs mesa)
-         (modify-inputs (package-native-inputs mesa)
-           (prepend clang-18))))))
+        #~(cons "-Dgallium-opencl=standalone" #$flags))))))

 (define-public mesa-opencl-icd
   (package/inherit mesa-opencl
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 21e04e75e9..416db71d68 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6133,6 +6133,7 @@ (define-public python-itsdangerous
 environments and back.")
     (license license:bsd-3)))

+;; WARNING: This package is a dependency of mesa.
 (define-public python-pyyaml
   (package
     (name "python-pyyaml")
@@ -20995,6 +20996,7 @@ (define-public python-pika
 network support library.")
     (license license:bsd-3)))

+;; WARNING: This package is a dependency of mesa.
 (define-public python-ply
   (package
     (name "python-ply")
--
2.45.2






^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (7 preceding siblings ...)
  2024-09-06 15:08 ` [bug#73071] [PATCH mesa-updates 8/8] gnu: mesa: Update to 24.2.2 John Kehayias via Guix-patches via
@ 2024-09-09  3:43 ` John Kehayias via Guix-patches via
  2024-09-09 16:12 ` [bug#73071] [PATCH mesa-updates] gnu: mesa: Enable NVK driver for x86_64 architecture aurtzy
  2024-09-18  0:35 ` The Man
  10 siblings, 0 replies; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-09  3:43 UTC (permalink / raw)
  To: 73071; +Cc: aurtzy, efraim

[-- Attachment #1: Type: text/plain, Size: 3036 bytes --]

Just a note that on IRC it was pointed out that we lost the i915 driver in mesa. I adjusted the configure flags to restore some changes that were lost, simplifying the configure-flags a little. That patch is attached and is live on mesa-updates (along with some other changes, but not related directly to this series).

On Fri, Sep 06, 2024 at 03:00 PM, John Kehayias wrote:

> Hello Guix,
>
> This is a series of patches to update mesa to the latest, 24.2.2, some
> dependencies, and fix a vulkan issue <https://issues.guix.gnu.org/71109>.
> Along the way I updated llvm-for-mesa and mesa inputs, which unifies the
> changes made to build on aarch64-linux, for instance.  Hopefully this doesn't
> introduce regressions.  To that end, I've pushed this series now to the
> mesa-updates branch to see how building on Cuirass goes.  (A previous version
> was there already, but I have updated/rebased and now finally sending this.)
>
> Some notes:
>
> 1. The closure size of mesa has increased, something like from 374 MiB to 542
> MiB, mostly due to itself (not sure why) and then also from llvm.  This is
> from going from v15 to v18 and as you'll see in a patch I had to enable
> building all targets.  Possibly this can be alleviated by building a smaller
> clang for mesa?
>
> 2. Previous discussion was about getting NVK (which requires rust) built in
> the last mesa update.  I'm not sure the current status but will check with
> those that were working on it before <https://issues.guix.gnu.org/69637>.  I
> believe it is no longer experimental, so we should try to include it.
>
> Hopefully the patch changes and brief comments explain all, but please do
> provide any feedback, changes, fixes, etc.  The branch has just been rebased
> on master but we can rebase as needed or if there are some critical errors on
> these patches I missed.
>
> Thanks!
> John
>
> PS: I guess python-team will get this series as I added two comments (no code
> changes) to python packages now needed for mesa.  One already has a huge
> number of dependents anyway, but good to note I suppose.
>
> John Kehayias (6):
>   gnu: libdrm: Update to 2.4.123.
>   gnu: wayland-protocols: Update to 1.37.
>   gnu: Remove wayland-protocols-next.
>   gnu: llvm-for-mesa: Update to llvm-18.
>   gnu: llvm-for-mesa: Build all targets.
>   gnu: mesa: Update to 24.2.2.
>
> nathan (2):
>   gnu: vulkan-headers: Hard-code libvulkan.so file name.
>   gnu: volk: Hard-code path of vulkan-loader for dynamic loading
>
>  gnu/packages/freedesktop.scm | 17 ++-----------
>  gnu/packages/gl.scm          | 49 ++++++++++++++----------------------
>  gnu/packages/kde-plasma.scm  |  2 +-
>  gnu/packages/llvm.scm        | 29 ++++++++++-----------
>  gnu/packages/python-xyz.scm  |  2 ++
>  gnu/packages/vulkan.scm      | 41 ++++++++++++++++++++++++++----
>  gnu/packages/xdisorg.scm     |  4 +--
>  7 files changed, 75 insertions(+), 69 deletions(-)
>
>
> base-commit: d4fbd1ab341de85c1e5c77e0f7adc5aae056be15

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-mesa-Update-configure-flags.patch --]
[-- Type: text/x-patch; name=0001-gnu-mesa-Update-configure-flags.patch, Size: 4269 bytes --]

From 6845eb88b801692f1889171487736fa6ea6264aa Mon Sep 17 00:00:00 2001
Message-ID: <6845eb88b801692f1889171487736fa6ea6264aa.1725848392.git.john.kehayias@protonmail.com>
From: John Kehayias <john.kehayias@protonmail.com>
Date: Sun, 8 Sep 2024 20:13:33 -0400
Subject: [PATCH 1/2] gnu: mesa: Update configure flags.

Previously, in 1ed0283fcc12b4b48f5b61be026a7b832d9781dc, mesa's configuration
options were altered to use "auto" as needed, while it looks like this was
inadvertently changed in 9b2a3e023f7090d19c98e7582220340df3962555.  This meant
i915 dropped from x86/x86_64.  This commit restores the "auto" behavior where
it matched our previous driver list (or restored missing drivers).  See mesa's
meson.build for all options.

* gnu/packages/gl.scm (mesa)[arguments]: For gallium-drivers, use
"softpipe,llvmpipe" instead of the deprecated "swrast" option.  Use "auto"
in gallium-drivers and vulkan-drivers where it provides the same driver
list (or restores ones dropped from x86/x86_64).  Comment on differences from
"auto" where we don't use it.

Change-Id: I920701f71d19578f4913fda7372273955f0a9847
---
 gnu/packages/gl.scm | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index ab18a3e5a7..c417f11571 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -360,16 +360,18 @@ (define-public mesa
       #~(list
          #$@(cond
              ((target-aarch64?)
+              ;; This includes more drivers than "auto": asahi, r300, r600
               '("-Dgallium-drivers=asahi,etnaviv,freedreno,kmsro,lima,\
-nouveau,panfrost,r300,r600,svga,swrast,tegra,v3d,vc4,virgl,zink"))
+nouveau,panfrost,r300,r600,svga,softpipe,llvmpipe,tegra,v3d,vc4,virgl,zink"))
              ((target-arm32?)
+              ;; This includes more drivers than "auto": r300, r600
               '("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,\
-panfrost,r300,r600,svga,swrast,tegra,v3d,vc4,virgl,zink"))
+panfrost,r300,r600,svga,softpipe,llvmpipe,tegra,v3d,vc4,virgl,zink"))
              ((or (target-ppc64le?) (target-ppc32?) (target-riscv64?))
-              '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,svga,swrast,virgl,zink"))
+              ;; This include more drivers than "auto": svga
+              '("-Dgallium-drivers=nouveau,r300,r600,radeonsi,svga,softpipe,llvmpipe,virgl,zink"))
              (else
-              '("-Dgallium-drivers=crocus,iris,nouveau,r300,r600,radeonsi,\
-svga,swrast,virgl,zink")))
+              '("-Dgallium-drivers=auto")))
          ;; Enable various optional features.  TODO: opencl requires libclc,
          ;; omx requires libomxil-bellagio
          "-Dplatforms=x11,wayland"
@@ -384,16 +386,15 @@ (define-public mesa
          "-Dgbm=enabled"
          "-Dshared-glapi=enabled"
 
-         ;; Explicitly enable Vulkan on some architectures.
          #$@(cond
              ((or (target-x86-32?) (target-x86-64?))
+              ;; This doesn't include nouveau (which is in "auto") as it needs
+              ;; rust.
+              ;; TODO: Enable nouveau/NVK.
               '("-Dvulkan-drivers=intel,intel_hasvk,amd,swrast"))
-             ((or (target-ppc64le?) (target-ppc32?))
-              '("-Dvulkan-drivers=amd,swrast"))
              ((target-aarch64?)
+              ;; This differs from "auto" which only includes swrast and intel
               '("-Dvulkan-drivers=freedreno,amd,broadcom,swrast"))
-             ((target-riscv64?)
-              '("-Dvulkan-drivers=amd,swrast"))
              (else
               '("-Dvulkan-drivers=auto")))
 

base-commit: d4fbd1ab341de85c1e5c77e0f7adc5aae056be15
prerequisite-patch-id: 85f8b14ffb3ff7b86cafbb92e4696be068f4e359
prerequisite-patch-id: 2590cf63b0ab9f283a69b32e365f2ea5dc2da535
prerequisite-patch-id: 2492ce516359cac8bfa032cc76b61a4c92fbeef2
prerequisite-patch-id: d8e75123e17a6f55ca7a7cd5dd837d25ec22c0fa
prerequisite-patch-id: 167752f067cd365b2bd36911cd9c084a5872a5ee
prerequisite-patch-id: 64f83d89967f82eb723f45a5ef60504337f967f1
prerequisite-patch-id: c26265bd60deed274db4274b2934c1ea89b6cc8f
prerequisite-patch-id: bc2a5912f9eba66f1a234fecdc1914a444be9041
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates] gnu: mesa: Enable NVK driver for x86_64 architecture.
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (8 preceding siblings ...)
  2024-09-09  3:43 ` [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa " John Kehayias via Guix-patches via
@ 2024-09-09 16:12 ` aurtzy
  2024-09-16  2:59   ` John Kehayias via Guix-patches via
  2024-09-18  0:35 ` The Man
  10 siblings, 1 reply; 14+ messages in thread
From: aurtzy @ 2024-09-09 16:12 UTC (permalink / raw)
  To: 73071; +Cc: aurtzy, John Kehayias, Efraim Flashner

* gnu/packages/gl.scm (mesa): Enable NVK vulkan driver for x86_64
architecture.
[native-inputs]: Add rust, rust-bindgen-cli, rust-cbindgen-0.26 for x86_64.
[arguments]<#:meson>: Use newer version of meson to satisfy NVK build
requirements.
<#:configure-flags>: Use "auto" for 'vulkan-drivers' flag when target arch is
x86_64.
<#:phases>: Add phase to patch rust subproject sources when target arch is
x86_64.
* gnu/packages/crates-io.scm (rust-paste-1, rust-proc-macro2-1, rust-quote-1,
rust-syn-2, rust-unicode-ident-1): Add a comment about being dependencies of
mesa.

Change-Id: I76e3db5072ca3c718155b188ca64b52766d55f36
---

Hi John,

Thanks for the CC, and sorry for not submitting a patch sooner!

Since last, I have managed to find a better solution to the issue with
substituting rust dependency sources.  Briefly on what I have so far: this
makes use of writing wrap files with just the "directory" property, having
meson fall back to using a local directory that sources are copied to.  Doing
this resulted in an odd behavior with the overlay directories (i.e. important
extra files in subprojects/packagefiles) where they don't seem to be
automatically copied as expected when falling back to local files; however, a
simple copy resolves it, although I thought it would still be good to note and
add a comment about.

I initially made the wrap-file-writing a build utility procedure
'patch-wrap-file' (which can be seen my personal config [1]) as it seemed like
it could be useful for other meson packages, but for this patch I've inlined
it since I'm not confident in its applicability across different projects.
I'd be happy to hear thoughts about it if it might be useful, though.

[1] https://github.com/aurtzy/guix-config/blob/5cf4c9e277f4ab3a8f1ef87ec5ac47a686da0ad2/my-guix/build/utils.scm#L27

Cheers,

aurtzy

 gnu/packages/crates-io.scm |  5 +++
 gnu/packages/gl.scm        | 64 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 0cdb071ea0..2a40062500 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -51869,6 +51869,7 @@ (define-public rust-password-hash-0.2
                             ("rust-subtle" ,rust-subtle-2)
                             ("rust-rand-core" ,rust-rand-core-0.6))))))
 
+;; WARNING: This package is a dependency of mesa.
 (define-public rust-paste-1
   (package
     (name "rust-paste")
@@ -56703,6 +56704,7 @@ (define-public rust-proc-macro-nested-0.1
      "Support for nested proc-macro-hack invocations.")
     (license (list license:expat license:asl2.0))))
 
+;; WARNING: This package is a dependency of mesa.
 (define-public rust-proc-macro2-1
   (package
     (name "rust-proc-macro2")
@@ -60144,6 +60146,7 @@ (define-public rust-quinn-udp-0.1
         ("rust-tokio" ,rust-tokio-1)
         ("rust-tracing" ,rust-tracing-0.1))))))
 
+;; WARNING: This package is a dependency of mesa.
 (define-public rust-quote-1
   (package
     (name "rust-quote")
@@ -76939,6 +76942,7 @@ (define-public rust-symphonia-utils-xiph-0.4
 codecs and formats.")
     (license license:mpl2.0)))
 
+;; WARNING: This package is a dependency of mesa.
 (define-public rust-syn-2
   (package
     (name "rust-syn")
@@ -86599,6 +86603,7 @@ (define-public rust-unicode-id-0.3
 according to Unicode Standard Annex #31.")
     (license (list license:expat license:asl2.0))))
 
+;; WARNING: This package is a dependency of mesa.
 (define-public rust-unicode-ident-1
   (package
     (name "rust-unicode-ident")
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index c417f11571..3939f1ba1f 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2024 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2024 aurtzy <aurtzy@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,6 +42,7 @@ (define-module (gnu packages gl)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages build-tools)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages documentation)
@@ -56,6 +58,7 @@ (define-module (gnu packages gl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages rust)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages vulkan)
@@ -75,7 +78,8 @@ (define-module (gnu packages gl)
   #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (ice-9 match)
-  #:use-module ((srfi srfi-1) #:hide (zip)))
+  #:use-module ((srfi srfi-1) #:hide (zip))
+  #:use-module (srfi srfi-26))
 
 (define-public glu
   (package
@@ -352,10 +356,19 @@ (define-public mesa
                 pkg-config-for-build
                 wayland
                 wayland-protocols)
+          '())
+      (if (target-x86-64?)
+          ;; NVK dependencies
+          (list rust
+                (module-ref (resolve-interface '(gnu packages rust-apps))
+                            'rust-bindgen-cli)
+                (module-ref (resolve-interface '(gnu packages rust-apps))
+                            'rust-cbindgen-0.26))
           '())))
     (outputs '("out" "bin"))
     (arguments
      (list
+      #:meson meson-1.5
       #:configure-flags
       #~(list
          #$@(cond
@@ -387,7 +400,7 @@ (define-public mesa
          "-Dshared-glapi=enabled"
 
          #$@(cond
-             ((or (target-x86-32?) (target-x86-64?))
+             ((target-x86-32?)
               ;; This doesn't include nouveau (which is in "auto") as it needs
               ;; rust.
               ;; TODO: Enable nouveau/NVK.
@@ -481,6 +494,53 @@ (define-public mesa
                       (("'lp_test_arit', ") ""))))
                  (_
                   '((display "No tests to disable on this architecture.\n"))))))
+         #$@(if (target-x86-64?)
+                #~((add-after 'unpack 'patch-subproject-sources
+                     (lambda _
+                       ;; Patch each relevant subproject source URL in wrapfiles to
+                       ;; use the store, which avoids an attempt to download them
+                       ;; mid-build.
+                       (for-each
+                        (match-lambda
+                          ((name source)
+                           (let ((wrap-file (string-append
+                                             "subprojects/" name ".wrap"))
+                                 (subproject-dest (string-append
+                                                   "subprojects/" name))
+                                 (overlay-dir (string-append
+                                               "subprojects/packagefiles/" name)))
+                             (copy-recursively source subproject-dest)
+                             ;; Normally when the patch_directory wrap file property
+                             ;; is specified, meson automatically copies from
+                             ;; packagefiles, but this is not the case here (only
+                             ;; happens when downloading source?) so we manually copy
+                             ;; overlay-dir to subproject-dest.
+                             (when (file-exists? overlay-dir)
+                               (copy-recursively overlay-dir subproject-dest))
+                             (call-with-output-file wrap-file
+                               (lambda (port)
+                                 (format port "[wrap-file]
+directory = ~a
+"
+                                         name))))))
+                        '#+(map (lambda (pkg)
+                                  (let ((name (package-upstream-name* pkg))
+                                        (version (package-version pkg)))
+                                    (list (package-upstream-name* pkg)
+                                          (file-append pkg
+                                                       "/share/cargo/src/"
+                                                       name "-" version))))
+                                (let ((from-crates-io
+                                       (cut module-ref
+                                            (resolve-interface
+                                             '(gnu packages crates-io))
+                                            <>)))
+                                  (list (from-crates-io 'rust-syn-2)
+                                        (from-crates-io 'rust-unicode-ident-1)
+                                        (from-crates-io 'rust-quote-1)
+                                        (from-crates-io 'rust-proc-macro2-1)
+                                        (from-crates-io 'rust-paste-1))))))))
+                #~())
          (add-before 'configure 'fix-dlopen-libnames
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((out #$output))

base-commit: c1ca70a98024a1e9dd6fedded1d31ad763b8b282
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates] gnu: mesa: Enable NVK driver for x86_64 architecture.
  2024-09-09 16:12 ` [bug#73071] [PATCH mesa-updates] gnu: mesa: Enable NVK driver for x86_64 architecture aurtzy
@ 2024-09-16  2:59   ` John Kehayias via Guix-patches via
  2024-09-17  1:50     ` [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 aurtzy
  0 siblings, 1 reply; 14+ messages in thread
From: John Kehayias via Guix-patches via @ 2024-09-16  2:59 UTC (permalink / raw)
  To: aurtzy; +Cc: 73071, Efraim Flashner

Hi aurtzy!

On Mon, Sep 09, 2024 at 12:12 PM, aurtzy wrote:

> * gnu/packages/gl.scm (mesa): Enable NVK vulkan driver for x86_64
> architecture.
> [native-inputs]: Add rust, rust-bindgen-cli, rust-cbindgen-0.26 for x86_64.
> [arguments]<#:meson>: Use newer version of meson to satisfy NVK build
> requirements.
> <#:configure-flags>: Use "auto" for 'vulkan-drivers' flag when target arch is
> x86_64.
> <#:phases>: Add phase to patch rust subproject sources when target arch is
> x86_64.
> * gnu/packages/crates-io.scm (rust-paste-1, rust-proc-macro2-1, rust-quote-1,
> rust-syn-2, rust-unicode-ident-1): Add a comment about being dependencies of
> mesa.
>
> Change-Id: I76e3db5072ca3c718155b188ca64b52766d55f36
> ---
>
> Hi John,
>
> Thanks for the CC, and sorry for not submitting a patch sooner!
>

No problem, I let things go for a bit too, thanks for this work!

> Since last, I have managed to find a better solution to the issue with
> substituting rust dependency sources.  Briefly on what I have so far: this
> makes use of writing wrap files with just the "directory" property, having
> meson fall back to using a local directory that sources are copied to.  Doing
> this resulted in an odd behavior with the overlay directories (i.e. important
> extra files in subprojects/packagefiles) where they don't seem to be
> automatically copied as expected when falling back to local files; however, a
> simple copy resolves it, although I thought it would still be good to note and
> add a comment about.
>
> I initially made the wrap-file-writing a build utility procedure
> 'patch-wrap-file' (which can be seen my personal config [1]) as it seemed like
> it could be useful for other meson packages, but for this patch I've inlined
> it since I'm not confident in its applicability across different projects.
> I'd be happy to hear thoughts about it if it might be useful, though.
>
> [1] <https://github.com/aurtzy/guix-config/blob/5cf4c9e277f4ab3a8f1ef87ec5ac47a686da0ad2/my-guix/build/utils.scm#L27>
>

Very nice! Yes, more utilities to help with unbundling essentially
will be helpful. I don't know if I ever wrote a wrap file or just
patched the directory bit into the meson file directly. I would have
to look this over, but a utility function (or via keyword argument in
meson-build-system?) would be great.

As for the main patch: I've built locally and see nouveau as a vulkan
driver on x86_64 but not i686. That's about all I can test though. The
change to #:meson means other archs will rebuild too, but I don't know
if they got far anyway (so we can cancel old derivations). Perhaps a
new mesa point release will be out this week? Then I could bump the
version, rebase, and rebuild with this patch. Thoughts?

Other than that, I made a minor tweak to the changelog (remove first
line, name the phase) locally, but have not done a rebase/push on
mesa-updates. Let me give it a few days for other comments and if
there are any other rebuilds to go with it.

Thanks again!
John

> Cheers,
>
> aurtzy
>
>  gnu/packages/crates-io.scm |  5 +++
>  gnu/packages/gl.scm        | 64 ++++++++++++++++++++++++++++++++++++--
>  2 files changed, 67 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
> index 0cdb071ea0..2a40062500 100644
> --- a/gnu/packages/crates-io.scm
> +++ b/gnu/packages/crates-io.scm
> @@ -51869,6 +51869,7 @@ (define-public rust-password-hash-0.2
>                              ("rust-subtle" ,rust-subtle-2)
>                              ("rust-rand-core" ,rust-rand-core-0.6))))))
>
> +;; WARNING: This package is a dependency of mesa.
>  (define-public rust-paste-1
>    (package
>      (name "rust-paste")
> @@ -56703,6 +56704,7 @@ (define-public rust-proc-macro-nested-0.1
>       "Support for nested proc-macro-hack invocations.")
>      (license (list license:expat license:asl2.0))))
>
> +;; WARNING: This package is a dependency of mesa.
>  (define-public rust-proc-macro2-1
>    (package
>      (name "rust-proc-macro2")
> @@ -60144,6 +60146,7 @@ (define-public rust-quinn-udp-0.1
>          ("rust-tokio" ,rust-tokio-1)
>          ("rust-tracing" ,rust-tracing-0.1))))))
>
> +;; WARNING: This package is a dependency of mesa.
>  (define-public rust-quote-1
>    (package
>      (name "rust-quote")
> @@ -76939,6 +76942,7 @@ (define-public rust-symphonia-utils-xiph-0.4
>  codecs and formats.")
>      (license license:mpl2.0)))
>
> +;; WARNING: This package is a dependency of mesa.
>  (define-public rust-syn-2
>    (package
>      (name "rust-syn")
> @@ -86599,6 +86603,7 @@ (define-public rust-unicode-id-0.3
>  according to Unicode Standard Annex #31.")
>      (license (list license:expat license:asl2.0))))
>
> +;; WARNING: This package is a dependency of mesa.
>  (define-public rust-unicode-ident-1
>    (package
>      (name "rust-unicode-ident")
> diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
> index c417f11571..3939f1ba1f 100644
> --- a/gnu/packages/gl.scm
> +++ b/gnu/packages/gl.scm
> @@ -21,6 +21,7 @@
>  ;;; Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com>
>  ;;; Copyright © 2024 Liliana Marie Prikler <liliana.prikler@gmail.com>
>  ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
> +;;; Copyright © 2024 aurtzy <aurtzy@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -41,6 +42,7 @@ (define-module (gnu packages gl)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages autotools)
>    #:use-module (gnu packages bison)
> +  #:use-module (gnu packages build-tools)
>    #:use-module (gnu packages check)
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages documentation)
> @@ -56,6 +58,7 @@ (define-module (gnu packages gl)
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages python)
>    #:use-module (gnu packages python-xyz)
> +  #:use-module (gnu packages rust)
>    #:use-module (gnu packages tls)
>    #:use-module (gnu packages video)
>    #:use-module (gnu packages vulkan)
> @@ -75,7 +78,8 @@ (define-module (gnu packages gl)
>    #:use-module (guix gexp)
>    #:use-module (guix utils)
>    #:use-module (ice-9 match)
> -  #:use-module ((srfi srfi-1) #:hide (zip)))
> +  #:use-module ((srfi srfi-1) #:hide (zip))
> +  #:use-module (srfi srfi-26))
>
>  (define-public glu
>    (package
> @@ -352,10 +356,19 @@ (define-public mesa
>                  pkg-config-for-build
>                  wayland
>                  wayland-protocols)
> +          '())
> +      (if (target-x86-64?)
> +          ;; NVK dependencies
> +          (list rust
> +                (module-ref (resolve-interface '(gnu packages rust-apps))
> +                            'rust-bindgen-cli)
> +                (module-ref (resolve-interface '(gnu packages rust-apps))
> +                            'rust-cbindgen-0.26))
>            '())))
>      (outputs '("out" "bin"))
>      (arguments
>       (list
> +      #:meson meson-1.5
>        #:configure-flags
>        #~(list
>           #$@(cond
> @@ -387,7 +400,7 @@ (define-public mesa
>           "-Dshared-glapi=enabled"
>
>           #$@(cond
> -             ((or (target-x86-32?) (target-x86-64?))
> +             ((target-x86-32?)
>                ;; This doesn't include nouveau (which is in "auto") as it needs
>                ;; rust.
>                ;; TODO: Enable nouveau/NVK.
> @@ -481,6 +494,53 @@ (define-public mesa
>                        (("'lp_test_arit', ") ""))))
>                   (_
>                    '((display "No tests to disable on this architecture.\n"))))))
> +         #$@(if (target-x86-64?)
> +                #~((add-after 'unpack 'patch-subproject-sources
> +                     (lambda _
> +                       ;; Patch each relevant subproject source URL in wrapfiles to
> +                       ;; use the store, which avoids an attempt to download them
> +                       ;; mid-build.
> +                       (for-each
> +                        (match-lambda
> +                          ((name source)
> +                           (let ((wrap-file (string-append
> +                                             "subprojects/" name ".wrap"))
> +                                 (subproject-dest (string-append
> +                                                   "subprojects/" name))
> +                                 (overlay-dir (string-append
> +                                               "subprojects/packagefiles/" name)))
> +                             (copy-recursively source subproject-dest)
> +                             ;; Normally when the patch_directory wrap file property
> +                             ;; is specified, meson automatically copies from
> +                             ;; packagefiles, but this is not the case here (only
> +                             ;; happens when downloading source?) so we manually copy
> +                             ;; overlay-dir to subproject-dest.
> +                             (when (file-exists? overlay-dir)
> +                               (copy-recursively overlay-dir subproject-dest))
> +                             (call-with-output-file wrap-file
> +                               (lambda (port)
> +                                 (format port "[wrap-file]
> +directory = ~a
> +"
> +                                         name))))))
> +                        '#+(map (lambda (pkg)
> +                                  (let ((name (package-upstream-name* pkg))
> +                                        (version (package-version pkg)))
> +                                    (list (package-upstream-name* pkg)
> +                                          (file-append pkg
> +                                                       "/share/cargo/src/"
> +                                                       name "-" version))))
> +                                (let ((from-crates-io
> +                                       (cut module-ref
> +                                            (resolve-interface
> +                                             '(gnu packages crates-io))
> +                                            <>)))
> +                                  (list (from-crates-io 'rust-syn-2)
> +                                        (from-crates-io 'rust-unicode-ident-1)
> +                                        (from-crates-io 'rust-quote-1)
> +                                        (from-crates-io 'rust-proc-macro2-1)
> +                                        (from-crates-io 'rust-paste-1))))))))
> +                #~())
>           (add-before 'configure 'fix-dlopen-libnames
>             (lambda* (#:key inputs #:allow-other-keys)
>               (let ((out #$output))
>
> base-commit: c1ca70a98024a1e9dd6fedded1d31ad763b8b282





^ permalink raw reply	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2
  2024-09-16  2:59   ` John Kehayias via Guix-patches via
@ 2024-09-17  1:50     ` aurtzy
  0 siblings, 0 replies; 14+ messages in thread
From: aurtzy @ 2024-09-17  1:50 UTC (permalink / raw)
  To: 73071; +Cc: John Kehayias, aurtzy

[-- Attachment #1: Type: text/plain, Size: 3576 bytes --]

Hi,

I have an additional question/concern that's come up, but to address 
your comments first:

On 9/15/24 22:59, John Kehayias wrote:

>> Since last, I have managed to find a better solution to the issue with
>> substituting rust dependency sources.  Briefly on what I have so far: this
>> makes use of writing wrap files with just the "directory" property, having
>> meson fall back to using a local directory that sources are copied to.  Doing
>> this resulted in an odd behavior with the overlay directories (i.e. important
>> extra files in subprojects/packagefiles) where they don't seem to be
>> automatically copied as expected when falling back to local files; however, a
>> simple copy resolves it, although I thought it would still be good to note and
>> add a comment about.
>>
>> I initially made the wrap-file-writing a build utility procedure
>> 'patch-wrap-file' (which can be seen my personal config [1]) as it seemed like
>> it could be useful for other meson packages, but for this patch I've inlined
>> it since I'm not confident in its applicability across different projects.
>> I'd be happy to hear thoughts about it if it might be useful, though.
>>
>> [1]<https://github.com/aurtzy/guix-config/blob/5cf4c9e277f4ab3a8f1ef87ec5ac47a686da0ad2/my-guix/build/utils.scm#L27>
>>
> Very nice! Yes, more utilities to help with unbundling essentially
> will be helpful. I don't know if I ever wrote a wrap file or just
> patched the directory bit into the meson file directly. I would have
> to look this over, but a utility function (or via keyword argument in
> meson-build-system?) would be great.
Okay! I'll have a look at the keyword argument approach as well and see 
if I can make a proposal for changes and further comments sometime soon.
> As for the main patch: I've built locally and see nouveau as a vulkan
> driver on x86_64 but not i686. That's about all I can test though. The
> change to #:meson means other archs will rebuild too, but I don't know
> if they got far anyway (so we can cancel old derivations). Perhaps a
> new mesa point release will be out this week? Then I could bump the
> version, rebase, and rebuild with this patch. Thoughts?

I didn't consider this when writing the patch, but would it be a good 
idea to only use meson-1.5 for x86_64? We could avoid rebuilds that way.

Looks like a new mesa release is planned for the 18th [1].

> Other than that, I made a minor tweak to the changelog (remove first
> line, name the phase) locally, but have not done a rebase/push on
> mesa-updates. Let me give it a few days for other comments and if
> there are any other rebuilds to go with it.

Regarding my concern (unrelated to NVK): I've had issues with a nonfree 
application segfaulting which I narrowed down to a mesa commit from a 
few months ago [2] [3] and hit a dead end with (until today). It's only 
this single program which I had ever noticed the issue with so I pushed 
it aside, but it just occurred to me that this seems like a change that 
could affect other cases my daily driving has not covered.

Further investigation today has revealed that adding libglvnd as an 
input to mesa fixes this, although from what I can tell reading past 
discussions on adding it, it seems like a complicated issue [4]. 
Thoughts about this situation?

[1] https://docs.mesa3d.org/release-calendar.html#calendar

[2] https://gitlab.freedesktop.org/mesa/mesa/-/issues/11666

[3] 
https://gitlab.freedesktop.org/mesa/mesa/-/commit/50fc7cc290db49288b318c116c6fdc3daaf801e9

[4] https://issues.guix.gnu.org/49339#3

Cheers,

aurtzy


[-- Attachment #2: Type: text/html, Size: 5122 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2
  2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
                   ` (9 preceding siblings ...)
  2024-09-09 16:12 ` [bug#73071] [PATCH mesa-updates] gnu: mesa: Enable NVK driver for x86_64 architecture aurtzy
@ 2024-09-18  0:35 ` The Man
  10 siblings, 0 replies; 14+ messages in thread
From: The Man @ 2024-09-18  0:35 UTC (permalink / raw)
  To: 73071

[-- Attachment #1: Type: text/plain, Size: 3437 bytes --]

Hello, In the interest of creating a future where mesa properly works
alongside libglvnd i think there's a few options:

- simply adding "-Dglvnd=true" to mesa configure-flags and tediously adding
libglvnd to the inputs of every package that links to LibGL, as well as
patching anything problematic as mentioned in
https://issues.guix.gnu.org/49339#8

- create an abomination, the ONE MESA TO RULE THEM ALL. an example follows:

(define-public mesa/new
  (package
    (inherit mesa)
    (arguments
      (substitute-keyword-arguments (package-arguments mesa)
        ((#:configure-flags flags ''())
          #~(append #$flags
            (list "-Dglvnd=true")))
        ((#:phases phases ''())
          (with-imported-modules '((guix build union))
          #~(modify-phases #$phases
            (add-before 'validate-runpath 'unionize
              (lambda _ ;; unionize with libglvnd, fixing all problems
                (use-modules (ice-9 match)
                             (guix build union))
                (union-build (string-append #$output "/tmp")
                  '#$(list (this-package-input "libglvnd"))
                  #:create-all-directories? #t)
                (copy-recursively (string-append #$output "/tmp") #$output)
                (delete-file-recursively (string-append #$output "/tmp"))
                ;; leftovers from building with old mesa.
                ;; some packages still link to these.
                ;; remove for rebuilding after applying graft?
                (symlink (string-append #$output "/lib/libEGL.so.1")
                         (string-append #$output "/lib/libEGL.so.1.0.0"))
                (symlink (string-append #$output "/lib/libGLESv1_CM.so.1")
                         (string-append #$output
"/lib/libGLESv1_CM.so.1.1.0"))
                (symlink (string-append #$output "/lib/libGLESv2.so.2")
                         (string-append #$output "/lib/libGLESv2.so.2.0.0"))
                (symlink (string-append #$output "/lib/libGL.so.1")
                         (string-append #$output "/lib/libGL.so.1.2.0"))))
            (add-after 'install 'fix-paths
              (lambda _
                (substitute*
                  (string-append #$output
"/share/glvnd/egl_vendor.d/50_mesa.json")
                  (("libEGL_mesa")
                    (string-append #$output "/lib/libEGL_mesa")))))
            (add-after 'fix-paths 'add-external-egl
              (lambda _
                (mkdir-p (string-append #$output
"/share/egl/egl_external_platform.d")))))))))
    (native-search-paths (append (package-native-search-paths mesa)
     (list
      (search-path-specification
       (variable "__EGL_VENDOR_LIBRARY_DIRS")
       (files '("share/glvnd/egl_vendor.d")))
      (search-path-specification
       (variable "GBM_BACKENDS_PATH")
       (files '("lib")))
      (search-path-specification
       (variable "XDG_DATA_DIRS")
       (files '("share")))
      (search-path-specification
       (variable "__EGL_EXTERNAL_PLATFORM_CONFIG_DIRS")
       (files '("share/egl/egl_external_platform.d"))))))
    (inputs (modify-inputs (package-inputs mesa)
      (prepend libglvnd)))))

Using this to graft over mesa is a filthy answer to the "GL problem". no
rebuilding necessary, it seems to "just work".

Other distributions have settled on packaging mesa build for working with
libglvnd and most software seems to expect such.
Perhaps there's another solution?

[-- Attachment #2: Type: text/html, Size: 4493 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-09-18  0:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-06 15:00 [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 John Kehayias via Guix-patches via
2024-09-06 15:05 ` [bug#73071] [PATCH mesa-updates 1/8] gnu: libdrm: Update to 2.4.123 John Kehayias via Guix-patches via
2024-09-06 15:06 ` [bug#73071] [PATCH mesa-updates 2/8] gnu: wayland-protocols: Update to 1.37 John Kehayias via Guix-patches via
2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 3/8] gnu: Remove wayland-protocols-next John Kehayias via Guix-patches via
2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 4/8] gnu: vulkan-headers: Hard-code libvulkan.so file name John Kehayias via Guix-patches via
2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 5/8] gnu: volk: Hard-code path of vulkan-loader for dynamic loading John Kehayias via Guix-patches via
2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 6/8] gnu: llvm-for-mesa: Update to llvm-18 John Kehayias via Guix-patches via
2024-09-06 15:07 ` [bug#73071] [PATCH mesa-updates 7/8] gnu: llvm-for-mesa: Build all targets John Kehayias via Guix-patches via
2024-09-06 15:08 ` [bug#73071] [PATCH mesa-updates 8/8] gnu: mesa: Update to 24.2.2 John Kehayias via Guix-patches via
2024-09-09  3:43 ` [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa " John Kehayias via Guix-patches via
2024-09-09 16:12 ` [bug#73071] [PATCH mesa-updates] gnu: mesa: Enable NVK driver for x86_64 architecture aurtzy
2024-09-16  2:59   ` John Kehayias via Guix-patches via
2024-09-17  1:50     ` [bug#73071] [PATCH mesa-updates 0/8] Various updates for mesa to 24.2.2 aurtzy
2024-09-18  0:35 ` The Man

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).