-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
Tracking issue: mesa on darwin #233265
Comments
Seems unmaintained upstream, both the backend and the library, and the feature set is already covered by other backends. Removes a Mesa dependency, which is especially relevant in light of NixOS#233265.
In #233220 we have removed the 22.3 version, marked mesa as broken on darwin, and removed some key dependents. Help is welcome for upstream fixes to unbreak mesa (upstream issue), and removing further unnecessary dependents. |
I saw this come up in the Mesa discussion. I’d like to look at it (though I don’t think Mesa should be built on Darwin, so I’d be looking at how to remove it as a dependency where possible), but I’m currently focused on the LLVM update for the Darwin stdenv (now tracked at #234710). |
This is a hacky patch I put together that provides OpenGL.framework and a pkg-config wrapper for OpenGL.framework. I was able to build libGLU with it as well as a few Linux-only derivations. Anything that expects GLX (like FreeGLUT) won’t work. Not sure if this is the solution, but it does at least take mesa out of the picture. |
I would like to go the opposite direction and enable mesa on darwin again. There are quite a few packages that depend on this, I'm specifically looking at python packages that do rendering with libGL and rely on pyglet, moderngl or screeninfo for that. Granted those are marked broken on darwin right now as well, but I would like to fix that, and if mesa is removed from nixpkgs, that would bar me from doing that work. I'm uncertain if it's easily possible to build libGL for darwin separately, but that might be useful in its own right. @yu-re-ka you meantioned in the other ticket:
do you still have the code for that? |
Those packages don’t require Mesa. They support Darwin upstream and should be able to link against the system OpenGL.framework. I was able to build moderngl and pyglet but not screeninfo using the patch I linked in my previous reply. See below for details. Note: Darwin was added to
|
I see, thank you for the explanation. I'd be willing to try and turn this into a less hacky solution that is fit to be merged. If you'd rather make these changes yourself (which honestly might be quicker), I'd be happy to review and test them. |
The I think it would be great to have packages generally depend on something that supplies the native GL implementation rather than |
I agree with the above, though I’d like to see libGL provide OpenGL.framework instead of using Mesa at all on Darwin. I doubt anything that supports Darwin is going to try to use OpenGL ES there since it’s never been supported. |
I’m already pretty focused on the Darwin stdenv stuff, so I’d like to defer to the maintainers for any fixes to the libGL situation. The patch I proposed is one solution, but I don’t know if it would be the preferred one. |
@reckenrode how can I apply your patch to my nix home-manager? I'm not too familiar with the internal workings on home-manager, but it seems i cant start nix home manager due to this issue |
I replied in the reddit thread, but I’ll also reply here. I applied the patch and copied the resulting derivation into an overlay. https://gist.github.com/reckenrode/dc4fb6bbcec0384a9dd3917e5af24e7f |
FYI, Mesa now builds again on Darwin as of https://gitlab.freedesktop.org/mesa/mesa/-/commit/4ef573735efc7f15d8b8700622a5865d33c34bf1 AFAICT this hasn't hit a release branch yet, but with the following overlay on mesa23_3_0_main = let
inherit (final) fetchFromGitLab fetchurl lib;
version = "23.3.0-main";
hash = "sha256-kHrUNnUedCAc6uOWCHdd/2LMMcz3BAqJPcXnCbHLlaw=";
branch = lib.versions.major version;
in prev.mesa.overrideAttrs (old: {
inherit version;
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "mesa";
repo = "mesa";
rev = "4ef573735efc7f15d8b8700622a5865d33c34bf1";
inherit hash;
};
# Note that the following changes should all be conditional on Darwin; for simplicity I didn't do that in this overlay.
patches = builtins.filter (
p: let b = builtins.baseNameOf p; in
b != "opencl.patch"
&& b != "disk_cache-include-dri-driver-path-in-cache-key.patch"
) old.patches ++ [
];
mesonFlags =
(builtins.filter (f: !(lib.hasPrefix "-Ddisk-cache-key=" f)) old.mesonFlags) ++ [
"-Dgbm=disabled"
"-Dxlib-lease=disabled"
"-Degl=disabled"
"-Dgallium-vdpau=disabled"
"-Dgallium-va=disabled"
"-Dgallium-xa=disabled"
"-Dlmsensors=disabled"
];
meta = old.meta // {
broken = false;
platforms = lib.platforms.darwin;
};
}); |
Currently the situation of the mesa package on darwin is not optimal. This is because we are lugging around Mesa 22.3 just for darwin. We would like to remove Mesa 22.3 and find another solution in time for the NixOS 23.11 release cycle.
Several options were discussed in the Nixpkgs Dev matrix room:
!isDarwin
oravailableOn
if they can build without itSome common dependency chains seem to be
gtk3-x11 -> libepoxy -> libgl
andgraphviz -> libdevil -> libgl
.Anything that uses mesa on darwin is being rendered purely using the CPU using llvmpipe anyways, since mesa does not have any driver backends that work on darwin.
Probably a combination of both reducing unreasonable dependencies on mesa, and making the latest version build, would be good
CC @NixOS/darwin-maintainers
The text was updated successfully, but these errors were encountered: