libGL: use headers from glvnd#118479
Conversation
|
Mmmh, gtk3 no longer builds after rebasing to staging.. |
|
There's quite a few packages that depend on mesa because require libgbm. This is still a bit of a problem because EDIT: this has been fixed in the meantime. mesa.dev no longer depends on mesa.drivers. |
|
Result of 663 packages marked as broken and skipped:
2 packages failed to build:
8248 packages skipped due to time constraints:
82 packages built successfully:
11 suggestions:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
b5b8632 to
0674348
Compare
|
I've now also added a commit that breaks the dependency of mesa.dev on mesa.drivers. Packages that use libxatracker now need to depend on mesa.driversdev. (AFAICT this library is almost unused.) |
primeos
left a comment
There was a problem hiding this comment.
Overall the diff and idea LGTM but I have trouble to properly review this in terms of (potential) breakages.
IMO the libGL and mesa commits should also have a description that explains the rationale, impact, etc. (like "Motivation for this change" for this PR) so that that information doesn't get lost (should be in the Git history too). Depending on how long this takes to review we could also merge (some of) the other commits independently or split them into a separate PR.
There was a problem hiding this comment.
That self part looks a bit strange to me. IIRC it should also be possible to add mesa to the arguments and use:
| disallowedRequisites = [ llvmPackages.llvm self.drivers ]; | |
| disallowedRequisites = [ llvmPackages.llvm mesa.drivers ]; |
Not sure what's better though...
There was a problem hiding this comment.
In that case I think you need to be more careful with overriding, passing the overridden version in.
There was a problem hiding this comment.
A dedicated output (driversdev) for just xatracker.pc seems a bit strange to me. The name of the output is a bit misleading, the actual xatracker headers are in the dev output (I assume), and this part is difficult to review as we don't know which packages this might break (without running a full nixpkgs-review).
There was a problem hiding this comment.
This is the other part that's difficult to review. I haven't diffed mesa.dev and libglvnd.dev (yet) but if mesa.dev provides additional (or even just slightly different headers, e.g. due to older versions - wich seems very likely) this could potentially cause a lot of breakages (and due to the version change alone). Is there any official documentation for this and do we know what other distros do?
|
@vcunat what's your opinion on this?
I was wondering about that too. Two additional Mesa outputs certainly have a cost in terms of complexity but then again a separate |
Ok, I'll add a rationale to the commit messages.
I don't think there is any subset of this PR that can be reviewed more easily. Both the mesa and libglvnd changes affect every package that depends on opengl. The other commits just fix the resulting issues.
I'm happy for suggestions on how to better test this PR. Rebuilding almost all of nixpkgs locally is probably not feasible.
I would not expect any issues here. If you use the nonfree nvidia drivers, you also compile against different headers (i.e., compile against mesa and link against nvidia). That seems to work well. Also note that we link applications against libglvnd, not mesa. Even if the mesa headers provided more functions, applications couldn't use them because they don't exist in the libglvnd library.
This was the easiest way to untangle the dependencies. The Would you prefer to move the |
|
First, defaulting to generic headers instead of mesa's was on my wishlist long ago already, so I do like that – at least in principle, but the risks didn't seem high at a glance. One advantage is that after that mesa will become relatively cheap to update normally (directly in nixpkgs master). E.g. on top of your current PR a mesa update does:
We can have a Hydra jobset for this branch. I can set it up myself when you think it's a good moment. I hope most issues would be visible as build failures.
I still feel like missing something here. Why do the packages retain (transitive) dependency to |
It's indeed a mistake, albeit a regular one: see #98755 for another recent case. You also need to dev output to compile C programs that use mesa as a dependency. It's nice if you don't have to download (unused) mesa drivers and a (second) copy of LLVM for that.
I'm not sure if we should also move the headers to the driversdev output (instead of just the pkg-config file). Aside from that, I'd say this is PR is ready. |
|
@vcunat I've rebased the PR to staging and moved the corresponding headers to the driversdev output as well. I think it would be a good time for the hydra jobset now. |
|
I hope it won't hit many issues that are regressions in |
|
I've fixed all the new failures (compared to master) that seem to be mesa-related. |
It's probably fallout from PR #118479
It's probably fallout from PR #118479. Whole `mate` builds for me now.
autoPatchelf wasn't finding some libraries anymore. It was probably fallout from PR #118479.
Motivation for this change
Currently, libGL depends on the dev output of mesa, which in turn depends on the mesa drivers. This e.g. causes many programs to include all mesa drivers in their closure: #118410
This PR changes the libGL stub to use the GL headers from libglvnd instead, thus removing the mesa build dependency.
See also #44831 and #100712 (this does not completely solve the mesa issue, since some packages still need to depend on mesa directly)
I've quickly built and tested a few packages and could not find any regressions: alacritty, blender, chromium (still references mesa though), mpv (also references mesa)
Suggestions for other packages to test are welcome (i.e., what do you expect to break).
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)