Opened 5 years ago

Closed 23 months ago

Last modified 22 months ago

#6119 closed feature request (fixed)

complain when ghc-pkg doesn't find any matching packages in a given database

Reported by: dmwit Owned by: sibi
Priority: normal Milestone: 8.0.1
Component: ghc-pkg Version: 7.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #10785 Differential Rev(s):
Wiki Page:


Currently, ghc-pkg list will print something like the following when no package matches a query:

$ ghc-pkg list blargle

This is a deceptive answer for newcomers, because they assume that this means the package was successfully found, and lives in /usr/local/lib/ghc-7.4.1/package.conf.d. It would be nice if the message explicitly mentioned that the result list was actually empty; for example:

$ ghc-pkg list blargle
    (no matching packages found in this database)

Change History (9)

comment:1 Changed 5 years ago by ian@…

commit 55478b1ef856d47fba7e7dbd86baa88030d1b1cf

Author: Ian Lynagh <>
Date:   Thu Oct 11 21:31:00 2012 +0100

    ghc-pkg: Print something when no packages are found; fixes #6119
    We used to say
        $ ghc-pkg list blargle
    which may imply that blargle was found in

 utils/ghc-pkg/Main.hs |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

comment:2 Changed 5 years ago by igloo

difficulty: Unknown
Resolution: fixed
Status: newclosed

Fixed, thanks

comment:3 Changed 2 years ago by dmwit

Resolution: fixed
Status: closednew

GHC has since grown a colored version of ghc-pkg, which did not inherit this nice feature.

comment:4 Changed 2 years ago by thomie

Component: Compilerghc-pkg

comment:5 Changed 23 months ago by sibi

Owner: set to sibi

comment:6 Changed 23 months ago by sibi

Differential Rev(s):
Status: newpatch

comment:7 Changed 23 months ago by Ben Gamari <ben@…>

In 3d55e41e/ghc:

ghc-pkg: Restore old behavior in colored version; fixes 6119

The behavior is changed to this:
ghc-pkg list blahblah
    (no packages)
instead of:
ghc-pkg list blahblah

Reviewers: austin, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #6119

comment:8 Changed 23 months ago by bgamari

Resolution: fixed
Status: patchclosed

comment:9 Changed 22 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.