Opened 6 years ago

Closed 5 years ago

#5704 closed bug (wontfix)

Bug in the handling of wired-in packages (like template-haskell)

Reported by: simonmar Owned by: simonmar
Priority: high Milestone: 7.4.2
Component: Package system Version: 7.2.1
Keywords: Cc: bgamari@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


If you install an older version of a wired-in package (e.g. template-haskell) and then try to use it, GHC will use the newer one as the "wired-in" package rather than the older one.

This happened when trying to build aeson- with ghc 7.4: aeson requires template-haskell-, but GHC ships with Cabal installed template-haskell-, but while building aeson against it we get:

    Bad interface file: /Users/tibbe/.cabal/lib/template-haskell-
        Something is amiss; requested module  template-haskell- differs from name found in the interface file template-haskell:Language.Haskell.TH

the bug is that findWiredInPackage has picked template-haskell- to be the wired-in package:

wired-in package template-haskell mapped to template-haskell-

whereas we wanted to use template-haskell-

Not immediately obvious what the fix should be, so I'm making a ticket for this. The workaround is to update the dependency in aeson to allow template-haskell-

Change History (6)

comment:1 Changed 6 years ago by tibbe

Just to clarify the actual failure case:

  • aeson- requires template-haskell >= 2.4,
  • snap-server-0.7.1 requires template-haskell >= 2.2 && < 2.7,
  • template-haskell- therefore gets selected, and
  • the compilation (of aeson) fails as in the ticket description.

comment:2 Changed 6 years ago by simonpj

Owner: set to simonmar

comment:3 Changed 6 years ago by igloo


comment:4 Changed 6 years ago by bgamari

Cc: bgamari@… added

Has there been any progress on this? The current release of fc-labels also seems to carry a dependency on template-haskell

comment:5 Changed 6 years ago by bgamari

Oops, never mind concerning fclabels.

comment:6 Changed 5 years ago by simonmar

Resolution: wontfix
Status: newclosed

I'm going to close this. It just doesn't work to have multiple versions of a wired-in package, all kinds of things could go wrong.

We currently allow multiple versions to exist, but only the latest is considered to be "the" wired-in one. This was to make it possible to have both base-3 and base-4 coexisting, where base-3 depended on base-4. This doesn't apply in the above template-haskell example, where the two packages are really independent.

I think the right fix is just to not do this, and if I understand correctly the latest version of Cabal is better at avoiding it anyway.

Note: See TracTickets for help on using tickets.