-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glfw: Use libglvnd on FreeBSD and Linux #23439
Conversation
🤖 Beep Boop! This pull request is making changes to 'recipes/glfw//'. 👋 @Hopobcn you might be interested. 😉 |
I detected other pull requests that are modifying glfw/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This comment has been minimized.
This comment has been minimized.
The libglvnd package provides the necessary opengl/system dependency. The libglvnd package is a proper, non-system Conan package.
Conan v1 pipeline ✔️All green in build 2 (
|
Hi @jwillikers - thank you for opening this PR. We'd like to understand the motivation better, as well as any potential implications. As far as I'm aware, |
@jcar87 That's exactly the problem, it's a system Conan package. Why use a system Conan package when a we have a proper Conan package that builds the library from source? My understanding is that system packages are primarily an escape-hatch when we don't have or want a proper Conan package, like in the case of X11. The system Conan packages have multiple problems, including that they don't support cross-compilation for a system like Yocto and that they need to be manually removed and rebuilt after a major distribution upgrade, i.e. Ubuntu 20.04 to Ubuntu 22.04. If we should instead use the I'm not sure that there are any major implications. We're just using a version of |
This is not correct, although I can see why this can be confusing. It is perfectly feasible to build all of X11 from source in a Conan recipe. And at "build" time, all consumer packages would build against this version perfectly fine. The problem comes from runtime: if the version of the X11 shared libraries from Conan is different than the X server running on the system - things may not work well, especially if the Conan package is in a newer version. The applications need to talk to the server running on the host machine - the server is going to be the exact version from the system, as it is a single program running. I believe that at this stage the application (and its libraries) talk to the server via the X protocol, so we have different layers of compatibility:
I suspect the reason we don't have x11 built from source in Conan is precisely to guarantee these two compatibilities without mismatches:
these two things make graphical GUIs work when built from Conan, as far as I understand. If these assumptions are not correct, I'd be happy to start maintaining a recipe for x11 from source, and finally solve those issues :) - my concern is that if the recipes depend on "too new x11 runtime", there may be issues running them on older distros that people still use. As for
So we need to ensure that:
As it stands, because I'm particularly concerned about the compile-time setting of the configuration directory that then the runtime searches for implementations - is it always at That's why in some scenarios we prefer system versions rather than conan packages:
|
Side notes:
We probably should have a versioned, built-from-source recipe for x11 to cover for cases like this. When there is not an expectation of running anything, and x11 is already not provided by the system - it's perfectly sensible to provide it ourselves. This would also apply to x11 on macOS and Windows, if needed
what would need to be force-rebuilt? conan packages that were built against a previous version of the x11 headers/libraries? This should not be necessary, as far as I'm aware: x11 is probably one of the most backwards compatible libraries out there, something built against an older version should run on a system that is running a newer version - I'd be happy to look into a reproducible example where this isn't the case. |
@jcar87 Fyi, you probably want to reference links to the true First, I'll point out that I'm very confused why we only use X11 as a system package then. As I've been doing this, I've been following what we do for the Wayland and Vulkan packages. I think that Vulkan and libglvnd use a similar runtime loading mechanism, which would mean that it might have similar concerns, right? It's very likely that containers, containerized application deployments like snap and Flatpak, and package-mangers like Nix run into some similar concerns. For instance, the Freedesktop Flatpak packages its own version of Looking at the On the needing to rebuild system packages, that's referring to the need to rebuild the system packages in the Conan cache to update the information retrieved from the pkg-config files. I can open a separate issue if/when I hit this again. |
Historical speaking, system packages have been an escape hatch, when proper Conan packages were not working, either because a lack of resources on our hands or because it might not be feasible in general. The goal was to get rid of system packages as soon as possible, if it is possible at all (similar with Conan packages that re-package downloaded binaries). In Bincrafters we had several x11 related packages, but they never really worked at runtime |
It does appear that the |
Thanks for providing the historical context!!
I'm not surprised! I think it can be made to work, but it tends to be unusual to bundle a completely separate x11 stack - you eventually want apps to talk to the instance running on the host machine.
This confirms my suspicions - merging these PRs would have actually broken things had we not identified that. I think until we are able to clarify things and ensure things work, it's best to put these on hold. I've opened an issue to track this to continue the discussion: #23649. I don't have concerns about recipes building, and I don't have concerns about executables launching: I have concerns about the libraries in the conan package not being able to interface correctly with the X server on the machine, or the underlying hardware. The problem is that this can only truly be tested with built GUI applications that make use of OpenGL - this is not something that can be tested by our CI and I'm not seeing evidence that this has been tested more widely.
IIRC for Snap, x11 was one of those things you did not include in your dependencies like other isolated libraries - but my knowledge on this may be updated. With Docker, you need to specify at least the socket, with I think also may vary from system to system? That is, it may be entirely possible to have both x11 and libgl[vnd] libraries in Conan, and get it to work correctly
We want to avoid a situation where we go from something that works without further fiddling, to something that may work or something that may require users to define that environment variable.
You'll find that other package managers with a problem space similar to Conan follow a similar approach.
Given the concerns, and the fact that I cannot find any evidence that this approach being used by package managers with similar constraints, I'd rather err on the side of caution - if what we have currently works - I would only move forward if we can prove that what is being proposed will work without friction on the widest possible set of Linux distros (including Raspberry Pi and NVIDIA Jetson). Closing this with the intention of following the conversation and investigation at #23649 |
The libglvnd package provides the necessary opengl/system dependency. The libglvnd package is a proper, non-system Conan package.