yesodweb / yesod

A RESTful Haskell web framework built on WAI.
http://www.yesodweb.com/
MIT License
2.63k stars 373 forks source link

Hoogle does not build in vanilla stack template #1669

Open amkhlv opened 4 years ago

amkhlv commented 4 years ago

Debian Buster, 8G of RAM

stack new myproject yesod-simple

cd myproject

stack build

stack hoogle

Results in:

-- While building package haskell-src-exts-1.20.3 using: /home/andrei/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.4 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.2.0.1 haddock --html --hoogle --html-location=../$pkg-$version/ --haddock-option=--hyperlinked-source --haddock-option=--quickjump Process exited with code: ExitFailure (-11) This seems to be an old problem

But it happens again, in vanilla Yesod template...

ncaq commented 4 years ago

I have 32GB of RAM. I confirm to repro it.

However, maybe it is GHC 8.4 bug. See

I suggest

stack config set resolver lts

and open package.yaml remove dependencies version range.

ncaq commented 4 years ago

That being said, I do think the template should be modified.

snoyberg commented 4 years ago

I'm not following, what can be changed in the template? In any event, if this works with GHC 8.6, I don't think it's worth trying to work around an old GHC bug.

ncaq commented 4 years ago

I'm not following, what can be changed in the template? In any event, if this works with GHC 8.6, I don't think it's worth trying to work around an old GHC bug.

exec stack new, stack Selected resolver: lts-12.26. Because package.yaml dependencies not complete match lts-15.9.

* Partially matches lts-15.9                                               
    aeson version 1.4.7.1 found                                            
        - myproject requires >=0.6 && <1.4
    classy-prelude version 1.5.0 found
        - myproject requires ==1.4.*
    classy-prelude-conduit version 1.5.0 found
        - myproject requires ==1.4.*
    classy-prelude-yesod version 1.5.0 found
        - myproject requires ==1.4.*
    fast-logger version 3.0.1 found
        - myproject requires >=2.2 && <2.5
    warp version 3.3.10 found
        - myproject requires >=3.0 && <3.3
    yaml version 0.11.3.0 found
        - myproject requires ==0.8.*
    Using package flags:
        - myproject: FlagName "dev" = False, FlagName "library-only" = False

I think to can fix to default selecting lts. By fix package.yaml dependencies.

snoyberg commented 4 years ago

Are you using the yesodweb/foo templates?

amkhlv commented 4 years ago

I am not sure, a bit confused with Stack templates. I just say stack new myproject yesod-simple in terminal... True, as ncaq said, it tries then various resolvers and settles down to lts-12.26, nothing later works...

snoyberg commented 4 years ago

That's the problem. Use stack new foo yesodweb/simple instead.

amkhlv commented 4 years ago

OK. Got it. Thank you ! Where is it documented?

snoyberg commented 4 years ago

https://www.yesodweb.com/page/quickstart

amkhlv commented 4 years ago

Ha-ha I've just seen this commit https://github.com/commercialhaskell/stack-templates/commit/000f5d15d62d9f324ef52cfa980ad38ce3d91267 :)

amkhlv commented 4 years ago

I used stack new myproject yesodweb/simple . However, now Intero does not build: stack build intero --copy-compiler-tool fails `Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for intero-0.1.40: ghc-8.8.3 from stack configuration does not match >=7.8 && <=8.6.5 (latest matching version is 8.6.5) needed since intero is a build target. ` I find it very hard to write Haskell without Intero...

amkhlv commented 4 years ago

Downgrading to lts-14.27 in stack.yaml, now Intero builds, but Hoogle, again, does not build: stack hoogle results in: `classy-prelude-yesod> error, called at utils/haddock/haddock-api/src/Haddock/Interface/Create.hs:1116:12 in main:Haddock.Interface.Create

-- While building package classy-prelude-yesod-1.5.0 using: /home/andrei/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1 haddock --html --hoogle --html-location=../$pkg-$version/ --haddock-option=--hyperlinked-source --haddock-option=--quickjump Process exited with code: ExitFailure 1`

ncaq commented 4 years ago

@amkhlv

The intero project has reached the end of its life cycle

Should use Alternatives. chrisdone/intero

I use haskell-ide-engine for yesod development.