Created attachment 191260 [details] x11/nvidia-driver/Makefile - libGL.so, libEGL.so, libGLESv2.so rename fix I have found a problem in the Makefile of the nvidia-driver package. At the end of processing, the files are renamed as follows: ${MV} -f ${STAGEDIR}${PREFIX}/lib/libGL.so \ ${STAGEDIR}${PREFIX}/lib/libGL-NVIDIA.so Ok, no name conflicts. That's nice. However, we also have a libmap setting that looks like this: libGL.so libGL-NVIDIA.so libGL.so.1 libGL-NVIDIA.so.1 Which means that anyone accessing libGL,so actually accesses libGL-NVIDIA.so. However, since the directive in the makefile was a move, libGL-NVIDIA.so, which is a symbolic link, will remain pointing at libGL.so.1. Now, libmap only does simple translation (see libmap.c under src/libexec/rtld-elf) and does not follow any symbolic link paths in the filesystem because at the time of translation, only the name of the library - not its actual location - is known. Unfortunately this means any program linking to libGL.so directly will try to load libGL-NVIDIA.so, and then follow the symbolic link to libGL.so.1 and then that symbolic link to libGL.so.1.2.0. Thus, any program linking against libGL.so as opposed to libGL.so.1 will not work since Nvidia and Mesa GL implementations obviously do not mix. I propose changing the directive in the makefile to: ${LN} -sf libGL-NVIDIA.so.1 \ ${STAGEDIR}${PREFIX}/lib/libGL-NVIDIA.so This will mean that libGL-NVIDIA.so remains pointing at the same library it was supposed to point at before the rename. I have attached a patch that does this change, and then similar change to libEGL-NVIDIA.so and libGLESv2.so, so everything will work. NOTE: Most (almost all) GL programs work because they explicitly link against libGL.so.1. However, I feel also the few that use libGL.so without that extra .1 should also work.
In addition to the link, the old files should be rm (since it was move before, to not have orphaned files)
Just want to note this in case it helps someone else: I upgraded to the new GNOME 3.28 packages today and I believe gdm/gnome-session failed to start due to this issue. /var/log/gdm/:0-greeter.log showed these errors: libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast (gnome-shell:1792): Clutter-CRITICAL **: 07:30:09.088: Unable to initialize Clutter: Unable to initialize the Clutter backend: no available drivers found. After applying the Makefile patch attached to this bug I rebuilt the nvidia-driver port and GNOME is now working.
Same for me as well, this fixed the issue I reported in PR 231875.
(In reply to Thibault Payet from comment #1) Tatu, can you regenerate the patch to resolve the problem with orphaned files (as detected by 'make check-plist'): ===> Checking for items in STAGEDIR missing from pkg-plist Error: Orphaned: lib/libEGL.so Error: Orphaned: lib/libGL.so Error: Orphaned: lib/libGLESv2.so Other than that, the patch seems right to me. Maintainer timeout?
Created attachment 197917 [details] x11/nvidia-driver/Makefile - updated patch (r2) Insofar I can see, since this file is not supposed to provide libGL.so, libEGL.so or libGLESv2.so, the Makefile should remove them from staging. This updated patch should fix the pkg-plist discrepancy.
(In reply to Tatu Kilappa from comment #5) Yes, something like that update (that removes the link) works fine. Can you set the maintainer-approval flag for the patch to '?'? I'd also mark reve 1 of the patch obsolete.
Don't see a way to mark r1 of the patch obsolete, but I marked r2 as '?'.
A commit references this bug: Author: tijl Date: Fri Jan 18 17:53:00 UTC 2019 New revision: 490643 URL: https://svnweb.freebsd.org/changeset/ports/490643 Log: Recreate symlinks instead of renaming them, so they point to the right file. PR: 226403 Submitted by: Tatu Kilappa <tatu.kilappa@iki.fi> Approved by: maintainer timeout (10 months) Changes: head/x11/nvidia-driver/Makefile head/x11/nvidia-driver-304/Makefile head/x11/nvidia-driver-340/Makefile
*** Bug 234876 has been marked as a duplicate of this bug. ***
*** Bug 231875 has been marked as a duplicate of this bug. ***
A commit references this bug: Author: tijl Date: Fri Jan 18 17:59:42 UTC 2019 New revision: 490644 URL: https://svnweb.freebsd.org/changeset/ports/490644 Log: MFH: r490643 Recreate symlinks instead of renaming them, so they point to the right file. PR: 226403 Submitted by: Tatu Kilappa <tatu.kilappa@iki.fi> Approved by: ports-secteam (blanket) Changes: _U branches/2019Q1/ branches/2019Q1/x11/nvidia-driver/Makefile branches/2019Q1/x11/nvidia-driver-304/Makefile branches/2019Q1/x11/nvidia-driver-340/Makefile