graninas / Hydra

Hydra is a full-fledged framework for building web services, multithreaded and concurrent applications with SQL and KV DB support.
BSD 3-Clause "New" or "Revised" License
193 stars 13 forks source link

Disambiguate app modules #26

Closed yaitskov closed 4 years ago

yaitskov commented 4 years ago

I tried to explore app through ghci and realized that ghci breaks due meteor and perf apps have bunch of same modules. So I renamed perf modules.

$ stack ghci

* * * * * * * *
The main module to load is ambiguous. Candidates are: 
1. Package `Hydra' component Hydra:exe:astro-app with main-is file: /home/dan/demo/haskell/gsoc/Hydra/app/astro/Main.hs
2. Package `Hydra' component Hydra:exe:labyrinth with main-is file: /home/dan/demo/haskell/gsoc/Hydra/app/labyrinth/Main.hs
3. Package `Hydra' component Hydra:exe:meteor-counter-app with main-is file: /home/dan/demo/haskell/gsoc/Hydra/app/MeteorCounter/Main.hs
4. Package `Hydra' component Hydra:exe:perf-test-app with main-is file: /home/dan/demo/haskell/gsoc/Hydra/app/PerfTestApp/Main.hs
You can specify which one to pick by: 
 * Specifying targets to stack ghci e.g. stack ghci Hydra:exe:astro-app
 * Specifying what the main is e.g. stack ghci --main-is Hydra:exe:astro-app
 * Choosing from the candidate above [1..4]
* * * * * * * *

Specify main module to use (press enter to load none): 3
Loading main module from candidate 3, --main-is /home/dan/demo/haskell/gsoc/Hydra/app/MeteorCounter/Main.hs

The following GHC options are incompatible with GHCi and have not been passed to it: -threaded -O2
Configuring GHCi with the following packages: Hydra

* * * * * * * *

Error: Multiple files use the same module name:
       * Church found at the following paths
         * /home/dan/demo/haskell/gsoc/Hydra/app/MeteorCounter/Church.hs (Hydra:exe:meteor-counter-app)
         * /home/dan/demo/haskell/gsoc/Hydra/app/PerfTestApp/Church.hs (Hydra:exe:perf-test-app)
       * FTL found at the following paths
         * /home/dan/demo/haskell/gsoc/Hydra/app/MeteorCounter/FTL.hs (Hydra:exe:meteor-counter-app)
         * /home/dan/demo/haskell/gsoc/Hydra/app/PerfTestApp/FTL.hs (Hydra:exe:perf-test-app)
       * Free found at the following paths
         * /home/dan/demo/haskell/gsoc/Hydra/app/MeteorCounter/Free.hs (Hydra:exe:meteor-counter-app)
         * /home/dan/demo/haskell/gsoc/Hydra/app/PerfTestApp/Free.hs (Hydra:exe:perf-test-app)
       * Types found at the following paths
         * /home/dan/demo/haskell/gsoc/Hydra/app/MeteorCounter/Types.hs (Hydra:exe:meteor-counter-app)
         * /home/dan/demo/haskell/gsoc/Hydra/app/PerfTestApp/Types.hs (Hydra:exe:perf-test-app)
* * * * * * * *

Not attempting to start ghci due to these duplicate modules.
Use --no-load to try to start it anyway, without loading any modules (but these are still likely to cause errors)
graninas commented 4 years ago

Thanks, nice work!