Skip to content

Doesn't even build on Mac with cabal: internal error in InstallPlan.completed #194

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

Closed
mouse07410 opened this issue Jul 12, 2020 · 11 comments
Labels
CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@mouse07410
Copy link

mouse07410 commented Jul 12, 2020

MacOS Catalina 10.15.5, Xcode-11.5, Cabal-3.2.0.0, GHC-8.10.1, 8.8.3, 8.6.5. Stack-2.3.1 installed, but prefer to build with Cabal:

$ git clone https://github.com/haskell/haskell-language-server --recurse-submodules
Cloning into 'haskell-language-server'...
remote: Enumerating objects: 2026, done.
remote: Total 2026 (delta 0), reused 0 (delta 0), pack-reused 2026
Receiving objects: 100% (2026/2026), 453.12 KiB | 1.27 MiB/s, done.
Resolving deltas: 100% (1141/1141), done.
Submodule 'ghcide' (https://github.com/wz1000/ghcide.git) registered for path 'ghcide'
Cloning into '/Users/ur20980/src/haskell-language-server/ghcide'...
remote: Enumerating objects: 58, done.        
remote: Counting objects: 100% (58/58), done.        
remote: Compressing objects: 100% (38/38), done.        
remote: Total 7644 (delta 21), reused 31 (delta 9), pack-reused 7586        
Receiving objects: 100% (7644/7644), 2.30 MiB | 25.62 MiB/s, done.
Resolving deltas: 100% (4362/4362), done.
Submodule path 'ghcide': checked out '747ec1401c62257ec849319eb2dda966a8008b09'
$ cd haskell-language-server/
$ git submodule update --init --recursive
$ time ./cabal-hls-install hls
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - base16-bytestring-0.1.1.7 (lib) (requires download & build)
 - cabal-doctest-1.0.8 (lib) (requires build)
 - cryptohash-sha256-0.11.101.0 (lib) (requires build)
 - dlist-0.8.0.8 (lib) (requires build)
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - js-dgtable-0.5.2 (lib) (requires build)
 - unordered-containers-0.2.11.0 (lib) (requires build)
 - scientific-0.3.6.2 (lib) (requires build)
 - splitmix-0.1 (lib) (requires download & build)
 - tar-0.5.1.1 (lib) (requires build)
 - vector-binary-instances-0.2.5.1 (lib) (requires build)
 - extra-1.7.3 (lib) (requires build)
 - distributive-0.6.2 (lib:distributive) (requires build)
internal error in InstallPlan.completed: not in configured state: Installed lkk-0.1.1.2-5c05fa72
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:260:25 in main:Distribution.Client.InstallPlan
  internalError, called at ./Distribution/Client/InstallPlan.hs:656:26 in main:Distribution.Client.InstallPlan

real	0m2.887s
user	0m1.655s
sys	0m0.453s

$ ./cabal-hls-install ghcs
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - base16-bytestring-0.1.1.7 (lib) (requires download & build)
 - cabal-doctest-1.0.8 (lib) (requires build)
 - cryptohash-sha256-0.11.101.0 (lib) (requires build)
 - dlist-0.8.0.8 (lib) (requires build)
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - js-dgtable-0.5.2 (lib) (requires build)
 - unordered-containers-0.2.11.0 (lib) (requires build)
 - scientific-0.3.6.2 (lib) (requires build)
 - splitmix-0.1 (lib) (requires download & build)
 - tar-0.5.1.1 (lib) (requires build)
 - vector-binary-instances-0.2.5.1 (lib) (requires build)
 - extra-1.7.3 (lib) (requires build)
 - distributive-0.6.2 (lib:distributive) (requires build)
internal error in InstallPlan.completed: not in configured state: Installed lkk-0.1.1.2-5c05fa72
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:260:25 in main:Distribution.Client.InstallPlan
  internalError, called at ./Distribution/Client/InstallPlan.hs:656:26 in main:Distribution.Client.InstallPlan
@jneira jneira added CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. os: macos status: needs repro labels Jul 12, 2020
@jneira
Copy link
Member

jneira commented Jul 12, 2020

It seems the problem is related with the lukko library, a dependency of the install script itself.
It's strange you are getting the error with hls but no for hie, cause the hls install script was copied from the hie one and they have the same dependencies, including lukko.
What is the result of cd ./install && cabal build lukko?

@mouse07410
Copy link
Author

mouse07410 commented Jul 12, 2020

First, I gave it a try with stack, and (of course!) it failed. I guess nobody tried dynamic builds before.

$ cd ./install
$ cabal build lukko
. . . . .
    include time-1.9.3
    include transformers-0.5.6.2
    Cabal.Config=cbl-nstll-prsrs-0.3.0.1-64285a08:Cabal.Config,Cabal.Index=cbl-nstll-prsrs-0.3.0.1-64285a08:Cabal.Index,Cabal.Optimization=cbl-nstll-prsrs-0.3.0.1-64285a08:Cabal.Optimization,Cabal.Package=cbl-nstll-prsrs-0.3.0.1-64285a08:Cabal.Package,Cabal.Parse=cbl-nstll-prsrs-0.3.0.1-64285a08:Cabal.Parse,Cabal.Project=cbl-nstll-prsrs-0.3.0.1-64285a08:Cabal.Project,Cabal.SourceRepo=cbl-nstll-prsrs-0.3.0.1-64285a08:Cabal.SourceRepo
Component graph for hls-install-0.8.0.0: component lib
component hls-install-0.8.0.0-inplace
    include base-4.13.0.0
    include cbl-nstll-prsrs-0.3.0.1-64285a08
    include directory-1.3.6.0
    include xtr-1.7.3-ec27bac7
    include filepath-1.4.2.1
    include shk-0.18.5-621fcfb7
    include text-1.2.4.0
unit hls-install-0.8.0.0-inplace
    include base-4.13.0.0
    include cbl-nstll-prsrs-0.3.0.1-64285a08
    include directory-1.3.6.0
    include xtr-1.7.3-ec27bac7
    include filepath-1.4.2.1
    include shk-0.18.5-621fcfb7
    include text-1.2.4.0
    HlsInstall=hls-install-0.8.0.0-inplace:HlsInstall
Up to date
creating
/Users/ur20980/src/haskell-language-server/install/dist-newstyle/build
creating /Users/ur20980/src/haskell-language-server/install/dist-newstyle/tmp
$ cabal install lukko --lib
Wrote tarball sdist to
/Users/ur20980/src/haskell-language-server/install/dist-newstyle/sdist/hls-install-0.8.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - process-1.6.10.0 (lib:process) (requires download & build)
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - lukko-0.1.1.2 (lib) (requires build)
Downloading  process-1.6.10.0
Downloaded   process-1.6.10.0
Starting     process-1.6.10.0 (all, legacy fallback)
Building     process-1.6.10.0 (all, legacy fallback)
Haddock      process-1.6.10.0 (all, legacy fallback)
Installing   process-1.6.10.0 (all, legacy fallback)
Completed    process-1.6.10.0 (all, legacy fallback)
Starting     hsc2hs-0.68.7 (exe:hsc2hs)
Building     hsc2hs-0.68.7 (exe:hsc2hs)
Installing   hsc2hs-0.68.7 (exe:hsc2hs)
Completed    hsc2hs-0.68.7 (exe:hsc2hs)
Starting     lukko-0.1.1.2 (lib)
Building     lukko-0.1.1.2 (lib)
Haddock      lukko-0.1.1.2 (lib)
Installing   lukko-0.1.1.2 (lib)
Completed    lukko-0.1.1.2 (lib)
$ 

But if HLS gives such hiccups with GHC-8.8.3, I rather doubt it would do anything sensible with 8.10.1 - and for me the whole point is making it possible to use IDE (VS Code) with GHC-8.10.1. For 8.8.3 I can happily stay with HIE that works...

Update

Seeing that Cabal complains about "configuration", I decided to try in the blind:

$ ./cabal-hls-install hls-8.8.3
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - base16-bytestring-0.1.1.7 (lib) (requires download & build)
 - cabal-doctest-1.0.8 (lib) (requires build)
 - cryptohash-sha256-0.11.101.0 (lib) (requires build)
 - dlist-0.8.0.8 (lib) (requires build)
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - js-dgtable-0.5.2 (lib) (requires build)
 - unordered-containers-0.2.11.0 (lib) (requires build)
 - scientific-0.3.6.2 (lib) (requires build)
 - splitmix-0.1 (lib) (requires download & build)
 - tar-0.5.1.1 (lib) (requires build)
 - vector-binary-instances-0.2.5.1 (lib) (requires build)
 - extra-1.7.3 (lib) (requires build)
 - distributive-0.6.2 (lib:distributive) (requires build)
internal error in InstallPlan.completed: not in configured state: Installed lkk-0.1.1.2-5c05fa72
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:260:25 in main:Distribution.Client.InstallPlan
  internalError, called at ./Distribution/Client/InstallPlan.hs:656:26 in main:Distribution.Client.InstallPlan
$ cabal v2-configure
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following would be built (use -v for more details):
 - Diff-0.4.0 (lib) (requires build)
 - blaze-markup-0.8.2.7 (lib) (requires download & build)
 - base16-bytestring-0.1.1.7 (lib) (requires download & build)
 - call-stack-0.2.0 (lib) (requires build)
 - cryptohash-sha1-0.11.100.1 (lib) (requires build)
 - czipwith-1.0.1.3 (lib) (requires download & build)
 - uuid-types-1.0.3 (lib) (requires build)
 - dec-0.0.3 (lib) (requires build)
 - dlist-0.8.0.8 (lib) (requires build)
 - data-default-0.7.1.1 (requires build)
 - data-tree-print-0.1.0.2 (lib) (requires build)
 - file-embed-0.0.12.0 (lib) (requires build)
 - ghc-paths-0.1.0.12 (requires build)
 - ghc-tcplugins-extra-0.4 (lib) (requires download & build)
 - ghcide-0.2.0 (exe:ghcide-test-preprocessor) (first run)
 - githash-0.1.4.0 (lib) (requires build)
 - gitrev-1.3.1 (lib) (requires build)
 - haddock-library-1.9.0 (lib) (requires download & build)
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - haskell-src-exts-1.23.1 (lib) (requires download & build)
 - hspec-discover-2.7.1 (exe:hspec-discover) (requires build)
 - js-dgtable-0.5.2 (lib) (requires build)
 - alex-3.2.5 (exe:alex) (requires build)
 - microlens-0.4.11.2 (lib) (requires build)
 - multistate-0.8.0.3 (lib) (requires download & build)
 - monad-memo-0.5.1 (lib) (requires build)
 - unbounded-delays-0.1.1.0 (requires build)
 - unordered-containers-0.2.11.0 (lib) (requires build)
 - unsafe-0.0 (requires build)
 - parallel-3.2.2.0 (lib) (requires build)
 - primes-0.2.1.0 (requires build)
 - prettyprinter-1.6.2 (lib) (requires download & build)
 - psqueues-0.2.7.2 (lib) (requires build)
 - quickcheck-io-0.2.0 (lib) (requires build)
 - reflection-2.1.6 (lib) (requires download & build)
 - regex-tdfa-1.3.1.0 (lib) (requires build)
 - rope-utf16-splay-0.3.1.0 (lib) (requires build)
 - scientific-0.3.6.2 (lib) (requires build)
 - split-0.2.3.4 (lib) (requires build)
 - sorted-list-0.2.1.0 (lib) (requires build)
 - strict-0.3.2 (requires build)
 - tf-random-0.5 (lib) (requires build)
 - these-1.1 (lib) (requires build)
 - topograph-1.0.0.1 (lib) (requires build)
 - vector-algorithms-0.8.0.3 (lib) (requires build)
 - void-0.7.3 (lib) (requires build)
 - wcwidth-0.0.2 (requires build)
 - exceptions-0.10.4 (lib) (requires build)
 - extra-1.7.3 (lib) (requires build)
internal error in InstallPlan.completed: not in configured state: Installed hspc-xpcttns-0.8.2-1b1e5e90
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:260:25 in main:Distribution.Client.InstallPlan
  internalError, called at ./Distribution/Client/InstallPlan.hs:656:26 in main:Distribution.Client.InstallPlan
$ cabal v2-install --dependencies-only
Wrote tarball sdist to
/Users/ur20980/src/haskell-language-server/dist-newstyle/sdist/haskell-language-server-0.2.0.0.tar.gz
Wrote tarball sdist to
/Users/ur20980/src/haskell-language-server/dist-newstyle/sdist/ghcide-0.2.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - base-compat-batteries-0.11.1 (lib) (requires build)
 - base16-bytestring-0.1.1.7 (lib) (requires download & build)
 - clock-0.8 (lib) (requires build)
 - comonad-5.0.6 (lib:comonad) (requires build)
 - czipwith-1.0.1.3 (lib) (requires download & build)
 - dlist-0.8.0.8 (lib) (requires build)
 - filepattern-0.1.2 (lib) (requires build)
 - ghc-check-0.5.0.1 (lib) (requires download & build)
 - ghc-lib-parser-8.10.1.20200523 (lib) (requires download & build)
 - githash-0.1.4.0 (lib) (requires build)
 - haddock-library-1.9.0 (lib) (requires download & build)
 - haskell-src-exts-1.23.1 (lib) (requires download & build)
 - js-dgtable-0.5.2 (lib) (requires build)
 - js-jquery-3.3.1 (lib) (requires build)
 - multistate-0.8.0.3 (lib) (requires download & build)
 - unordered-containers-0.2.11.0 (lib) (requires build)
 - network-3.1.1.1 (lib:network) (requires build)
 - network-uri-2.6.3.0 (lib) (requires build)
 - opentelemetry-0.4.2 (lib) (requires download & build)
 - primitive-0.7.1.0 (lib) (requires build)
 - prettyprinter-1.6.2 (lib) (requires download & build)
 - reflection-2.1.6 (lib) (requires download & build)
 - sorted-list-0.2.1.0 (lib) (requires build)
 - typed-process-0.2.6.0 (lib) (requires build)
 - void-0.7.3 (lib) (requires build)
internal error in InstallPlan.completed: not in configured state: Installed xtr-1.7.3-3da6d11d
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:260:25 in main:Distribution.Client.InstallPlan
  internalError, called at ./Distribution/Client/InstallPlan.hs:656:26 in main:Distribution.Client.InstallPlan

Sorry to sound harsh, but this isn't even beta-ready...

@jneira
Copy link
Member

jneira commented Jul 13, 2020

Thanks for the report and for updating the related cabal issue. It seems cabal is the main culprit here and that removing the cabal store could be a workaround, have you tried it?

@jneira jneira added status: blocked Not actionable, because blocked by upstream/GHC etc. and removed status: needs repro os: macos labels Jul 13, 2020
@jneira jneira changed the title Doesn't even build on Mac Doesn't even build on Mac with cabal: internal error in InstallPlan.completed Jul 13, 2020
@lukel97
Copy link
Collaborator

lukel97 commented Jul 13, 2020

As does indeed seem like an issue with Cabal upstream. For what it's worth I can't recreate it on Catalina either, so nuking ~/.cabal/store is probably your best bet

@mouse07410
Copy link
Author

mouse07410 commented Jul 14, 2020

Wiped out the entire Cabal installation (only about 14GB worth of binaries), re-installed. Updated the repo clone to the latest (as of this evening). After third or so "reincarnation", the Cabal-based build with GHC-8.8.3 succeeded (assuming you care to see the "good" log): cabal-8.8.3-out.txt

Is it supposed to work with GHC-8.10.1? Or it's not worth even trying, lest it just messes up my installation? Yes, it appears to work correctly. Build on two Macs with GHC-8.10.1 succeeded.

Also, ./cabal-hls-install data is not supposed to work? Any reason why...?

$ ./cabal-hls-install data
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - fake-package-0 (exe:script) (configuration changed)
Configuring executable 'script' for fake-package-0..
Preprocessing executable 'script' for fake-package-0..
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main             ( Main.hs, /Users/ur20980/src/haskell-language-server/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )
Linking /Users/ur20980/src/haskell-language-server/dist-newstyle/build/x86_64-osx/ghc-8.8.3/fake-package-0/x/script/build/script/script ...
# cabal (for check)
# git (for submodules)
Synchronizing submodule url for 'ghcide'
# git (for submodules)
Options:
    Verbosity level: Info
Generation of hoogle data files is disabled for now.
Build completed in 0.25s

@jneira
Copy link
Member

jneira commented Jul 14, 2020

data is the command to generate the hoogle database with docs for a good number of haskell libraries. It is used in hie for show docs on hover as last resort when local generated docs are not available for a library.
The hoogle plugin that will reproduce that behaviour in hls is not ported yet so you have to build your project and dependencies with doc generation enabled. You can can enable it with the documentation: true in cabal.project.

@lukel97
Copy link
Collaborator

lukel97 commented Jul 14, 2020

Corrupted ~/.cabal/store strikes again! I think this can be closed now, feel free to reopen if something else goes wrong

@lukel97 lukel97 closed this as completed Jul 14, 2020
@mouse07410
Copy link
Author

you have to build your project and dependencies with doc generation enabled

So, if my ~/.cabal/config says documentation: True - for my projects I should not even notice that hls is built without docs? Or can it bite me if my project would happen to use the same dependencies/libraries as hls does?

You can can enable it with the documentation: true in cabal.project

Understood, thanks. But you don't recommend it at the moment?

Corrupted ~/.cabal/store strikes again!

Darn, yes. And on Mac cabal-store-check contributes to that by nuking ~/.cabal/lib/ directory regardless of anything else found or not found. :-(

@jneira
Copy link
Member

jneira commented Jul 14, 2020

Or can it bite me if my project would happen to use the same dependencies/libraries as hls does?

In general that should not be a problem, cabal or stack will build as many versions as necessary and reuse the compatible ones.

Understood, thanks. But you don't recommend it at the moment?

It makes builds slower but you will have docs on hover (and it worths it imo). If you have documentation enabled globally it would not be necessary.

@mouse07410
Copy link
Author

@jneira

You can can enable it with the documentation: true in cabal.project

Understood, thanks. But you don't recommend it at the moment?

It makes builds slower but you will have docs on hover (and it worths it imo). If you have documentation enabled globally it would not be necessary.

Let me clarify my question.

My ~/.cabal/config has documentation: True setting. It looks like haskell-language-server has been built without it. I'm trying to figure whether my projects would be impacted by this.

I.e., if I'm merely a user of haskell-language-server - should it matter to me whether it's built with or without documentation? My goal is to have documentation for everything in my source code, and (probably) whatever dependencies it happens to pull. Do I need to build haskell-language-server with documentation enabled for that? (Intuitively, it seems that I don't - but it's more prudent to ask!)

Thanks!

@jneira
Copy link
Member

jneira commented Jul 15, 2020

Do I need to build haskell-language-server with documentation enabled for that? (Intuitively, it seems that I don't - but it's more prudent to ask!)

This time the intuition is right, we have documentation enabled for hls to have docs while developing hls itself.

@jneira jneira removed the status: blocked Not actionable, because blocked by upstream/GHC etc. label Jul 15, 2020
pepeiborra pushed a commit that referenced this issue Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants