Skip to content

Bad interface file on repeated rebuilds #6059

@ekmett

Description

@ekmett

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions