# Interface file error with packpack

**URL:** <https://discourse.haskell.org/t/interface-file-error-with-packpack/5907>\
**Category:** Learn\
**Created:** [March 3, 2023, 1:17am UTC](https://discourse.haskell.org/t/interface-file-error-with-packpack/5907 "2023-03-03T01:17:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Forist2034](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@Forist2034](https://discourse.haskell.org/u/Forist2034)\
**Post date:** [March 3, 2023, 1:17am UTC](https://discourse.haskell.org/t/interface-file-error-with-packpack/5907/1 "2023-03-03T01:17:24Z")

</div>

Using this package describtion

backpack.cabal:

```haskell
cabal-version: 3.4
name: backpack
version: 0.1.0.0

library
    build-depends: backpack:{sig2, impl-s, impl-s2}
    default-language: Haskell2010

library sig
    signatures: 
        S
    exposed-modules:
        T
    hs-source-dirs: sig
    default-language: Haskell2010
    build-depends: base

library sig2
    signatures:
        S2
    hs-source-dirs: sig2
    default-language: Haskell2010
    build-depends: base, backpack:sig

library impl-s
    exposed-modules:
        S
    hs-source-dirs: impl
    build-depends: base

library impl-s2
    hs-source-dirs: src
    exposed-modules:
        S2
    build-depends: base, backpack:{sig, impl-s}

```

impl/S.hs

```haskell
module S where

type S = Int

```

sig/S.hsig

```haskell
signature S where

data S

```

sig/T.hs

```haskell
module T where

import S

data T = T { ts1, ts2 :: S}

```

sig2/S2.hsig

```haskell
signature S2 where

import T

data S2

s2 :: T -> S2

```

src/S2.hs

```haskell
module S2 where

import S
import T

type S2 = (S, S)

s2 :: T -> S2
s2 t = (ts1 t, ts2 t)

```

When compiling with ghc 9.4.3, ghc reports following error

```haskell
typecheckIfaceForInstantiate
Declaration for s2:
  Can't find interface-file declaration for type constructor or class T
    Probable cause: bug in .hi-boot file, or inconsistent .hi file
    Use -ddump-if-trace to get an idea of which file caused the error

<no location info>: error:
    Cannot continue after interface file error
Error: cabal: Failed to build lib:sig2 from backpack-0.1.0.0 (which is
required by backpack-0.1.0.0).

```
