Re: [PATCH] kselftest/alsa: add silent flag to reduce noise

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Sep 19, 2024 at 09:40:34AM GMT, Shuah Khan wrote:
> On 9/15/24 17:41, Abdul Rahim wrote:
> > When ALSA is not installed on the users system, the error:
> > 
> > "Package alsa was not found in the pkg-config search path.
> > Perhaps you should add the directory containing `alsa.pc'
> > to the PKG_CONFIG_PATH environment variable
> > Package 'alsa', required by 'virtual:world', not found"
> > 
> 
> extra line?
> 
> > is printed 3 times, which generates unnecessary noise.
> > Hence, Remove unnecessary noise using `--silence-errors` on LDLIBS
> > assignment, so the message is printed only once.
> 
> I would say this message is alerting the user that the package is missing.
> Why would you want to delete it?

I agree, but the same message is being printed 3 times

This patch makes it print only *once* !

Here's the output i'm currently seeing:
```
   CC       acct_syscall
 make[3]: Entering directory '/mnt/ubuntu/abdul_linux/mainline_dev/tools/testing/selftests/alsa'
 Package alsa was not found in the pkg-config search path.
 Perhaps you should add the directory containing `alsa.pc'
 to the PKG_CONFIG_PATH environment variable
 Package 'alsa', required by 'virtual:world', not found
 Package alsa was not found in the pkg-config search path.
 Perhaps you should add the directory containing `alsa.pc'
 to the PKG_CONFIG_PATH environment variable
 Package 'alsa', required by 'virtual:world', not found
 Package alsa was not found in the pkg-config search path.
 Perhaps you should add the directory containing `alsa.pc'
 to the PKG_CONFIG_PATH environment variable
 Package 'alsa', required by 'virtual:world', not found
 gcc  -isystem /mnt/ubuntu/abdul_linux/mainline_dev/usr/include -L/mnt/ubuntu/abdul_linux/mainline_dev/tools/testing/selftests/alsa -Wl,-rpa      th=./ -D_GNU_SOURCE=  -shared -fPIC conf.c  -lasound -lpthread -o /mnt/ubuntu/abdul_linux/mainline_dev/tools/testing/selftests/alsa/libates      t.so
 In file included from conf.c:18:
 alsa-local.h:11:10: fatal error: alsa/asoundlib.h: No such file or directory
    11 | #include <alsa/asoundlib.h>
       |          ^~~~~~~~~~~~~~~~~~
 compilation terminated.
 make[3]: *** [Makefile:24: /mnt/ubuntu/abdul_linux/mainline_dev/tools/testing/selftests/alsa/libatest.so] Error 1
 make[3]: Leaving directory '/mnt/ubuntu/abdul_linux/mainline_dev/tools/testing/selftests/alsa'
 make[3]: Entering directory '/mnt/ubuntu/abdul_linux/mainline_dev/tools/testing/selftests/amd-pstate'
 make[3]: Nothing to be done for 'all'.
 make[3]: Leaving directory '/mnt/ubuntu/abdul_linux/mainline_dev/tools/testing/selftests/amd-pstate'
```

These are errors are being returned from here
(tools/testing/seftests/alsa/Makefile):

CFLAGS += $(shell pkg-config --cflags alsa) $(KHDR_INCLUDES)	<----1st
LDLIBS += $(shell pkg-config --libs alsa)			<----2nd
ifeq ($(LDLIBS),)						<----3rd

and the same error would be returned by all, if user does not have ALSA

so i put a --silence-errors on the second assignment.

> > Signed-off-by: Abdul Rahim <abdul.rahim@xxxxxxxxxxx>
> > ---
> >   tools/testing/selftests/alsa/Makefile | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/alsa/Makefile b/tools/testing/selftests/alsa/Makefile
> > index 25be68025290..cd022fc869fb 100644
> > --- a/tools/testing/selftests/alsa/Makefile
> > +++ b/tools/testing/selftests/alsa/Makefile
> > @@ -2,7 +2,7 @@
> >   #

> > -LDLIBS += $(shell pkg-config --libs alsa)
> > +LDLIBS += $(shell pkg-config --silence-errors --libs alsa)
> >   ifeq ($(LDLIBS),)
> >   LDLIBS += -lasound
> >   endif




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux