Skip to content

Take into account installed pkg-config versions when resolving dependencies #3016

Closed

Description

@garetxe

When constructing the installation plan, it seems like pkg-config does not take into account the versions of the installed system packages, and it always chooses the latest available version from hackage. This makes distributing bindings in hackage for the latest version of a given library fairly difficult, as far as I can tell. (Maybe there is a way? I would be happy to learn if so.)

An example may make this clearer. Consider the gi-glib bindings for GLib:
http://hackage.haskell.org/package/gi-glib

The latest version of the gi-glib package, 0.2.46.10, has a pkgconfig-depends; glib-2.0 >= 2.46 line in the cabal file. This version of GLib is fairly recent, and is not included in Fedora 22 for example. The version there is 2.44, which would work with version 0.2.44.10 of gi-glib.

So when I try to do cabal install gi-glib in Fedora 22 the install fails with

Configuring gi-glib-0.2.46.10...
setup-Simple-Cabal-1.22.4.0-x86_64-linux-ghc-7.10.2: The pkg-config package
'glib-2.0' version >=2.46 is required but the version installed on the system
is version 2.44.1
cabal: Error: some packages failed to install:

since cabal always tries to install the latest version in hackage, gi-glib-0.2.46.10, which needs a too new GLib.

What would be ideal is if in this situation cabal chose the latest version of gi-glib compatible with the GLib version in the system, as specified in the pkgconfig-depends field in the cabal file.

Would this be possible?

Otherwise I see (as maintainer of gi-glib) no useful way of having bindings to the latest released version of GLib in hackage (I would have to wait until most users have upgraded their systems, which may take a few years...). Is there perhaps a different way of achieving this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions