Skip to content

Consider making template-haskell non-reinstallable again #4098

Closed

Description

@hvr

This is a reminder ticket to investigate under which conditions it is allowed to reinstall template-haskell, and consequently decide whether we should disallow it sometimes or always.

UPDATE: On Mon, Dec 19, 2016, @goldfirere told me when I asked him under which conditions template-haskell would be safe to reinstall that

I think this is never a good idea. template-haskell is very intricately involved with GHC.

Activity

  1. added
    cabal-install: v2-build system
    on Nov 9, 2016
  2. added this to the 2.0 milestone on Nov 9, 2016
  3. self-assigned this
    on Nov 9, 2016
  4. andreasabel commented on Dec 14, 2016

    @andreasabel
    Member

    I can reproduce the following problem on my ghc-7.8 installation. By default, template-haskell-2.9.0.0 is installed. First,

    $ cabal install template-haskell-2.11.0.0
    

    succeeds. Then,

    $ cabal install geniplate-mirror-0.7.2
    

    fails with compilation errors:

    [1 of 1] Compiling Data.Generics.Geniplate ( Data/Generics/Geniplate.hs, dist/build/Data/Generics/Geniplate.o )
    
    Data/Generics/Geniplate.hs:83:25:
        Couldn't match expected type ‘Dec’ with actual type ‘[Dec] -> Dec’
        Probable cause: ‘InstanceD’ is applied to too few arguments
        In the expression:
          InstanceD [] (foldl AppT (ConT cls) ts) (funDef met e)
    ...
    

    I guess this is because it picks up the newer version of template-haskell, which does not match. If I try to force the old version,

    $ cabal install --constraint=template-haskell==2.9.0.0 geniplate-mirror-0.7.2
    

    I get this error:

    [1 of 1] Compiling Data.Generics.Geniplate ( Data/Generics/Geniplate.hs, dist/build/Data/Generics/Geniplate.o )
    
    Data/Generics/Geniplate.hs:17:1:
        Bad interface file: /usr/local/lib/ghc-7.8.4/template-haskell-2.9.0.0/Language/Haskell/TH.hi
            Something is amiss; requested module  template-haskell-2.9.0.0:Language.Haskell.TH differs from name found in the interface file template-haskell:Language.Haskell.TH
    ...
    

    I can fix my system by unregistering the new template-haskell.

    $ ghc-pkg unregister template-haskell-2.11.0.0
    

    After that, installation of geniplate-mirror goes through.

    Installation of another version of template-haskell confuses the system. I got the other template-haskell by a forced reinstall. But it seems that no good can come out of installing a newer version of template-haskell.

  5. added a commit that references this issue on Dec 21, 2016
    0eb4e51
  6. added a commit that references this issue on Dec 22, 2016
    141effc
  7. sgraf812 commented on May 24, 2024

    @sgraf812
    Contributor

    FTR, this was tracked by https://gitlab.haskell.org/ghc/ghc/-/issues/24703 which will be resolved in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12479. The solution was (broadly speaking) to move wired-in Ids into ghc-internal which is thus the only library that cannot be reinstalled.

  8. Mikolaj commented on May 27, 2024

    @Mikolaj
    Member

    Am I right no changes in cabal are needed for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

blocked: info-neededcabal-install: v2-build system

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions