Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack hoogle commands fails due to not finding/installing hoogle #4905

Open
halhenke opened this issue Jun 24, 2019 · 17 comments

Comments

@halhenke
Copy link

commented Jun 24, 2019

General summary/comments (optional)

stack hoogle commands failed due to not finding/installing hoogle

Steps to reproduce

Run any stack hoogle based command

Expected

Either install hoogle then generate hoogle database or find hoogle then install database

Actual

stack hoogle --verbose
Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2
2019-06-25 09:21:38.401448: [debug] Checking for project config at: /Users/hal/code/haskell/PathTag/stack.yaml
2019-06-25 09:21:38.402267: [debug] Loading project config file stack.yaml
2019-06-25 09:21:38.409633: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2019-06-23 23:21:38.409574 UTC]
2019-06-25 09:21:38.410751: [debug] Using package location completions from a lock file
2019-06-25 09:21:38.558151: [debug] Running hpack on /Users/hal/code/haskell/PathTag/package.yaml
2019-06-25 09:21:38.561544: [debug] hpack output unchanged in /Users/hal/code/haskell/PathTag/PathTag.cabal
2019-06-25 09:21:38.561869: [debug] Completing package location information from capability-0.2.0.0@sha256:7049527e0bede44f8aeabdd0f41c50ec78da5835796e6a477615502665127a62
2019-06-25 09:21:38.562188: [debug] Added in cabal file hash: capability-0.2.0.0@sha256:7049527e0bede44f8aeabdd0f41c50ec78da5835796e6a477615502665127a62,2424
2019-06-25 09:21:38.562443: [debug] Completing package location information from superrecord-0.5.0.1@sha256:ef0dd316eda7761da831071f729aec3373b44d223b818f9b078be9fba1378b95
2019-06-25 09:21:38.562626: [debug] Added in cabal file hash: superrecord-0.5.0.1@sha256:ef0dd316eda7761da831071f729aec3373b44d223b818f9b078be9fba1378b95,2476
2019-06-25 09:21:38.562774: [debug] Completing package location information from brick-0.47@sha256:4936c50acfdf09620dad5217fb384fc0d59626f75abed8b48250b419ec2ab623
2019-06-25 09:21:38.563005: [debug] Added in cabal file hash: brick-0.47@sha256:4936c50acfdf09620dad5217fb384fc0d59626f75abed8b48250b419ec2ab623,13852
2019-06-25 09:21:38.563175: [debug] Completing package location information from config-ini-0.2.4.0@sha256:38a6d484d471c6fac81445de2eac8c4e8c82760962fca5491ae1c3bfca9c4047
2019-06-25 09:21:38.563349: [debug] Added in cabal file hash: config-ini-0.2.4.0@sha256:38a6d484d471c6fac81445de2eac8c4e8c82760962fca5491ae1c3bfca9c4047,3232
2019-06-25 09:21:38.563484: [debug] Completing package location information from data-clist-0.1.2.2@sha256:4d70add0a200a178853cd37c6469101bac3c36aebb3aa9c503ff225211b1a8c9
2019-06-25 09:21:38.563647: [debug] Added in cabal file hash: data-clist-0.1.2.2@sha256:4d70add0a200a178853cd37c6469101bac3c36aebb3aa9c503ff225211b1a8c9,936
2019-06-25 09:21:38.563843: [debug] Completing package location information from haskell-src-exts-1.21.0@sha256:02421cacaa48c055551b8e5796efc543301b7ea9527a38e1385403d2b85512fb,4467
2019-06-25 09:21:38.563993: [debug] Completing package location information from text-zipper-0.10.1@sha256:8b73a97a3717a17df9b0a722b178950c476ff2268ca5c583e99d010c94af849e
2019-06-25 09:21:38.567512: [debug] Added in cabal file hash: text-zipper-0.10.1@sha256:8b73a97a3717a17df9b0a722b178950c476ff2268ca5c583e99d010c94af849e,1471
2019-06-25 09:21:38.567715: [debug] Completing package location information from word-wrap-0.4.1@sha256:f72233b383ef569c557bfd9812cbb8e306c415ce509082c0bd15ee51c0239ccc
2019-06-25 09:21:38.567950: [debug] Added in cabal file hash: word-wrap-0.4.1@sha256:f72233b383ef569c557bfd9812cbb8e306c415ce509082c0bd15ee51c0239ccc,1606
2019-06-25 09:21:38.569160: [debug] Asking for a supported GHC version
2019-06-25 09:21:38.569471: [debug] Installed tools:
 - ghc-8.6.4
 - ghc-8.6.2
 - ghc-8.6.5
 - ghc-8.6.3
 - ghc-8.2.1
 - ghc-8.2.2
2019-06-25 09:21:38.569872: [debug] Potential GHC builds: standard
2019-06-25 09:21:38.569909: [debug] Found already installed GHC builds: standard
2019-06-25 09:21:38.570103: [debug] SELECT "id","actual_version","arch","ghc_path","ghc_size","ghc_modified","ghc_pkg_path","runghc_path","haddock_path","cabal_version","global_db","global_db_cache_size","global_db_cache_modified","info","global_dump" FROM "compiler_cache" WHERE "ghc_path"=?; [PersistText "/Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-8.6.3"]
2019-06-25 09:21:38.628223: [debug] Loaded compiler information from cache
2019-06-25 09:21:38.628387: [debug] Asking for a supported GHC version
2019-06-25 09:21:38.629707: [debug] Resolving package entries
2019-06-25 09:21:38.629793: [debug] Parsing the targets
2019-06-25 09:21:38.634125: [debug] Checking flags
2019-06-25 09:21:38.634276: [debug] SourceMap constructed
2019-06-25 09:21:38.643602: [debug] Starting to execute command inside EnvConfig
2019-06-25 09:21:38.643971: [warn] Hoogle isn't installed. Automatically installing (use --no-setup to disable) ...
2019-06-25 09:21:38.656868: [info] Minimum version is hoogle-5.0. Found acceptable hoogle-5.0.17.9@sha256:beb55b392cb15e62ef1183d6adc40117c00eacd3958717a05f244948c6588740,3159 in your index, installing it.
2019-06-25 09:21:38.657018: [debug] Using package location completions from a lock file
2019-06-25 09:21:38.782187: [debug] Completing package location information from capability-0.2.0.0@sha256:7049527e0bede44f8aeabdd0f41c50ec78da5835796e6a477615502665127a62
2019-06-25 09:21:38.782469: [debug] Added in cabal file hash: capability-0.2.0.0@sha256:7049527e0bede44f8aeabdd0f41c50ec78da5835796e6a477615502665127a62,2424
2019-06-25 09:21:38.782608: [debug] Completing package location information from superrecord-0.5.0.1@sha256:ef0dd316eda7761da831071f729aec3373b44d223b818f9b078be9fba1378b95
2019-06-25 09:21:38.782774: [debug] Added in cabal file hash: superrecord-0.5.0.1@sha256:ef0dd316eda7761da831071f729aec3373b44d223b818f9b078be9fba1378b95,2476
2019-06-25 09:21:38.782890: [debug] Completing package location information from brick-0.47@sha256:4936c50acfdf09620dad5217fb384fc0d59626f75abed8b48250b419ec2ab623
2019-06-25 09:21:38.783103: [debug] Added in cabal file hash: brick-0.47@sha256:4936c50acfdf09620dad5217fb384fc0d59626f75abed8b48250b419ec2ab623,13852
2019-06-25 09:21:38.783255: [debug] Completing package location information from config-ini-0.2.4.0@sha256:38a6d484d471c6fac81445de2eac8c4e8c82760962fca5491ae1c3bfca9c4047
2019-06-25 09:21:38.783416: [debug] Added in cabal file hash: config-ini-0.2.4.0@sha256:38a6d484d471c6fac81445de2eac8c4e8c82760962fca5491ae1c3bfca9c4047,3232
2019-06-25 09:21:38.783533: [debug] Completing package location information from data-clist-0.1.2.2@sha256:4d70add0a200a178853cd37c6469101bac3c36aebb3aa9c503ff225211b1a8c9
2019-06-25 09:21:38.783681: [debug] Added in cabal file hash: data-clist-0.1.2.2@sha256:4d70add0a200a178853cd37c6469101bac3c36aebb3aa9c503ff225211b1a8c9,936
2019-06-25 09:21:38.783932: [debug] Completing package location information from haskell-src-exts-1.21.0@sha256:02421cacaa48c055551b8e5796efc543301b7ea9527a38e1385403d2b85512fb,4467
2019-06-25 09:21:38.784040: [debug] Completing package location information from text-zipper-0.10.1@sha256:8b73a97a3717a17df9b0a722b178950c476ff2268ca5c583e99d010c94af849e
2019-06-25 09:21:38.784195: [debug] Added in cabal file hash: text-zipper-0.10.1@sha256:8b73a97a3717a17df9b0a722b178950c476ff2268ca5c583e99d010c94af849e,1471
2019-06-25 09:21:38.784304: [debug] Completing package location information from word-wrap-0.4.1@sha256:f72233b383ef569c557bfd9812cbb8e306c415ce509082c0bd15ee51c0239ccc
2019-06-25 09:21:38.784457: [debug] Added in cabal file hash: word-wrap-0.4.1@sha256:f72233b383ef569c557bfd9812cbb8e306c415ce509082c0bd15ee51c0239ccc,1606
2019-06-25 09:21:38.785348: [debug] Asking for a supported GHC version
2019-06-25 09:21:38.785676: [debug] Installed tools:
 - ghc-8.6.4
 - ghc-8.6.2
 - ghc-8.6.5
 - ghc-8.6.3
 - ghc-8.2.1
 - ghc-8.2.2
2019-06-25 09:21:38.786049: [debug] Potential GHC builds: standard
2019-06-25 09:21:38.786081: [debug] Found already installed GHC builds: standard
2019-06-25 09:21:38.786226: [debug] SELECT "id","actual_version","arch","ghc_path","ghc_size","ghc_modified","ghc_pkg_path","runghc_path","haddock_path","cabal_version","global_db","global_db_cache_size","global_db_cache_modified","info","global_dump" FROM "compiler_cache" WHERE "ghc_path"=?; [PersistText "/Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-8.6.3"]
2019-06-25 09:21:38.821312: [debug] Loaded compiler information from cache
2019-06-25 09:21:38.821437: [debug] Asking for a supported GHC version
2019-06-25 09:21:38.822489: [debug] Resolving package entries
2019-06-25 09:21:38.822548: [debug] Parsing the targets
2019-06-25 09:21:38.882071: [debug] Checking flags
2019-06-25 09:21:38.882138: [debug] SourceMap constructed
2019-06-25 09:21:38.886435: [debug] Starting to execute command inside EnvConfig
2019-06-25 09:21:38.890141: [debug] Finding out which packages are already installed
2019-06-25 09:21:38.890312: [debug] Run process: /Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-pkg-8.6.3 --global --no-user-package-db dump --expand-pkgroot
2019-06-25 09:21:38.948583: [debug] Process finished in 58ms: /Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-pkg-8.6.3 --global --no-user-package-db dump --expand-pkgroot
2019-06-25 09:21:38.951383: [debug] Ignoring package haskeline due to wanting version 0.7.5.0 instead of 0.7.4.3
2019-06-25 09:21:38.953093: [debug] Ignoring package Cabal due to wanting version 2.4.1.0 instead of 2.4.0.1
2019-06-25 09:21:38.953839: [debug] Run process: /Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-pkg-8.6.3 --user --no-user-package-db --package-db /Users/hal/.stack/snapshots/x86_64-osx/c19da423c573e10b6cdcf0f1f51ead47485b56ef54185d1a57bad3717977b839/8.6.3/pkgdb dump --expand-pkgroot
2019-06-25 09:21:39.071878: [debug] Process finished in 118ms: /Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-pkg-8.6.3 --user --no-user-package-db --package-db /Users/hal/.stack/snapshots/x86_64-osx/c19da423c573e10b6cdcf0f1f51ead47485b56ef54185d1a57bad3717977b839/8.6.3/pkgdb dump --expand-pkgroot
2019-06-25 09:21:39.075935: [debug] Run process: /Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-pkg-8.6.3 --user --no-user-package-db --package-db /Users/hal/code/haskell/PathTag/.stack-work/install/x86_64-osx/c19da423c573e10b6cdcf0f1f51ead47485b56ef54185d1a57bad3717977b839/8.6.3/pkgdb dump --expand-pkgroot
2019-06-25 09:21:39.120018: [debug] Process finished in 44ms: /Users/hal/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc-pkg-8.6.3 --user --no-user-package-db --package-db /Users/hal/code/haskell/PathTag/.stack-work/install/x86_64-osx/c19da423c573e10b6cdcf0f1f51ead47485b56ef54185d1a57bad3717977b839/8.6.3/pkgdb dump --expand-pkgroot
2019-06-25 09:21:39.120470: [debug] Constructing the build plan
2019-06-25 09:21:39.163569: [debug] Parsing cabal file for hoogle (from Hackage)
2019-06-25 09:21:39.165275: [debug] Checking if we are going to build multiple executables with the same name
2019-06-25 09:21:39.165334: [debug] Executing the build plan
2019-06-25 09:21:39.189879: [info] Haddock index for snapshot packages already up to date at:
/Users/hal/.stack/snapshots/x86_64-osx/c19da423c573e10b6cdcf0f1f51ead47485b56ef54185d1a57bad3717977b839/8.6.3/doc/index.html
2019-06-25 09:21:39.190191: [warn] Couldn't find hoogle in path after installing.  This shouldn't happen, may be a bug.```

### Stack version

$ stack --version
Version 2.1.1, Git revision f612ea8 (7648 commits) x86_64 hpack-0.31.2


### Method of installation

curl -sSL https://get.haskellstack.org/ | sh


Error message comes from here:

https://github.com/commercialhaskell/stack/blob/89d165b8df7f09263e3e15fc165d9da35bf37b60/src/Stack/Hoogle.hs#L178
@dnadales

This comment has been minimized.

Copy link

commented Jul 11, 2019

I'm running into the same issue.

@dnadales

This comment has been minimized.

Copy link

commented Jul 11, 2019

I don't know whether this might be the cause, but after running stack install hoogle from my project folder I see:

▶ stack install hoogle

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for hoogle-5.0.17.3:
    haskell-src-exts-1.21.0 from stack configuration does not match >=1.18 && <1.21  (latest matching version is 1.20.3)
needed since hoogle is a build target.

so maybe this error gets masked when running stack hoogle -- generate --local 🤷‍♂

@dnadales

This comment has been minimized.

Copy link

commented Jul 12, 2019

No, that is not the case. I even removed a local hoogle version I had, and the command still fails.

@dnadales

This comment has been minimized.

Copy link

commented Jul 12, 2019

Somehow the hoogle executable is installed in this path on my machine:

hoogle                           > Installing executable hoogle in /home/damian/.stack/snapshots/x86_64-linux-nix/c334ff465db50c98009e6fd996ea2b0c3fdc9c50416a
c36b5ac40bdd15a6ede8/8.6.5/bin      

which is not in my $PATH

@qrilka

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

@dnadales your build problem seems to be about conflicting dependencies: lts-13.27 contains haskell-src-exts-1.20.3 compatible with hoogle-5.0.17.3 while the current latest hoogle-5.0.17.9 is only compatible with haskell-src-exts-1.21.0.
Regarding the original problem with Couldn't find hoogle in path after installing. This shouldn't happen, may be a bug. - I see why that happens and I'll try to find a good way to resolve it.

@qrilka qrilka referenced this issue Jul 13, 2019
1 of 2 tasks complete
@qrilka

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2019

@dnadales #4958 should resolve the problem of finding automatically installed hoogle but it won't resolve the problem with hoogle dependencies, there is a workaround for that - add haskell-src-exts-1.21.0 as an extra dep or use nightly-2019-07-13.
@snoyberg do you remember why do we install the latest Hoogle version? Currently it's only compatible with latest nightlies and none of LTS snapshots which makes stack hoogle broken.

@dnadales

This comment has been minimized.

Copy link

commented Jul 13, 2019

@snoyberg

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2019

@dnadales

This comment has been minimized.

Copy link

commented Sep 25, 2019

Sorry to bother again, any ideas on when #4958 will be merged? And is there a workaround I could use in the meantime? To be clear, the dependencies are fine, every builds, but then the stack hoogle -- generate --local aborts with:

Completed 113 action(s).
Updating Haddock index for snapshot packages in
/home/damian/.stack/snapshots/x86_64-linux/0e94316e99f81e3ac1ab0694f30d2ebaa7c886929bfb5e7dda8a77d0184e0842/8.6.5/doc/index.html
Couldn't find hoogle in path after installing.  This shouldn't happen, may be a bug.
@qrilka

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2019

@dnadales did you try Stack with #4958 applied? While the PR will fix the problem for LTS-14 it won't work with LTSes before that and could break because of future hoogle updates. I'll create a PR with installing hoogle from spanshot and that should be a proper fix. Regarding this partial fix - I'm not quite sure why it wasn't yet merged

@dnadales

This comment has been minimized.

Copy link

commented Sep 26, 2019

@dnadales did you try Stack with #4958 applied?

No I didn't. Would this work if I build stack with #4958 and run the generated binary (I don't want to install a development version of stack globally.

won't work with LTSes before

Oh, I'm working with the 13.X LTS :(

I'll create a PR with installing hoogle from spanshot and that should be a proper fix.

Great! Thanks!

@qrilka

This comment has been minimized.

Copy link
Contributor

commented Sep 27, 2019

@dnadales the problem with version should be fixed by #5042 - it would be great if you could test stack from that PR (for sure you could just build stack locally and use it with your project without installing globally)

@dnadales

This comment has been minimized.

Copy link

commented Oct 10, 2019

@qrilka sorry for taking so much time to respond. I had a huge backlog.

I can confirm that #5042 fixes it! ❤️

Any ideas on what I could do to get this fix ASAP on a relatively stable stack version? I guess using the version from master is not recommended for production use. Alternatively I could make a script that uses a different STACK_ROOT and PROJECT_ROOT only for using hoogle? 🤷‍♂

@qrilka

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2019

I guess @borsboom or @snoyberg could answer about current release plans. Regarding your last question - I don't quite understand how could you resolve this problem in Stack by changing either STACK_ROOT or PROJECT_ROOT...

@dnadales

This comment has been minimized.

Copy link

commented Oct 11, 2019

  • I don't quite understand how could you resolve this problem in Stack by changing either STACK_ROOT or PROJECT_ROOT...

Sorry, I should have been more clear. What I meant is that if I need to run a hoogle server I can use the stack version on master, however I don't think it is a good idea to have different stack versions sharing the same STACK_ROOT and PROJECT_ROOT, so that's why I thought of having the stack version on master use different directories. Does that make sense?

@qrilka

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2019

You could do that, sure. But that would be a substantial duplication in terms of disk space and CPU usage :) BTW the PRs were merged into stable not master (but I think that the current master shouldn't be far away from stable)

@dnadales

This comment has been minimized.

Copy link

commented Oct 11, 2019

You could do that, sure. But that would be a substantial duplication in terms of disk space and CPU usage :)

It will use more disk sure, but that shouldn't be a problem. And it would be a temporary workaround.

BTW the PRs were merged into stable not master (but I think that the current master shouldn't be far away from stable)

Oh, that's good to know! I guess I could just give stable a try...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.