digitallyinduced / ihp

🔥 The fastest way to build type safe web apps. IHP is a new batteries-included web framework optimized for longterm productivity and programmer happiness
https://ihp.digitallyinduced.com/
MIT License
4.92k stars 195 forks source link

GHCI No long workers #1738

Closed s0kil closed 1 year ago

s0kil commented 1 year ago

It seems recent changes have broken GHCI,

When launching a new REPL with make ghci: I get these warnings:

ghci -package-env -
GHCi, version 9.4.2: https://www.haskell.org/ghc/  :? for help

<no location info>: warning: [-Wmissed-extra-shared-lib]
    libgmp.so: cannot open shared object file: No such file or directory
    It's OK if you don't want to use symbols from it directly.
    (the package DLL is loaded by the system linker
     which manages dependencies by itself).
cannot satisfy -package ihp
    (use -v for more information)
package flags have changed, resetting and loading new packages...

<no location info>: warning: [-Wmissed-extra-shared-lib]
    libtinfo.so: cannot open shared object file: No such file or directory
    It's OK if you don't want to use symbols from it directly.
    (the package DLL is loaded by the system linker
     which manages dependencies by itself).
[ 1 of 76] Compiling Application.Helper.Controller ( Application/Helper/Controller.hs, interpreted )

And later it fails with such error:

Application/Helper/Controller.hs:3:1: error:
    Could not find module ‘IHP.ControllerPrelude’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import IHP.ControllerPrelude
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2 of 76] Compiling Application.View.CustomCSSFramework ( Application/View/CustomCSSFramework.hs, interpreted )

Application/View/CustomCSSFramework.hs:3:1: error:
    Could not find module ‘IHP.FlashMessages.Types’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import IHP.FlashMessages.Types
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:4:1: error:
    Could not find module ‘IHP.HSX.QQ’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
4 | import IHP.HSX.QQ (hsx)
  | ^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:5:1: error:
    Could not find module ‘IHP.HSX.ToHtml’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
5 | import IHP.HSX.ToHtml ()
  | ^^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:6:1: error:
    Could not find module ‘IHP.Prelude’
    Perhaps you meant GHC.Prelude (from ghc-9.4.2)
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
6 | import IHP.Prelude
  | ^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:7:1: error:
    Could not find module ‘IHP.View.Classes’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
7 | import IHP.View.Classes
  | ^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:8:1: error:
    Could not find module ‘IHP.View.Types’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
8 | import IHP.View.Types
  | ^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:9:1: error:
    Could not find module ‘Text.Blaze.Html5’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
9 | import qualified Text.Blaze.Html5 as Blaze
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:11:1: error:
    Could not find module ‘IHP.Breadcrumb.Types’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
11 | import IHP.Breadcrumb.Types
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:12:1: error:
    Could not find module ‘IHP.ModelSupport’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
12 | import IHP.ModelSupport
   | ^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:13:1: error:
    Could not find module ‘IHP.Pagination.Helpers’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
13 | import IHP.Pagination.Helpers
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:14:1: error:
    Could not find module ‘IHP.Pagination.Types’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
14 | import IHP.Pagination.Types
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Application/View/CustomCSSFramework.hs:15:1: error:
    Could not find module ‘IHP.View.CSSFramework’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
15 | import IHP.View.CSSFramework
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 4 of 76] Compiling Generated.Enums  ( build/Generated/Enums.hs, interpreted )

build/Generated/Enums.hs:3:1: error:
    Could not find module ‘CorePrelude’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
3 | import CorePrelude
  | ^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:4:1: error:
    Could not find module ‘IHP.ModelSupport’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
4 | import IHP.ModelSupport
  | ^^^^^^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:5:1: error:
    Could not find module ‘Database.PostgreSQL.Simple’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
5 | import Database.PostgreSQL.Simple
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:6:1: error:
    Could not find module ‘Database.PostgreSQL.Simple.FromField’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
6 | import Database.PostgreSQL.Simple.FromField hiding (Field, name)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:7:1: error:
    Could not find module ‘Database.PostgreSQL.Simple.ToField’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
7 | import Database.PostgreSQL.Simple.ToField hiding (Field)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:8:1: error:
    Could not find module ‘IHP.Controller.Param’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
8 | import qualified IHP.Controller.Param
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:9:1: error:
    Could not find module ‘Data.Default’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
9 | import Data.Default
  | ^^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:10:1: error:
    Could not find module ‘IHP.QueryBuilder’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
10 | import qualified IHP.QueryBuilder as QueryBuilder
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

build/Generated/Enums.hs:11:1: error:
    Could not find module ‘Data.String.Conversions’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
11 | import qualified Data.String.Conversions
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, no modules loaded.

<no location info>: error:
    Could not find module ‘IHP.Prelude’
    Perhaps you meant GHC.Prelude (from ghc-9.4.2)
amitaibu commented 1 year ago

Are you running on latest master?

I tried make ghci with https://github.com/amitaibu/ihp-landing-page/ and it works for me

image

s0kil commented 1 year ago

Will try lastest master

s0kil commented 1 year ago

It looks like I need to do direnv allow every time I open the terminal. @amitaibu Do you put direnv allow into your .bashrc?

amitaibu commented 1 year ago

Do you put direnv allow into your .bashrc?

No, I have to do it only once. But you need to have direnv integrated with your shell - https://direnv.net/docs/hook.html#bash

CSchank commented 1 year ago

Do you put direnv allow into your .bashrc?

You definitely shouldn't need to do this. It wouldn't really work, since the whole idea of direnv allow is to enable the .envrc file to run when you enter that directory. For this to work, you should make sure to hook it into your shell though.