Received: (at submit) by debbugs.gnu.org; 16 Oct 2024 03:32:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 15 23:32:46 2024 Received: from localhost ([127.0.0.1]:58059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1t0umC-0006fH-T5 for submit <at> debbugs.gnu.org; Tue, 15 Oct 2024 23:32:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:60640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <squishypinkelephant@HIDDEN>) id 1t0um9-0006f8-A7 for submit <at> debbugs.gnu.org; Tue, 15 Oct 2024 23:32:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <squishypinkelephant@HIDDEN>) id 1t0ujf-0003C9-2w for guix-patches@HIDDEN; Tue, 15 Oct 2024 23:30:08 -0400 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <squishypinkelephant@HIDDEN>) id 1t0ujc-0004su-22 for guix-patches@HIDDEN; Tue, 15 Oct 2024 23:30:06 -0400 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-2887326be3dso1875018fac.1 for <guix-patches@HIDDEN>; Tue, 15 Oct 2024 20:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729049401; x=1729654201; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tDgYj3vFlDTERVwhANntSl7T1cq4+hLh1MQsaAcWT3Q=; b=SlCUUveVXQRULCsLPhluLAiDEmeOF/mkPSHQNtPz8rNE9r07MH4PabHhpNOzGm+6YB gl+CGpjCiKEOwoaG72FdNRSWs6EQUTnpZ76wLTFPJjK+ftDIpisoUT/07JKIEwX5PUka KvRrtgpRBPYWCOwECEBlf8nDIF+UvyR49PWuhfaeNRCLSALnnkI8rqunWxPzXbgQF30U N0+kTPOqwZJvQ/LXTK6tRK3s0+HFJnqOWfCOgxD6zbYxNK6ttKQuB/rEgMu5gX9fY2q9 loASn/pOkmADkoUSBSY+KLVLEd2zf+YuhTBrBCaPJkqEaDIOC2euqKx68OuHgjYffRqW pMrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729049401; x=1729654201; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tDgYj3vFlDTERVwhANntSl7T1cq4+hLh1MQsaAcWT3Q=; b=r99+LjKnZHJcmdmlGmf+uYq270nYhfMz9eNTsTmm26T1mwxYu/sBKKT5cnYa7SM9ln FZ1I5nSNks6i/HHkXnGSZKfI7mKiWR11fwc4AzWiUPSgO9U8E2EZml7QnBb2d7P2FC17 gyXpvnppCgeWpenH6RrH+jRYWwnrwHltye0GK5n7yiTS/AMIsxAR1knzm20f68DK8wSB burdjbl3JVPPMw7zLGaKLjBv4If4Qxzq/uzCHBv2qUTJ3iZS6pzv0n5TGmVsMFm+BGRW Cem+q5ree5w3xTLTNC5eaQcY+jbSBbJPcLupSr6JTgfT3Wxaa2Eub1ZiKfgwbCkZLbaH G9Sg== X-Gm-Message-State: AOJu0YyM4YffoOp/ZXlL6S0eNooLWNjGCbF1KwV/laUDiEZ9Y+co5iPn pAOt03H1DJB8yMaefqSxTHRYRBXP6tN1Sm8Augdts3j9TO97YzihBjdFFKcZL2Y4JbMYxVsTPJz Ux9MzfNUs/TxFGEIpTrVWBZqR/EM= X-Google-Smtp-Source: AGHT+IFas4GCyY0WZ6dcsKsImFZr4BZNwwif4Cd4PBEURsiM0EhfUU3MFImctg9L/+SQmWud9j3YT13Yexe5pwDbBXI= X-Received: by 2002:a05:6870:418f:b0:270:2c3:f362 with SMTP id 586e51a60fabf-2886df67f30mr12502668fac.32.1729049400668; Tue, 15 Oct 2024 20:30:00 -0700 (PDT) MIME-Version: 1.0 References: <726317c4-cc33-42be-af55-69bea3010a68@HIDDEN> In-Reply-To: <726317c4-cc33-42be-af55-69bea3010a68@HIDDEN> From: The Man <squishypinkelephant@HIDDEN> Date: Tue, 15 Oct 2024 22:29:24 -0500 Message-ID: <CAPfwWajVcqgUf8BfQrWOTwiTR7qNaZxu2aMfryED6orM6jO_Rg@HIDDEN> Subject: Re: libglvnd support in mesa To: aurtzy <aurtzy@HIDDEN> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:4860:4864:20::2c; envelope-from=squishypinkelephant@HIDDEN; helo=mail-oa1-x2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: John Kehayias <john.kehayias@HIDDEN>, guix-patches@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) Hey, looking into this, https://discourse.nixos.org/t/help-understanding-the-libgl-abi-problem-and-= possible-solutions/42022 has the following: "libGL is loaded impurely in Nix. That is, NixOS sets LD_LIBRARY_PATH..." This is backed up by https://nixos.wiki/wiki/OpenGL suggesting the use of it as well. There is a little discussion as well in https://github.com/NixOS/nixpkgs/issues/31189 Some have pointed to https://gitlab.collabora.com/vivek/libcapsule as possibly being usable. it's currently under active development, but previous attempts to use it by other nix people seem inconclusive. In my own small amount of effort on going down this path, doing the same as nix and setting LD_LIBRARY_PATH within mesa's search paths yielded promising results, otherwise I was seeing test failures in relation to opengl. what I have is a little ugly but i think it's a half decent start; diff --git a/gnu/packages/chromium.scm b/gnu/packages/chromium.scm index cf1703cecb..9e58ea5e56 100644 --- a/gnu/packages/chromium.scm +++ b/gnu/packages/chromium.scm @@ -796,7 +796,7 @@ (define-public ungoogled-chromium "chromium/master-preferences.json"))) (gtk (dirname (dirname (search-input-file inputs "lib/libgtk-3.so")))) - (mesa (dirname (search-input-file inputs "lib/libGL.s= o"))) + (libglvnd (dirname (search-input-file inputs "lib/libGL.so"))) (vulkan (dirname (search-input-file inputs "lib/libvulkan.so"))) (xdg-utils (dirname (search-input-file inputs "bin/xdg-open")))) @@ -838,7 +838,7 @@ (define-public ungoogled-chromium ;; Provide libGL and libvulkan without patching all references. ;; XXX: How to add on RUNPATH instead of this hack? `("LD_LIBRARY_PATH" ":" prefix - (,(string-append mesa ":" vulkan))) + (,(string-append libglvnd ":" vulkan))) ;; Ensure xdg-open et al. is found. `("PATH" ":" prefix (,xdg-utils)))) diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index 21be697d3b..7b65c77543 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -314,6 +314,7 @@ (define-public mesa (propagated-inputs ;; The following are in the Requires.private field of gl.pc. (list libdrm + libglvnd libvdpau libx11 libxdamage @@ -382,6 +383,8 @@ (define-public mesa ;; "-Domx=3Dtrue" "-Dosmesa=3Dtrue" "-Dgallium-xa=3Denabled" + ;; libglvnd + "-Dglvnd=3Dtrue" ;; features required by wayland "-Dgles2=3Denabled" @@ -572,13 +575,41 @@ (define-public mesa (((string-append "\"lib" layer-name ".so\"")) (string-append "\"" out "/lib/lib" layer-name ".so\""))))))) (for-each fix-layer-path '("VkLayer_MESA_device_select" - "VkLayer_MESA_overlay")))))))) + "VkLayer_MESA_overlay"))))) + (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 (list (search-path-specification ;; Ensure the Mesa VDPAU drivers can be found. (variable "VDPAU_DRIVER_PATH") (separator #f) - (files '("lib/vdpau"))))) + (files '("lib/vdpau"))) + (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"))) + ;; FIXME: find a way to get opengl to work properly + ;; without needing this when running tests or from guix-shell + (search-path-specification + (variable "LD_LIBRARY_PATH") + (files '("lib"))))) (home-page "https://mesa3d.org/") (synopsis "OpenGL and Vulkan implementations") (description "Mesa is a free implementation of the OpenGL and Vulkan @@ -763,7 +794,7 @@ (define-public guile-opengl (substitute* "gl/runtime.scm" (("\\(dynamic-link\\)") (string-append "(dynamic-link \"" - (assoc-ref inputs "mesa") + (assoc-ref inputs "libglvnd") "/lib/libGL.so" "\")"))) (define (dynamic-link-substitute file lib input) (substitute* file @@ -773,7 +804,7 @@ (define (dynamic-link-substitute file lib input) "/lib/lib" lib "\"")))) ;; Replace dynamic-link calls for libGL, libGLU, and ;; libglut with absolute paths to the store. - (dynamic-link-substitute "glx/runtime.scm" "GL" "mesa= ") + (dynamic-link-substitute "glx/runtime.scm" "GL" "libglvnd") (dynamic-link-substitute "glu/runtime.scm" "GLU" "glu= ") (dynamic-link-substitute "glut/runtime.scm" "glut" "freeglut")))))) @@ -809,14 +840,14 @@ (define-public libepoxy #~(modify-phases %standard-phases (add-before 'configure 'patch-paths (lambda* (#:key inputs #:allow-other-keys) - (let ((mesa-lib + (let ((gl-lib (lambda (file) (search-input-file inputs (string-append "lib/" file))))) (substitute* (find-files "." "\\.[ch]$") - (("libGL.so.1") (mesa-lib "libGL.so.1")) - (("libEGL.so.1") (mesa-lib "libEGL.so.1")) - (("libGLESv1_CM.so.1") (mesa-lib "libGLESv1_CM.so.1")) - (("libGLESv2.so.2") (mesa-lib "libGLESv2.so.2"))))))))) + (("libGL.so.1") (gl-lib "libGL.so.1")) + (("libEGL.so.1") (gl-lib "libEGL.so.1")) + (("libGLESv1_CM.so.1") (gl-lib "libGLESv1_CM.so.1")) + (("libGLESv2.so.2") (gl-lib "libGLESv2.so.2"))))))))) (build-system meson-build-system) (native-inputs (list pkg-config python)) @@ -1229,11 +1260,11 @@ (define-public glmark2 (modify-phases %standard-phases (add-after 'unpack 'patch-paths (lambda* (#:key inputs #:allow-other-keys) - (let ((mesa (assoc-ref inputs "mesa"))) + (let ((gl-lib (assoc-ref inputs "libglvnd"))) (substitute* (find-files "src" "gl-state-.*\\.cpp$") - (("libGL.so") (string-append mesa "/lib/libGL.so")) - (("libEGL.so") (string-append mesa "/lib/libEGL.so")) - (("libGLESv2.so") (string-append mesa "/lib/libGLESv2.so"= ))) + (("libGL.so") (string-append gl-lib "/lib/libGL.so")) + (("libEGL.so") (string-append gl-lib "/lib/libEGL.so")) + (("libGLESv2.so") (string-append gl-lib "/lib/libGLESv2.s= o"))) #t)))))) (native-inputs (list pkg-config)) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index cf3d1a1496..ce8629f86a 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -6316,7 +6316,7 @@ (define-public cogl ;; Arrange to pass an absolute file name to ;; dlopen for libGL.so. (string-append "--with-gl-libname=3D" - (assoc-ref %build-inputs "me= sa") + (assoc-ref %build-inputs "libglvnd") "/lib/libGL.so")) #:phases (modify-phases %standard-phases diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 6ba27fac1f..297b12b224 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -748,6 +748,7 @@ (define-public icecat-minimal pixman pulseaudio mesa + libglvnd ;; error without pciutils mit-krb5 hunspell @@ -1090,7 +1091,7 @@ (define (runpaths-of-input label) (file-append (this-package-input label) "/lib")) '("libpng-apng" "libxscrnsaver" - "mesa" + "libglvnd" "pciutils" "mit-krb5" "eudev" diff --git a/gnu/packages/librewolf.scm b/gnu/packages/librewolf.scm index d696a3058f..9b8f49de33 100644 --- a/gnu/packages/librewolf.scm +++ b/gnu/packages/librewolf.scm @@ -585,7 +585,7 @@ (define (runpaths-of-input label) (string-append (assoc-ref inputs lib-name) "/lib")) - '("mesa" "libpng-apng" "libnotify" "l= ibva" + '("libglvnd" "libpng-apng" "libnotify" "libva" "pulseaudio" "gtk+" "pipewire" ;; For U2F and WebAuthn "eudev"))) @@ -602,7 +602,7 @@ (define (runpaths-of-input label) (rdd-whitelist (map (cut string-append <> "/= ") (delete-duplicates (append-map runpaths-of-input - '("m= esa" + '("libglvnd" "ffmpeg"))))) (gtk-share (string-append (assoc-ref inputs "gtk+") diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index d649c0df9e..c2b11a20d3 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -1206,10 +1206,10 @@ (define-public extempore ("fft" "libkiss_fft.so" "kiss-fft") ("stb_image" "libstb_image.so" "stb-image") ("nanovg" "libnanovg.so" "nanovg") - ("glext" "libGL.so" "mesa") + ("glext" "libGL.so" "libglvnd") ("glfw3" "libglfw.so" "glfw") - ("gl/glcore-directbind" "libGL.so" "mesa") - ("gl/glcompat-directbind" "libGL.so" "mesa"))) + ("gl/glcore-directbind" "libGL.so" "libglvnd") + ("gl/glcompat-directbind" "libGL.so" "libglvnd"))) #t)) (add-after 'unpack 'use-own-llvm (lambda* (#:key inputs #:allow-other-keys) diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 31576dedf9..3f47cba2af 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -8547,7 +8547,7 @@ (define-public perl-opengl (("-L/usr/local/freeglut/lib") (string-append "-L" (assoc-ref inputs "freeglut") "/lib\n" "-L" (assoc-ref inputs "glu") "/lib\n" - "-L" (assoc-ref inputs "mesa") "/lib\n"))) + "-L" (assoc-ref inputs "libglvnd") "/lib\n"= ))) #t))))) (home-page "https://metacpan.org/release/OpenGL") (synopsis diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 8c7e1596e6..2a2f0084af 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -25524,15 +25524,15 @@ (define-public python-pyopengl (("filenames_to_try =3D \\[\\]") "filenames_to_try =3D [nam= e]")) (substitute* '("OpenGL/platform/glx.py" "tests/check_glut_load.py") (("'GL'") - (string-append "'" (assoc-ref inputs "mesa") "/lib/libGL.s= o'")) + (string-append "'" (assoc-ref inputs "libglvnd") "/lib/libGL.so'")) (("'GLU'") (string-append "'" (assoc-ref inputs "glu") "/lib/libGLU.s= o'")) (("'glut',") (string-append "'" (assoc-ref inputs "freeglut") "/lib/libglut.so',")) (("'GLESv1_CM'") - (string-append "'" (assoc-ref inputs "mesa") "/lib/libGLESv1_CM.so'")) + (string-append "'" (assoc-ref inputs "libglvnd") "/lib/libGLESv1_CM.so'")) (("'GLESv2'") - (string-append "'" (assoc-ref inputs "mesa") "/lib/libGLESv2.so'"))) + (string-append "'" (assoc-ref inputs "libglvnd") "/lib/libGLESv2.so'"))) ;; Not providing libgle. It seems to be very old. #t))))) (home-page "https://pyopengl.sourceforge.net") @@ -25589,21 +25589,21 @@ (define-public python-glcontext (list #:phases #~(modify-phases %standard-phases (add-before 'build 'fix-lib-paths (lambda* (#:key inputs outputs #:allow-other-k= eys) - (let ((mesa (assoc-ref inputs "mesa")) + (let ((gl-lib (assoc-ref inputs "libglvnd")) (libx11 (assoc-ref inputs "libx11"))) (substitute* '("glcontext/x11.cpp" "glcontext/egl.cpp") (("\"libGL.so\"") - (string-append "\"" mesa "/lib/libGL.so= \"")) + (string-append "\"" gl-lib "/lib/libGL.so\"")) (("\"libEGL.so\"") - (string-append "\"" mesa "/lib/libEGL.so\"")) + (string-append "\"" gl-lib "/lib/libEGL.so\"")) (("\"libX11.so\"") (string-append "\"" libx11 "/lib/libX11.so\""))) (substitute* '("glcontext/__init__.py") (("find_library\\('GL'\\)") - (string-append "'" mesa "/lib/libGL.so'= ")) + (string-append "'" gl-lib "/lib/libGL.s= o'")) (("find_library\\('EGL'\\)") - (string-append "'" mesa "/lib/libEGL.so= '")) + (string-append "'" gl-lib "/lib/libEGL.so'")) (("find_library\\(\"X11\"\\)") (string-append "'" libx11 "/lib/libX11.so'")))))) (replace 'check diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 687c20cd90..994383edfd 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -674,7 +674,7 @@ (define-public qtbase-5 ;; libGL (substitute* "src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp" (("^\\s*(QLibrary lib\\(QLatin1String\\(\")(GL\"\\)\\);)" _= a b) - (string-append a (assoc-ref inputs "mesa") "/lib/lib" b))) + (string-append a (assoc-ref inputs "libglvnd") "/lib/lib" = b))) ;; libXcursor (substitute* "src/plugins/platforms/xcb/qxcbcursor.cpp" (("^\\s*(QLibrary xcursorLib\\(QLatin1String\\(\")(Xcursor\"\\), 1\\);)" _ a b) diff --git a/gnu/packages/tor-browsers.scm b/gnu/packages/tor-browsers.scm index 6bc1ef5328..d065becb69 100644 --- a/gnu/packages/tor-browsers.scm +++ b/gnu/packages/tor-browsers.scm @@ -661,7 +661,7 @@ (define (runpaths-of-input label) (file-append (this-package-input label) "/lib")) '("libpng-apng" "libxscrnsaver" - "mesa" + "libglvnd" "pciutils" "mit-krb5" "eudev" diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 1d2ab5fbeb..321ec16a5c 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -4065,8 +4065,9 @@ (define-public obs (,(string-append #$(this-package-input "vlc") "/lib") ;; TODO: Remove this once our mesa has glvnd support= . - ,(string-append #$(this-package-input "mesa") - "/lib")))))))))) +;; ,(string-append #$(this-package-input "mesa") +;; "/lib") + ))))))))) (native-search-paths (list (search-path-specification (variable "OBS_PLUGINS_DIRECTORY") diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.= scm index bfca5885c6..01c731352a 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -2206,7 +2206,7 @@ (define-public looking-glass-client (string-append input "/lib"))) '("gmp" "libxi" "nettle" - "mesa" + "libglvnd" "wayland" "fontconfig-minimal" "freetype" On Sun, Oct 6, 2024 at 3:31=E2=80=AFPM aurtzy <aurtzy@HIDDEN> wrote: > > Hi! > > I've been looking further into adding libglvnd support to mesa, following= recent > discussions on mesa updates [1]. There is a reportedly working version b= y The > Man [2] which does so by unionizing libglvnd and mesa files, but with the > suggestion to try a libglvnd-as(-propagated)-input approach first, the re= st of > this message will focus on working towards that. Relevant parties from t= he > previous discussion have been CCed. > > Context as I understand it: Adding libglvnd as an input to mesa causes me= sa to > build without some/all lib*.so files that it usually has because libglvnd > becomes the package that will have them. This means that if a package wi= th mesa > as a dependency employs any code that assumes libraries in mesa > (e.g. =3D(string-append (assoc-ref inputs "mesa") "/lib/libGL.so")=3D), t= he build > fails. This appears to be the main issue. > > I devised a script to find all the packages that probably need fixing. I= t is > included at the end of this message. I cross-checked its coverage with > consult-grep from emacs-consult (search phrase: =3Dmesa lib=3D), which do= esn't seem > to reveal any other packages that would need changes, but I'm not sure if > there's a better way to validate this without going through what seems li= ke a > /lot/ of packages with mesa as a transitive input. > > The script outputs the following packages that may need to be changed: > > --8<---------------cut here---------------start------------->8--- > gnu/packages/virtualization.scm:2133:2 "looking-glass-client" > gnu/packages/video.scm:4030:2 "obs" > gnu/packages/tor-browsers.scm:203:2 "torbrowser" > gnu/packages/qt.scm:450:2 "qtbase" > gnu/packages/python-xyz.scm:25513:4 "python-glcontext" > gnu/packages/python-xyz.scm:25441:2 "python-pyopengl" > gnu/packages/perl.scm:8504:2 "perl-opengl" > gnu/packages/music.scm:1122:2 "extempore" > gnu/packages/librewolf.scm:218:2 "librewolf" > gnu/packages/gnuzilla.scm:709:2 "icecat-minimal" > gnu/packages/gl.scm:746:2 "guile-opengl" > gnu/packages/gl.scm:1207:2 "glmark2" > gnu/packages/chromium.scm:484:2 "ungoogled-chromium" > --8<---------------cut here---------------end--------------->8--- > > Should we consider adjusting variable names as well? I have noticed GL > libraries are sometimes assigned to e.g. "mesa-lib", but they will no lon= ger be > part of mesa if libglvnd support is enabled (an alternative name could be > "gl-lib"). While this is more "cosmetic" and applies to a larger number = of > packages, I wonder if it might be a point of confusion for readers. See > libepoxy and its use of "mesa-lib" for an example. > > If no one's already started work or wants to take point on this, I should= be > able to make some time these next few weeks to write patches :) > > The mentioned script: > > --8<---------------cut here---------------start------------->8--- > #!/usr/bin/env -S guix repl -- > !# > > (use-modules (gnu) > (guix) > (guix diagnostics) > (guix records) > (ice-9 match) > (srfi srfi-1) > (srfi srfi-26)) > > (define (sexp-contains sexp predicate) > "Call (PREDICATE S-EXPRESSION) on every node of SEXP (recursively), an= d return > the predicate value on the first instance that it is non-false. If none = of the > nodes satisfy the predicate, return false." > (define (%sexp-contains sexp rest-sexps) > (match sexp > ((=3D predicate (and (not #f) return-value)) > return-value) > ((child rest-children ...) > (%sexp-contains child (append rest-children rest-sexps))) > (else > (match rest-sexps > ((next-sexp rest-sexps ...) > (%sexp-contains next-sexp rest-sexps)) > (else > #f))))) > (%sexp-contains sexp '())) > > (define (sexp-at-location filename line column) > "Return the next s-expression after LINE and COLUMN (both one-indexed)= in > FILENAME." > (call-with-input-file filename > (lambda (port) > (go-to-location port line column) > (read port)))) > > (define (relevant-package? package) > "Return whether PACKAGE is a potentially relevant package." > (->bool > (and (any (match-lambda > (("mesa" _ ...) #t) > ((? package? (=3D package-name "mesa")) #t) > (else #f)) > (package-transitive-inputs package)) > (and=3D> (sexp-contains (match (package-location package) > (($ <location> file line column) > (sexp-at-location file line (1+ column)= ))) > (lambda (sexp) > (and (list? sexp) > (match (memq #:phases sexp) > ((#:phases phases _ ...) phases) > (else #f))))) > (lambda (phases-sexp) > ;; Use the following conditions to determine if the > ;; package does stuff with mesa libraries. > (and (sexp-contains phases-sexp > (lambda (sexp) > (and (string? sexp) > (string-contains sexp "lib")= ))) > (or (sexp-contains phases-sexp > (lambda (sexp) > (and (symbol? sexp) > (eq? sexp 'mesa)))) > (sexp-contains phases-sexp > (lambda (sexp) > (and (string? sexp) > (string-contains sexp > "mesa"))))))))))) > > (define (main . _) > "Run this in the top level of the guix repository with \"./pre-inst-en= v\"." > (format #t "Relevant packages:\n\n") > (for-each > (lambda (package) > (match (package-location package) > (($ <location> file line column) > (format #t "~a:~a:~a ~s\n" > file > line > column > (package-name package))))) > (fold-packages > (lambda (package result) > (if (relevant-package? package) > (cons package result) > result)) > '()))) > > (main) > --8<---------------cut here---------------end--------------->8--- > > [1] https://issues.guix.gnu.org/73071#12 > > [2] https://issues.guix.gnu.org/73071#13 > > Cheers, > > aurtzy
guix-patches@HIDDEN
:bug#73668
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 6 Oct 2024 20:31:36 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 06 16:31:36 2024 Received: from localhost ([127.0.0.1]:42479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sxXuh-0007Qh-Vg for submit <at> debbugs.gnu.org; Sun, 06 Oct 2024 16:31:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:56808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <aurtzy@HIDDEN>) id 1sxXuf-0007QY-GE for submit <at> debbugs.gnu.org; Sun, 06 Oct 2024 16:31:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <aurtzy@HIDDEN>) id 1sxXuY-00082r-Qd for guix-patches@HIDDEN; Sun, 06 Oct 2024 16:31:26 -0400 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <aurtzy@HIDDEN>) id 1sxXuT-0005in-Gp for guix-patches@HIDDEN; Sun, 06 Oct 2024 16:31:23 -0400 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7a9ae0e116cso392916285a.1 for <guix-patches@HIDDEN>; Sun, 06 Oct 2024 13:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728246679; x=1728851479; darn=gnu.org; h=content-transfer-encoding:subject:cc:content-language:to:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=9mVqiXkIrREjQ+nm4z38TIb2873uXv96aEMa4yO8HWM=; b=FfwHE7Ms6Qzp0o9Wa6IjymE34tL68miB0DWZKV/OPgTnT+AcpvwtGKc7BixyrqwgtG iwp4CeqEGSdGGmy6TlQR9qofTv6Kp2AUPD/+YFT9G57Si0FZR3Sx+dR/dQWFrdod5Wha /GHNHuhtnHKIVa07/RkBLXn3WEC18A21GM7HCUY1jSg1HfxQUjKRkPNly5Ys2JndIb5K DMIOZmKzGJ7AvlUx3rcML0J+u0gjMx6985Xtqqd8tGn5U+NXD49w3e5LXpCph7nvA5KH 8KtKHbChiCJAfsfEZqNLQ/AwVLgiSc6CrcAaLckYqP+oPyyfqsd/hlL70FrNw+t3Nwvb iE9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728246679; x=1728851479; h=content-transfer-encoding:subject:cc:content-language:to:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9mVqiXkIrREjQ+nm4z38TIb2873uXv96aEMa4yO8HWM=; b=WjPvleqFoitfASan7QTF6gDIr9D9KbcyNu84mdSJ/MVDZxiEMm0mS7fgqCpuHESe7z RpDCnhZpOVSahaEtpkBE0iYALCwksgWv48D1bdTPKZ93OX/bFNvQRmbQa8zB+Kg6jdxR 4v0eQdQBVJNFcInVPJ93ANLTl5H5/5kYAxZqXqExyuO5eN8yIRiPRpTVowHYR2j24ly3 OJpQPbgen37DQpALnvB4Ksooj6HwjCKE6w4BEfzFIXXvSA0I2o3s/9cpmmh9VWLZT9MM fViB5pnGIGkrRFj1N02olhre0SZ2VnkQOgM0Hz2DSfsATEEpJCYqZq07LNUtjRPGovmh NOLQ== X-Gm-Message-State: AOJu0YyfiM3jblgMpbgtCMqTAzIc0eyyXufHX2v3Xwi29VU5LJLuyLXX VZ/aYdTWKi/uuMgUbhzk60FsO36RGYe7B8X5Bw+pI3T6ROpRmOSTHchTMQ== X-Google-Smtp-Source: AGHT+IE+UF31ucDeC51o002a+e8JDnbxp176tuAjtwLrIWLKzR9QF5FoF+DSbriAvQGcQFj2NuF1cw== X-Received: by 2002:a05:620a:bc6:b0:7a9:b856:41d with SMTP id af79cd13be357-7ae6f48ace8mr1680257885a.48.1728246679248; Sun, 06 Oct 2024 13:31:19 -0700 (PDT) Received: from ?IPV6:2600:4808:a053:7600::e413? ([2600:4808:a053:7600::e413]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ae7561642esm191219385a.12.2024.10.06.13.31.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Oct 2024 13:31:18 -0700 (PDT) Message-ID: <726317c4-cc33-42be-af55-69bea3010a68@HIDDEN> Date: Sun, 6 Oct 2024 16:31:17 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: aurtzy <aurtzy@HIDDEN> To: guix-patches@HIDDEN Content-Language: en-US Subject: libglvnd support in mesa Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::735; envelope-from=aurtzy@HIDDEN; helo=mail-qk1-x735.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: John Kehayias <john.kehayias@HIDDEN>, squishypinkelephant@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) Hi! I've been looking further into adding libglvnd support to mesa, following recent discussions on mesa updates [1]. There is a reportedly working version by The Man [2] which does so by unionizing libglvnd and mesa files, but with the suggestion to try a libglvnd-as(-propagated)-input approach first, the rest of this message will focus on working towards that. Relevant parties from the previous discussion have been CCed. Context as I understand it: Adding libglvnd as an input to mesa causes mesa to build without some/all lib*.so files that it usually has because libglvnd becomes the package that will have them. This means that if a package with mesa as a dependency employs any code that assumes libraries in mesa (e.g. =(string-append (assoc-ref inputs "mesa") "/lib/libGL.so")=), the build fails. This appears to be the main issue. I devised a script to find all the packages that probably need fixing. It is included at the end of this message. I cross-checked its coverage with consult-grep from emacs-consult (search phrase: =mesa lib=), which doesn't seem to reveal any other packages that would need changes, but I'm not sure if there's a better way to validate this without going through what seems like a /lot/ of packages with mesa as a transitive input. The script outputs the following packages that may need to be changed: --8<---------------cut here---------------start------------->8--- gnu/packages/virtualization.scm:2133:2 "looking-glass-client" gnu/packages/video.scm:4030:2 "obs" gnu/packages/tor-browsers.scm:203:2 "torbrowser" gnu/packages/qt.scm:450:2 "qtbase" gnu/packages/python-xyz.scm:25513:4 "python-glcontext" gnu/packages/python-xyz.scm:25441:2 "python-pyopengl" gnu/packages/perl.scm:8504:2 "perl-opengl" gnu/packages/music.scm:1122:2 "extempore" gnu/packages/librewolf.scm:218:2 "librewolf" gnu/packages/gnuzilla.scm:709:2 "icecat-minimal" gnu/packages/gl.scm:746:2 "guile-opengl" gnu/packages/gl.scm:1207:2 "glmark2" gnu/packages/chromium.scm:484:2 "ungoogled-chromium" --8<---------------cut here---------------end--------------->8--- Should we consider adjusting variable names as well? I have noticed GL libraries are sometimes assigned to e.g. "mesa-lib", but they will no longer be part of mesa if libglvnd support is enabled (an alternative name could be "gl-lib"). While this is more "cosmetic" and applies to a larger number of packages, I wonder if it might be a point of confusion for readers. See libepoxy and its use of "mesa-lib" for an example. If no one's already started work or wants to take point on this, I should be able to make some time these next few weeks to write patches :) The mentioned script: --8<---------------cut here---------------start------------->8--- #!/usr/bin/env -S guix repl -- !# (use-modules (gnu) (guix) (guix diagnostics) (guix records) (ice-9 match) (srfi srfi-1) (srfi srfi-26)) (define (sexp-contains sexp predicate) "Call (PREDICATE S-EXPRESSION) on every node of SEXP (recursively), and return the predicate value on the first instance that it is non-false. If none of the nodes satisfy the predicate, return false." (define (%sexp-contains sexp rest-sexps) (match sexp ((= predicate (and (not #f) return-value)) return-value) ((child rest-children ...) (%sexp-contains child (append rest-children rest-sexps))) (else (match rest-sexps ((next-sexp rest-sexps ...) (%sexp-contains next-sexp rest-sexps)) (else #f))))) (%sexp-contains sexp '())) (define (sexp-at-location filename line column) "Return the next s-expression after LINE and COLUMN (both one-indexed) in FILENAME." (call-with-input-file filename (lambda (port) (go-to-location port line column) (read port)))) (define (relevant-package? package) "Return whether PACKAGE is a potentially relevant package." (->bool (and (any (match-lambda (("mesa" _ ...) #t) ((? package? (= package-name "mesa")) #t) (else #f)) (package-transitive-inputs package)) (and=> (sexp-contains (match (package-location package) (($ <location> file line column) (sexp-at-location file line (1+ column)))) (lambda (sexp) (and (list? sexp) (match (memq #:phases sexp) ((#:phases phases _ ...) phases) (else #f))))) (lambda (phases-sexp) ;; Use the following conditions to determine if the ;; package does stuff with mesa libraries. (and (sexp-contains phases-sexp (lambda (sexp) (and (string? sexp) (string-contains sexp "lib")))) (or (sexp-contains phases-sexp (lambda (sexp) (and (symbol? sexp) (eq? sexp 'mesa)))) (sexp-contains phases-sexp (lambda (sexp) (and (string? sexp) (string-contains sexp "mesa"))))))))))) (define (main . _) "Run this in the top level of the guix repository with \"./pre-inst-env\"." (format #t "Relevant packages:\n\n") (for-each (lambda (package) (match (package-location package) (($ <location> file line column) (format #t "~a:~a:~a ~s\n" file line column (package-name package))))) (fold-packages (lambda (package result) (if (relevant-package? package) (cons package result) result)) '()))) (main) --8<---------------cut here---------------end--------------->8--- [1] https://issues.guix.gnu.org/73071#12 [2] https://issues.guix.gnu.org/73071#13 Cheers, aurtzy
aurtzy <aurtzy@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#73668
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.