polysemy-research / polysemy-zoo

:monkey::panda_face: Experimental, user-contributed effects and interpreters for polysemy
BSD 3-Clause "New" or "Revised" License
70 stars 21 forks source link

Generating hoogle database is broken #55

Closed shinzui closed 5 years ago

shinzui commented 5 years ago

I can't generate a local hoogle database (stack hoogle) since it looks like haddock is broken for polysemy-zoo-0.6.0.1. I get the Could not find module ‘Polysemy.Plugin’ error. I suspect it's related to #50.

isovector commented 5 years ago

Try commenting out the first two options, and uncommenting the comments in this block here: https://github.com/polysemy-research/polysemy-zoo/blob/99105616ca08d081b4aa3b04eeda5e9c8bb270fa/package.yaml#L42-L48

That will let you build hoogle, and then revert the changes.

This is the notorious https://github.com/haskell/haddock/issues/900 that never stops biting :(

shinzui commented 5 years ago

Do you know if the issue is resolved in 8.8.1?

shinzui commented 5 years ago

I might be missing something, but those options don't work if I am running them in my project, which depends on polysemy-zoo. I've also tried the workarounds outlined in haskell/haddock#900.

isovector commented 5 years ago

I think you'll need to build the hoogle for polysemy-zoo directly with this change. I've never built a local hoogle repo, so I'm not entirely sure how this works unfortunately.

On Sat, Oct 26, 2019 at 8:34 PM Nadeem Bitar notifications@github.com wrote:

I might be missing something, but those options don't work if I am running them in my project, which depends on polysemy-zoo. I've also tried the workarounds outlined in haskell/haddock#900 https://github.com/haskell/haddock/issues/900.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/polysemy-research/polysemy-zoo/issues/55?email_source=notifications&email_token=AACLAF3U4C52OKLDQDWY7DDQQSER7A5CNFSM4JFN6DE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECKOF5A#issuecomment-546628340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLAF6UFIJX5HLA2EGHEU3QQSER7ANCNFSM4JFN6DEQ .

-- I'm currently travelling the world, sleeping on people's couches and doing full-time collaboration on Haskell projects. If this seems interesting to you, please consider signing up as a host! https://isovector.github.io/erdos/

shinzui commented 5 years ago

Thanks. I'll close for now.

shinzui commented 5 years ago

I was not able to get it to work. This affects the development experience since haskell-ide-engine unfortunately relies on the local hoogle database. Many code actions in vim are unavailable without it.

isovector commented 5 years ago

Let me give this a go. Currently running stack hoogle and will report back.

isovector commented 5 years ago

I was able to successfully build the hoogle database with the following changes:

diff --git a/package.yaml b/package.yaml
index 162fde7..4ca53cb 100644
--- a/package.yaml
+++ b/package.yaml
@@ -38,12 +38,12 @@ dependencies:

 ghc-options:
-  - -fplugin=Polysemy.Plugin
-  - -Wall
+  # - -fplugin=Polysemy.Plugin
+  # - -Wall

-#   # Enable these when building haddock
-#   - -fdefer-type-errors
-#   - -fno-warn-deferred-type-errors
+  # Enable these when building haddock
+  - -fdefer-type-errors
+  - -fno-warn-deferred-type-errors

 default-extensions:
   - DataKinds
diff --git a/stack.yaml b/stack.yaml
index 82b36e9..152610c 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,4 +1,4 @@
-resolver: lts-13.0
+resolver: lts-14.0

 packages:
 - .
@@ -6,10 +6,11 @@ packages:
 extra-deps:
 - polysemy-1.2.0.0
 - polysemy-plugin-0.2.1.0
-- type-errors-0.2.0.0
-- type-errors-pretty-0.0.0.0
-- th-abstraction-0.3.1.0
-- bifunctors-5.5.4
-- first-class-families-0.5.0.0
-- unagi-chan-0.4.1.0

and then via stack install hoogle and stack hoogle.

shinzui commented 5 years ago

Sorry if I wasted your time by not describing the problem accurately. By making your suggested changes, I'm able to build haddock and a local hoogle database inside the polysemy-zoo project. But, I am not able to run stack hoogle in my project. It does not look like the cached version is shared across projects.

I get the following error in my project:

polysemy-zoo     > haddock
polysemy-zoo     > Preprocessing library for polysemy-zoo-0.6.0.1..
polysemy-zoo     > Running Haddock on library for polysemy-zoo-0.6.0.1..
polysemy-zoo     > Warning: The documentation for the following packages are not installed. No
polysemy-zoo     > links will be generated to these packages: fail-4.9.0.0
polysemy-zoo     > <command line>: Could not find module ‘Polysemy.Plugin’
polysemy-zoo     > Use -v to see a list of the files searched for.

--  While building package polysemy-zoo-0.6.0.1 using:
      /Users/shinzui/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/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
Progress 1/2
isovector commented 5 years ago

Sorry. I'd suggest bringing this up with the hoogle guys!

On Sun, Oct 27, 2019 at 12:12 AM Nadeem Bitar notifications@github.com wrote:

Sorry if I wasted your time by not describing the problem accurately. By making your suggested changes, I'm able to build haddock and a local hoogle database inside the polysemy-zoo project. But, I am not able to run stack hoogle in my project. It does not look like the cached version is shared across projects.

I get the following error in my project:

polysemy-zoo > haddock

polysemy-zoo > Preprocessing library for polysemy-zoo-0.6.0.1..

polysemy-zoo > Running Haddock on library for polysemy-zoo-0.6.0.1..

polysemy-zoo > Warning: The documentation for the following packages are not installed. No

polysemy-zoo > links will be generated to these packages: fail-4.9.0.0

polysemy-zoo > : Could not find module ‘Polysemy.Plugin’

polysemy-zoo > Use -v to see a list of the files searched for.

-- While building package polysemy-zoo-0.6.0.1 using:

  /Users/shinzui/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-osx/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

Progress 1/2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/polysemy-research/polysemy-zoo/issues/55?email_source=notifications&email_token=AACLAF45ZW4REQOSJFXOB5DQQS6DZA5CNFSM4JFN6DE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECKR57Q#issuecomment-546643710, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLAFYURBOESOXW4RDEPYTQQS6DZANCNFSM4JFN6DEQ .

-- I'm currently travelling the world, sleeping on people's couches and doing full-time collaboration on Haskell projects. If this seems interesting to you, please consider signing up as a host! https://isovector.github.io/erdos/