Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

install.hs build-doc fails with incorrect header check error #1158

Closed
ThePiGuy0 opened this issue Apr 4, 2019 · 11 comments
Closed

install.hs build-doc fails with incorrect header check error #1158

ThePiGuy0 opened this issue Apr 4, 2019 · 11 comments
Labels
build Continuous integration and building resolution: wontfix
Milestone

Comments

@ThePiGuy0
Copy link

ThePiGuy0 commented Apr 4, 2019

When building HIE, I ran the stack ./install.hs hie-8.4.3 (same with 8.6.4) command and then ran stack ./install.hs build-doc-8.4.3. This resulted in the following error

Synchronising submodule url for 'submodules/HaRe'
Synchronising submodule url for 'submodules/HaRe/submodules/cabal-helper'
Synchronising submodule url for 'submodules/HaRe/submodules/ghc-mod'
Synchronising submodule url for 'submodules/brittany'
Synchronising submodule url for 'submodules/cabal-helper'
Synchronising submodule url for 'submodules/floskell'
Synchronising submodule url for 'submodules/ghc-mod'
# git (for submodules)
# stack (for cabal)
# stack (for cabal)
Copying from /home/thepiguy0/.stack/snapshots/x86_64-linux-tinfo6/nightly-2018-12-15/8.6.2/bin/cabal to /home/thepiguy0/.local/bin/cabal

Copied executables to /home/thepiguy0/.local/bin:
- cabal

Warning: The cabal executable found on the PATH environment variable is
         /home/thepiguy0/.stack/snapshots/x86_64-linux-tinfo6/nightly-2018-12-15/8.6.2/bin/cabal and not the version that was just installed. This
         means that cabal calls on the command line will not use this version.
# cabal (for cabal)
Warning: The update command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-update command
or the legacy v1-update alias as new-style projects will become the default in
the next version of cabal-install. Please file a bug if you cannot replicate a
working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Downloading the latest package list from hackage.haskell.org
To revert to previous state run:
    cabal update --index-state='2019-04-04T19:07:28Z'
# cabal (for cabal)
Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Resolving dependencies...
All the requested packages are already installed:
Cabal-2.4.1.0
Use --reinstall if you want to reinstall anyway.
# hoogle (for stack-build-doc)
Starting generate
Reading Cabal... hoogle: Codec.Compression.Zlib: compressed data stream format error (incorrect header check)
Error when running Shake build system:
  at src/Development/Shake/Internal/Args.hs:81:69-79:
* Depends on: build-doc-8.4.3
  at /home/thepiguy0/Programs/haskell-ide-engine/install.hs:93:9-33:
* Depends on: stack-build-doc
* Raised the exception:
user error (Development.Shake.command_, system command failed
Command: hoogle generate
Exit code: 1
Stderr:
hoogle: Codec.Compression.Zlib: compressed data stream format error (incorrect header check)
)

I have run this command before (up until recently with the makefile) and this is the first time I have had this issue

@fendor
Copy link
Collaborator

fendor commented Apr 4, 2019

Maybe this is related to the downtime of hackage today? Can you reproduce it, e.g. invoking it several times results in the same error message?

@ThePiGuy0
Copy link
Author

ThePiGuy0 commented Apr 4, 2019

Repeating the command (with both 8.6.4 and 8.4.3) produces the same error
Edit: This was a couple of hours ago so I can check now and see if it still occurs if this would be useful
Edit2: The error still occurs as of now

@alejandrodnm
Copy link

alejandrodnm commented Apr 5, 2019

I've been having this issue for a couple of days, for me, it only happens when using stack ./install.hs build-doc-8.6.3, if I do it with stack --stack-yaml=stack-8.6.3.yaml hoogle generate it starts generating the docs, but then it encounters a different error related to haddock-api.

    src/Haddock/Backends/LaTeX.hs:246:32: error:
        parse error on input ‘-- ^ to print before each name in an export list’
        |
    246 |           -> ( LaTeX           -- ^ to print before each name in an export list
        |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I found this PR haskell/haddock#957 which fixes the haddock docs inside haddock-api but it hasn't been merged.

Any help on how to proceed would be appreciated.

@alejandrodnm
Copy link

I manage to build the haddoc db with the following steps, I'm just learning Haskell and its ecosystem so maybe there is a better way.

  • Use haddoc-api directly github. In stack-8.6.3.yaml apply the following changes.
- - haddock-api-2.21.0
+ - github: haskell/haddock
+   commit: 8964666efc4d4ab9756a83d16a02115a38744408
+   subdirs:
+     - haddock-api

This relates to the bug in my previous comment

  • Fix HaRe MaybeToMonadPlus line 216

$ vim submodules/HaRe/src/Language/Haskell/Refact/Refactoring/MaybeToMonadPlus.hs +216

-            -- *| (GHC.occNameString . GHC.rdrNameOcc) nm == funNm = do
+            -- (GHC.occNameString . GHC.rdrNameOcc) nm == funNm = do

This is because I was getting the following error

    src/Language/Haskell/Refact/Refactoring/MaybeToMonadPlus.hs:216:13: error:
        parse error on input ‘-- *| (GHC.occNameString . GHC.rdrNameOcc) nm == funNm = do’
        |
    216 |             -- *| (GHC.occNameString . GHC.rdrNameOcc) nm == funNm = do
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • I started getting the following error:
    Preprocessing library 'hie-test-utils' for haskell-ide-engine-0.7.0.0..
    Running Haddock on library 'hie-test-utils' for haskell-ide-engine-0.7.0.0..
    Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.3: internal error when calculating
    transitive package dependencies.

To solve it, I just removed from haskell-ide-engine.cabal the -library hie-test-utils and -test-suite <something> entries.

  • Because stack ./install.hs build-doc-8.6.3 was giving me the Zlib header check error, I executed the command stack --stack-yaml=stack-8.6.3.yaml hoogle generate.

This generated the hoogle db in <haskell-ide-engine project directory>/.stack-work/hoogle/x86_64-osx/lts-13.10/8.6.3/database.hoo; with that, I set the HIE_HOOGLE_DATABASE env var to the database.hoo location.

@lukel97
Copy link
Collaborator

lukel97 commented Apr 8, 2019

The ‘hie-test-utils’ error can also be caused by an outdated version of stack. Does stack upgrade fix that issue?

@ThePiGuy0
Copy link
Author

ThePiGuy0 commented Apr 8, 2019

@fendor @bubba I'm still getting the original error (having run stack upgrade, pulled the latest hie source code and having re-run the stack ./install.hs hie-8.6.4 beforehand). Should I be following @alejandrodnm and using stack --stack-yaml=stack-8.6.4.yaml hoogle generate?
Edit: Correct the stack version for my issue

@fendor fendor added the build Continuous integration and building label Apr 10, 2019
@alejandrodnm
Copy link

Running stack upgrade did nothing for me, it said that I was running the latest version.

$ stack --version

Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

I try again with the latest changes from master and got the same results.

I'm on macOS Mojave and I installed stack with the instruction of https://docs.haskellstack.org/en/stable/README/#how-to-install which is justcurl -sSL https://get.haskellstack.org/ | sh

@samuelpilz
Copy link
Contributor

The original error seems to be an issue of hoogle generate. I have such errors regularly as well but I am never able to reproduce them and they vanish fairly quickly (deleting .stack-work / calling git clean -Xdf helps sometimes).

I am unable to understand what you did in your comment afterwards.

  • does stack ./install.hs hie-8.4.4 work? Did it always work?
  • does stack ./install.hs build-doc-8.4.3 produce the error? Is this error still present? In this case, please check out my PR Build simplifications #1168, which changes these commands: stack ./install.hs build-doc is the new target for the hoogle database (version-independent)

@ThePiGuy0
Copy link
Author

ThePiGuy0 commented Apr 18, 2019

@power-fungus I'm not sure what's changed (I did change my Linux distro so maybe that had some effect) but suddenly everything is working perfectly (at least for the 8.6.4 release which didn't work before).

To answer your questions, stack ./install.hs hie-8.6.4 always worked but stack ./install.hs build-doc-8.6.4 always produced my original error (alongside other stack versions as well).

I need 8.4.3 as well which was another problematic release so I'll see if that's solved as well

Edit: yep 8.4.3 worked fine for both commands as well. As far as I'm concerned, this is no longer an issue but I don't know what fixed it

@samuelpilz
Copy link
Contributor

Same here. This is probably a deployment issue on hackage but what do I know.

@fendor
Copy link
Collaborator

fendor commented Apr 20, 2019

If it is a temporary hackage error, we won't fix it here! Maybe the pr #1168 fixed it by removing redundant hoogle targets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Continuous integration and building resolution: wontfix
Projects
None yet
Development

No branches or pull requests

6 participants