Page MenuHomeFreeBSD

Made proxydeps to treat lib/libGL-NVIDIA.so and 2 friends as part of GL
ClosedPublic

Authored by yuri_rawbw.com on Aug 11 2017, 5:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 12:42 AM
Unknown Object (File)
Mon, Dec 2, 11:13 PM
Unknown Object (File)
Nov 20 2024, 5:05 AM
Unknown Object (File)
Nov 20 2024, 5:05 AM
Unknown Object (File)
Nov 20 2024, 5:05 AM
Unknown Object (File)
Nov 20 2024, 5:05 AM
Unknown Object (File)
Nov 19 2024, 5:20 PM
Unknown Object (File)
Nov 19 2024, 7:26 AM

Details

Summary

On systems where OpenGL is implemented via the NVidia driver, stage-qa fails to print this warning:

Warning: you need USE_GL+=gl

The attached patch corrects this.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221406

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Updated to match 3 NVidia GL libraries.

yuri_rawbw.com retitled this revision from Made proxydeps to treat lib/libGL-NVIDIA.so as part of GL to Made proxydeps to treat lib/libGL-NVIDIA.so and 2 friends as part of GL.Aug 20 2017, 11:14 PM
mat requested changes to this revision.Aug 21 2017, 1:02 PM

dep_file is supposed to be immutable. Do not modify it .

This revision now requires changes to proceed.Aug 21 2017, 1:02 PM
In D11977#250961, @mat wrote:

dep_file is supposed to be immutable. Do not modify it .

The only way to do this is to first create another variable, say dep_file_str, and then, at this location, assign dep_file and add the 'else' clause.

This adds 2 more lines, and another variable that isn't going to be immutable either.

Are you sure this should be really done? Because nonimmutability doesn't really hurt anything in this case.

@mat Can this be committed? This bites everyone with the nvidia driver installed.

Could you provide a test case ?

In D11977#279697, @mat wrote:

Could you provide a test case ?

Steps to reproduce:

  1. Install x11/nvidia-driver
  2. In graphics/togl, comment out USE_GL=gl and run make && make stage-qa
  3. Observe the wrong warning: Warning: you need LIB_DEPENDS+=libGL-NVIDIA.so:x11/nvidia-driver

With the attached patch the warning turns into the correct one: Warning: you need USE_GL+=gl

No, I can't seem to be able to reproduce the issue in poudriere, there are no ports that depend on nvidia-driver that I can find.

I'll let another portmgr member decide what to do with this.

In D11977#282219, @mat wrote:

No, I can't seem to be able to reproduce the issue in poudriere, there are no ports that depend on nvidia-driver that I can find.

I'll let another portmgr member decide what to do with this.

there are no ports that depend on nvidia-driver: What are you talking about? Of course there are no ports that depend on nvidia-driver! nvidia-driver is installed on systems that have nvidia card. This just doesn't apply to poudriere. This is *only* a problem of local builds. When I run make stage-qa, it always prints this bogus warning. I have to always remember that this bogus warning is the same as USES=gl. This is ridiculous, this should just go away. There are more important things to remember.

Please run the above steps locally and reproduce the problem.

I do get the same message when building ports locally, but I have just
ignored it all the time, because in Poudriere it obviously doesn't
happen.

x11/nvidia-driver install a libmap.conf that maps libGL to
libGL-NVIDIA, so maybe the fix should rather be to set the
LD_LIBMAP_DISABLE environment variable before running ldd in qa.sh
instead of mapping libGL-NVIDIA back to libGL via sed.

diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index 868043601a92..87f2b23d689b 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -677,7 +677,7 @@ proxydeps() {
                        fi
                        already="${already} ${dep_file}"
                done <<-EOT
-               $(ldd -a "${STAGEDIR}${file}" | \
+               $(env LD_LIBMAP_DISABLE=1 ldd -a "${STAGEDIR}${file}" | \
                        awk '\
                        BEGIN {section=0}\
                        /^\// {section++}\

I do get the same message when building ports locally, but I have just
ignored it all the time, because in Poudriere it obviously doesn't
happen.

x11/nvidia-driver install a libmap.conf that maps libGL to
libGL-NVIDIA, so maybe the fix should rather be to set the
LD_LIBMAP_DISABLE environment variable before running ldd in qa.sh
instead of mapping libGL-NVIDIA back to libGL via sed.

diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index 868043601a92..87f2b23d689b 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -677,7 +677,7 @@ proxydeps() {
                        fi
                        already="${already} ${dep_file}"
                done <<-EOT
-               $(ldd -a "${STAGEDIR}${file}" | \
+               $(env LD_LIBMAP_DISABLE=1 ldd -a "${STAGEDIR}${file}" | \
                        awk '\
                        BEGIN {section=0}\
                        /^\// {section++}\

Yes LD_LIBMAP_DISABLE is imho the way to go as it will work for all libmap cases. While the propose approach is only working for nvidia case

This revision was not accepted when it landed; it landed in state Needs Revision.Dec 15 2017, 3:56 PM
This revision was automatically updated to reflect the committed changes.