libepoxy: propagate buildInputs#403479
Conversation
Some packages that depend on libepoxy fail to build due to libGL and libX11 not being present during the build. One example is `qemu_xen` (or really any QEMU built with GL support), as it's built with libepoxy, which links against libGL, but since libGL isn't present, the build fails. Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
|
Ah, i suspect this is another one of the SDL fallouts - qemu previously had libGL/libX11 as it was (incorrectly) being propagated from SDL2, and since that propagation was removed the libepoxy stuff came to light. I'll take a look tomorrow. |
There was a problem hiding this comment.
Command for checking: rg '#include' $(nix build nixpkgs#libepoxy.dev --print-out-paths)/include/epoxy
$ rg '#include' result-dev/include/epoxy
result-dev/include/epoxy/gl.h
35:#include "epoxy/common.h"
89:#include "epoxy/gl_generated.h"
result-dev/include/epoxy/egl_generated.h
6:#include <inttypes.h>
7:#include <stddef.h>
9:#include "epoxy/common.h"
10:#include "epoxy/gl.h"
11:#include "EGL/eglplatform.h"
result-dev/include/epoxy/glx.h
35:#include <epoxy/gl.h>
36:#include <X11/Xlib.h>
37:#include <X11/Xutil.h>
49:#include "epoxy/glx_generated.h"
result-dev/include/epoxy/egl.h
35:#include "epoxy/common.h"
46:#include "epoxy/egl_generated.h"
result-dev/include/epoxy/glx_generated.h
21:#include <inttypes.h>
22:#include <stddef.h>
24:#include "epoxy/common.h"
25:#include "epoxy/gl.h"
26:#include <X11/Xlib.h>
27:#include <X11/Xutil.h>
result-dev/include/epoxy/gl_generated.h
21:#include <inttypes.h>
22:#include <stddef.h>
24:#include "epoxy/common.h"
Looking at this, both libGL (for EGL includes) and libX11 (for X11 includes) seems to be required.
(no, libGL does not propagate libX11)
| buildInputs = | ||
| propagatedBuildInputs = | ||
| lib.optionals (x11Support && !stdenv.hostPlatform.isDarwin) [ | ||
| libGL |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
LordGrimmauld
left a comment
There was a problem hiding this comment.
Sorry, i am blind! I didn't catch libX11 was guarded behind the non-darwin check. Github hid that part, i hate the UI! Sorry, LGTM!
|
(these headers are on linux - i did not check on darwin, i do not have builder access there) |
|
Okay so yeah, |
LordGrimmauld
left a comment
There was a problem hiding this comment.
Alright, now having checked the darwin logic: This looks fine! I did not check this is actually a complete fix for the linked issue, but it definitely fixes a packaging bug so i believe this should be merged.
|
Okay, i just confirmed |
|
Are these dependencies always required, or only if certain optional headers are included? If the latter, they shouldn't be propagated. |
Only if The reason this exploded on We have ~220 direct users of |
|
|
|
Okay, then I guess this is fine — from what I can tell you'd basically always include the header for EGL, GLX, or WGL (Windows) to do anything useful with the library. |
|
There exists the |
|
Sidenote: the correct fix to #403483 would have been to just add diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix
index 841415a4b6e2..5d9e7dafbb50 100644
--- a/pkgs/applications/virtualization/qemu/default.nix
+++ b/pkgs/applications/virtualization/qemu/default.nix
@@ -29,6 +29,7 @@
attr,
libcap,
libcap_ng,
+ libGL,
socat,
libslirp,
apple-sdk_13,
@@ -239,6 +240,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals openGLSupport [
libgbm
libepoxy
+ libGL
libdrm
]
++ lib.optionals rutabagaSupport [ rutabaga_gfx ]But eh, propagation would catch that. |
|
What do you think about what to do? Merge this one or another fix? This is not clear to me. |
|
This is the best solution as far as I can tell. Fixing each individual package to depend on libGL when we can just propagate it from a package that already needs it. |
|
My vote is on merge, even though libGL/libX11 is technically optional. Because on linux, almost all packages will use one (or both) of the two. |
|
Thanks for merging and your work🙇 |
The underlying missing libX11 dependency was solved by NixOS#403479.
Some packages that depend on libepoxy fail to build due to libGL and libX11 not being present during the build. One example is
qemu_xen(or really any QEMU built with GL support), as it's built with libepoxy, which links against libGL, but since libGL isn't present, the build fails.Going to
stagingdue to the NixOS tests (QEMU), as well as literally everything that depends on GTK and Qt.ZHF: #403336
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.