haskell / haskell/cabal

Bad interface file on repeated rebuilds

Open
#6,059 2 comments 6 reactions 0 assignees View on GitHub
Cabal: cmd/build type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

When I alternate between

```
cabal v2-repl --repl-options=-fobject-code --repl-options=-v1 --repl-options=-ferror-spans --repl-options=-j
```

and

```
cabal v2-test
```

in my current project several times, eventually I get something like:

```
test/Spec.hs:5:1: error:
Bad interface file: /Users/ekmett/codex/dist-newstyle/build/x86_64-osx/ghc-8.6.4/harfbuzz-0/build/Graphics/Harfbuzz.hi
mismatched interface file ways (wanted "", got "dyn")
|
```

The only way I've been able to fix it is to go in and nuke that sub-directory and rebuild.

Guessing we have some bad logic about dynamic vs. static libraries somewhere?

To be fair the project itself uses `template-haskell` internally to build up stuff for FFI, so that may somehow be a factor, but I'm not sure how to distill a minimal test case.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.