commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
3.98k stars 843 forks source link

module `main:Log' is defined in multiple files (duplicated file) #4502

Open chrissound opened 5 years ago

chrissound commented 5 years ago

General summary/comments (optional)

This error was resolved after deleting the .stack-work directory and rebuilding.

Steps to reproduce

stack -v ghci app:exe:pitangaLog

hpack file ``` source-dirs: src executables: pitangaStartTask: main: Main.startLog pitangaStopTask: main: StopTask.main pitangaResumeTask: main: ResumeTask.resumeTask pitangaLog: main: Log.showLog pitangaExport: main: Export.main license-file: LICENSE build-type: Simple maintainer: Chris Stryczynski dependencies: - base >=4.11 && <4.12 - turtle - aeson-pretty # common - rainbow - lens - aeson - bytestring - stm - split - text - time - thyme - binary - binary-orphans - old-locale - directory - pretty-simple - string-conversions - optparse-applicative name: app version: '0.1.0.0' extra-source-files: ChangeLog.md author: Chris Stryczynski license: BSD3 default-extensions: - LambdaCase ```
cabal file ``` cabal-version: 1.12 -- This file has been generated from package.yaml by hpack version 0.31.1. -- -- see: https://github.com/sol/hpack -- -- hash: b53f54561fe46ea5b3de132681abd6fca663a34f3a0396d65575f109b88c86fa name: app version: 0.1.0.0 author: Chris Stryczynski maintainer: Chris Stryczynski license: BSD3 license-file: LICENSE build-type: Simple extra-source-files: ChangeLog.md executable pitangaExport main-is: Export.hs other-modules: Common Log Main MyDebug ResumeTask StopTask Paths_app hs-source-dirs: src default-extensions: LambdaCase ghc-options: -main-is Export.main build-depends: aeson , aeson-pretty , base >=4.11 && <4.12 , binary , binary-orphans , bytestring , directory , lens , old-locale , optparse-applicative , pretty-simple , rainbow , split , stm , string-conversions , text , thyme , time , turtle default-language: Haskell2010 executable pitangaLog main-is: Log.hs other-modules: Common Export Main MyDebug ResumeTask StopTask Paths_app hs-source-dirs: src default-extensions: LambdaCase ghc-options: -main-is Log.showLog build-depends: aeson , aeson-pretty , base >=4.11 && <4.12 , binary , binary-orphans , bytestring , directory , lens , old-locale , optparse-applicative , pretty-simple , rainbow , split , stm , string-conversions , text , thyme , time , turtle default-language: Haskell2010 executable pitangaResumeTask main-is: ResumeTask.hs other-modules: Common Export Log Main MyDebug StopTask Paths_app hs-source-dirs: src default-extensions: LambdaCase ghc-options: -main-is ResumeTask.resumeTask build-depends: aeson , aeson-pretty , base >=4.11 && <4.12 , binary , binary-orphans , bytestring , directory , lens , old-locale , optparse-applicative , pretty-simple , rainbow , split , stm , string-conversions , text , thyme , time , turtle default-language: Haskell2010 executable pitangaStartTask main-is: Main.hs other-modules: Common Export Log MyDebug ResumeTask StopTask Paths_app hs-source-dirs: src default-extensions: LambdaCase ghc-options: -main-is Main.startLog build-depends: aeson , aeson-pretty , base >=4.11 && <4.12 , binary , binary-orphans , bytestring , directory , lens , old-locale , optparse-applicative , pretty-simple , rainbow , split , stm , string-conversions , text , thyme , time , turtle default-language: Haskell2010 executable pitangaStopTask main-is: StopTask.hs other-modules: Common Export Log Main MyDebug ResumeTask Paths_app hs-source-dirs: src default-extensions: LambdaCase ghc-options: -main-is StopTask.main build-depends: aeson , aeson-pretty , base >=4.11 && <4.12 , binary , binary-orphans , bytestring , directory , lens , old-locale , optparse-applicative , pretty-simple , rainbow , split , stm , string-conversions , text , thyme , time , turtle default-language: Haskell2010 ```

Expected

An error to be reported relating to an unrelated type error.

Actual

Truncated output (full output: https://gist.github.com/chrissound/dcf79033dd139fe78b5cd95b7ec75d49):

stack -v ghci app:exe:pitangaLog
...
Loaded GHCi configuration from /home/chris/mount/home/chrisnixtrans/Haskell/PlatinumPitanga/.ghci

<no location info>: error:
    module `main:Log' is defined in multiple files: /home/chris/mount/home/chrisnixtrans/Haskell/PlatinumPitanga/src/Log.hs
                                                    /home/chris/mount/home/chrisnixtrans/Haskell/PlatinumPitanga/src/Log.hs
Failed, no modules loaded.

<no location info>: error:
    Could not find module `Common'
    It is not a module in the current program, or in any known package.
Loaded GHCi configuration from /run/user/1000/haskell-stack-ghci/e978a431/ghci-script

Stack version

stack --version
1.9.3 x86_64 hpack-0.31.1

Method of installation

chrissound commented 5 years ago

https://github.com/commercialhaskell/stack/issues/2706 possibly related?