Skip to content

using stack build causing ghci to segfault #8

Open
@gautammohan

Description

@gautammohan

Hi there,

I am running into an issue where running stack ghci after building will cause a segfault. I am running on Mac OSX (High Sierra if it makes a difference...). Here is what I did:

  1. installed llvm-4.0 via Homebrew, which created an installation in homebrew's directory, and every llvm executable has a "-4.0" suffix. Because of this, I have resolved the dependency on llvm-config by symlinking llvm-config to llvm-config-4.0 and adding the project root directory to my path.

  2. stack build succeeds on all the chapters, but when trying to run stack ghci gets me the following error:

bash-3.2$ stack ghci
Configuring GHCi with the following packages: kaleidoscope

* * * * * * * *

Error: Multiple files use the same module name:
       * Codegen found at the following paths
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter3/Codegen.hs (kaleidosco
pe:exe:chapter3)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter4/Codegen.hs (kaleidosco
pe:exe:chapter4)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter5/Codegen.hs (kaleidosco
pe:exe:chapter5)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter6/Codegen.hs (kaleidosco
pe:exe:chapter6)                                                                      
         * /Users/gautam/research/llvm/kaleidoscope/src/chapter7/Codegen.hs (kaleidosco
pe:exe:chapter7)                                                                      

(Repeated for Emit, Jit, Lexer, Parser, etc for all the chapters)

To mitigate this issue, I commented out all chapters in the kaleidoscope.cabal file except for chapter 3, and tried again using stack clean --full and stack build. Running this command from the kaleidoscope root (so that my llvm-config symlink can be seen), I get a bunch of linking errors (attached in the error.log) file. error.log

Note that stack exec works fine, just like what was specified in the example. However, intero relies on ghci and I'd love to figure out how to get all of its benefits on files using llvm-hs.

Not sure if this is the right place to post this issue. Thanks in advance for any help.

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