Skip to content

With the new FFI demo, repeated runs of cabal repl haskell-demo fails #14

@CMCDragonkai

Description

@CMCDragonkai

It is failing with this error:

Preprocessing library for haskell-demo-0.1.0.0..
GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
ghc: panic! (the 'impossible' happened)
  (GHC version 8.4.3 for x86_64-unknown-linux):
        Loading temp shared object failed: /tmp/ghc7803_0/libghc_1.so: undefined symbol: get_pi

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Even though nix-build succeeds. The first time you run cabal repl haskell-demo, it works. But the second time it fails. It feels like this is something to do with the cabal repl settings maybe loading the wrong shared object.

To solve this change the order of c-sources in the haskell-demo.cabal file.

It is mentioned here: https://gitlab.haskell.org/ghc/ghc/issues/12152

And after doing so, it works.

This may also be solved by doing #10. Seems like a bug to me!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions