Opened 4 years ago

Closed 11 months ago

Last modified 10 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 4 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 4 years ago by igloo

  • difficulty set to Unknown
  • Resolution set to fixed
  • Status changed from new to closed

Fixed, thanks

comment:3 Changed 12 months ago by dmwit

  • Resolution fixed deleted
  • Status changed from closed to new

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

comment:4 Changed 12 months ago by thomie

  • Component changed from Compiler to ghc-pkg

comment:5 Changed 11 months ago by sibi

  • Owner set to sibi

comment:6 Changed 11 months ago by sibi

  • Differential Rev(s) set to
  • Status changed from new to patch

comment:7 Changed 11 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 11 months ago by bgamari

  • Resolution set to fixed
  • Status changed from patch to closed

comment:9 Changed 10 months ago by thomie

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