Bug 5340 - Output when package requirements are not met can be more helpful
Summary: Output when package requirements are not met can be more helpful
Status: RESOLVED MOVED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: x86 (IA32) All
: high normal
Assignee: Tollef Fog Heen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-14 21:41 UTC by Björn Lindqvist
Modified: 2018-08-25 12:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Part 1 of patch, patches main.c (5.36 KB, patch)
2005-12-16 04:31 UTC, Björn Lindqvist
Details | Splinter Review
Part 2 of patch, patches pkg.c (1.79 KB, patch)
2005-12-16 04:31 UTC, Björn Lindqvist
Details | Splinter Review
Part 3 of patch, patches pkg.h (690 bytes, patch)
2005-12-16 04:32 UTC, Björn Lindqvist
Details | Splinter Review
Part 4 of patch, patches pkg.m4 (498 bytes, patch)
2005-12-16 04:33 UTC, Björn Lindqvist
Details | Splinter Review

Description Björn Lindqvist 2005-12-14 21:41:43 UTC
Moved from: http://bugzilla.gnome.org/show_bug.cgi?id=319251

Output from pkg-config is not formatted, therefore the output can look like this:

cking for DEPENDENCIES... configure: error: Package requirements (          
  glib-2.0 >= 2.8.0,              gtk+-2.0 >= 2.8.3,              libxml-2.0 >=
2.6.12                 libxslt >= 1.1.7                libgnomeui-2.0 >= 2.6.0 
               libglade-2.0 >= 2.3.1                   gnome-vfs-2.0 >= 2.9.2  
            gnome-vfs-module-2.0            gconf-2.0              
gnome-desktop-2.0 >= 2.9.91                             libgnomeprint-2.2 >=
2.4.0  libgnomeprintui-2.2 >= 2.4.0             ) were not met.

You should also be told WHICH of the package requirements failed. Otherwise you
have to guess.
Comment 1 Björn Lindqvist 2005-12-16 04:31:19 UTC
Created attachment 4092 [details] [review]
Part 1 of patch, patches main.c
Comment 2 Björn Lindqvist 2005-12-16 04:31:58 UTC
Created attachment 4093 [details] [review]
Part 2 of patch, patches pkg.c
Comment 3 Björn Lindqvist 2005-12-16 04:32:36 UTC
Created attachment 4094 [details] [review]
Part 3 of patch, patches pkg.h
Comment 4 Björn Lindqvist 2005-12-16 04:33:05 UTC
Created attachment 4095 [details] [review]
Part 4 of patch, patches pkg.m4
Comment 5 Björn Lindqvist 2005-12-16 04:54:26 UTC
I couldn't figure GNU Arch so these diffs are against released pkg-config-0.20.
That is also why I had to diff them separately instead of in one file. Sorry
about that.

The full patch makes for some major improvements to pkg-configs output. Instead
of printing each failed dependancy when it is encountered I created an object
ErrorSummary which keeps track of which package request that failed and when all
package requests have been processed, prints an error summary. That makes it so
that the error message you get when not using the --short-error option is only
printed once. The output also becomes more "human readable" and less verbose.

I also made a related change to PKG_CHECK_MODULES in pkg.m4 and removed the
printing of the package requirements which was the cause of the unformatted
output in my first comment. With this patch the output now looks like:

--------
checking for GALEON_DEPENDENCY... configure: error: Missing dependencies:

Packages 'gnome-desktop-2.0' and 'libgnomeui-2.0' not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GALEON_DEPENDENCY_CFLAGS
and GALEON_DEPENDENCY_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Comment 6 Tollef Fog Heen 2006-01-08 05:21:47 UTC
Can you please just update pkg.m4 in your package and see if the new behaviour 
in 0.20 already gives what you want?  I think it should.
Comment 7 Björn Lindqvist 2006-01-08 10:48:56 UTC
(In reply to comment #6)
> Can you please just update pkg.m4 in your package and see if the new behaviour 
> in 0.20 already gives what you want?  I think it should.

0.20 is more helpful because it outputs all missing dependencies instead of just
stopping on the first one. But the output isn't pretty:

$ ./pkg-config --print-errors --errors-to-stdout "gnome-desktop-3.0
libgnomeui-3.0 gtk+ >= 33"
Package gnome-desktop-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnome-desktop-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnome-desktop-3.0' found
Package libgnomeui-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libgnomeui-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libgnomeui-3.0' found
Requested 'gtk+ >= 33' but version of GTK+ is 1.2.10
 
$ pkg-config --print-errors --errors-to-stdout --short-errors "gnome-desktop-3.0
libgnomeui-3.0 gtk+ >= 33"
No package 'gnome-desktop-3.0' found
No package 'libgnomeui-3.0' found
Requested 'gtk+ >= 33' but version of GTK+ is 1.2.10

Whereas with the patch:

$ pkg-config --print-errors --errors-to-stdout "gnome-desktop-3.0 libgnomeui-3.0
gtk+ >= 33"
Packages 'libgnomeui-3.0' and 'gnome-desktop-3.0' not found
Requested 'gtk+ >= 33' but installed version of GTK+ is 1.2.10

Packages 'libgnomeui-3.0' and 'gnome-desktop-3.0' was not found in the
pkg-config search path.
Perhaps you should add the directories containing the files:
  'libgnomeui-3.0.pc' and 'gnome-desktop-3.0.pc'
to the PKG_CONFIG_PATH environment variable

$ pkg-config --print-errors --errors-to-stdout --short-errors "gnome-desktop-3.0
libgnomeui-3.0 gtk+ >= 33"
Packages 'libgnomeui-3.0' and 'gnome-desktop-3.0' not found
Requested 'gtk+ >= 33' but installed version of GTK+ is 1.2.10

I think that is a big improvement but it's your choice.
Comment 8 Tollef Fog Heen 2006-01-08 18:37:25 UTC
I agree that your long error message looks better and is more readable, so I 
will switch to something resembling that.  I think the short error message is 
fine already, so that will stay.
Comment 9 chemtech 2013-03-15 13:57:45 UTC
Björn Lindqvist
Do you still experience this issue with newer drivers ?
Please check the status of your issue.
Comment 10 GitLab Migration User 2018-08-25 12:56:23 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/42.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.