haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 211 forks source link

Doesn't build anymore: internal error in InstallPlan.completed #1580

Open hasufell opened 4 years ago

hasufell commented 4 years ago

Don't know why, maybe a cabal store issue, but leaving here for reference.

Commit f4600b795178e937f93170d4af98f8cecab23184

$ cabal v2-run ./install.hs --project-file install/shake.project hie-8.6.5
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - hie-install-0.8.0.0 (lib) (configuration changed)
 - fake-package-0 (exe:script) (configuration changed)
Configuring library for hie-install-0.8.0.0..
Preprocessing library for hie-install-0.8.0.0..
Building library for hie-install-0.8.0.0..
[1 of 8] Compiling BuildSystem      ( src/BuildSystem.hs, /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hie-install-0.8.0.0/build/BuildSystem.o ) [/home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hie-install-0.8.0.0/build/autogen/cabal_macros.h changed]
[4 of 8] Compiling Env              ( src/Env.hs, /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hie-install-0.8.0.0/build/Env.o )
[5 of 8] Compiling Stack            ( src/Stack.hs, /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hie-install-0.8.0.0/build/Stack.o )
[6 of 8] Compiling Cabal            ( src/Cabal.hs, /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hie-install-0.8.0.0/build/Cabal.o )
[7 of 8] Compiling Help             ( src/Help.hs, /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hie-install-0.8.0.0/build/Help.o )
[8 of 8] Compiling HieInstall       ( src/HieInstall.hs, /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/hie-install-0.8.0.0/build/HieInstall.o )
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, /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/fake-package-0/x/script/build/script/script-tmp/Main.o )
Linking /home/jule/git/haskell-ide-engine/dist-newstyle/build/x86_64-linux/ghc-8.6.5/fake-package-0/x/script/build/script/script ...
# git (for submodules)
# git (for submodules)
# cabal (for check)
# cabal (for hie-8.6.5)
# cabal (for hie-8.6.5)
Wrote tarball sdist to
/home/jule/git/haskell-ide-engine/dist-newstyle/sdist/haskell-ide-engine-1.0.0.0.tar.gz
Wrote tarball sdist to
/home/jule/git/haskell-ide-engine/dist-newstyle/sdist/hie-plugin-api-1.0.0.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - cabal-doctest-1.0.8 (lib) (requires build)
 - cabal-plan-0.6.2.0 (lib) (requires build)
 - ghc-lib-parser-8.8.1 (lib) (requires download & build)
 - optparse-applicative-0.14.3.0 (lib) (requires download & build)
internal error in InstallPlan.completed
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:262:25 in main:Distribution.Client.InstallPlan
Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shake-0.18.4-0402ec806be7121617d2cc33ed2aa9f37bfa96a41220f814ded3fcacab3c1e62:Development.Shake.Internal.Args
* Depends on: hie-8.6.5
  at command, called at src/Cabal.hs:39:14 in hie-install-0.8.0.0-inplace:Cabal
* Raised the exception:
Development.Shake.command, system command failed
Command line: cabal v2-install -w /home/jule/.ghcup/bin/ghc-8.6.5 --write-ghc-environment-files=never --installdir /home/jule/.cabal/bin --max-backjumps=5000 exe:hie --overwrite-policy=always
Exit code: 1
Stderr:
internal error in InstallPlan.completed
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/InstallPlan.hs:262:25 in main:Distribution.Client.InstallPlan
Avi-D-coder commented 4 years ago

Try building #1579

AlexeyRaga commented 4 years ago

Same here. The first warning looks strange...

Failed to build cabal-helper-1.0.0.0.
Build log ( /Users/araga/.cabal/logs/ghc-8.6.5/cbl-hlpr-1.0.0.0-6451f928.log
):
Configuring library for cabal-helper-1.0.0.0..
Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package cabal-helper (cbl-hlpr-1.0.0.0-fe302886) requires cbl-pln-0.6.2.0-a418802b
      package cabal-helper (cabal-helper-1.0.0.0) requires cbl-pln-0.6.2.0-e9dc4fb4
Preprocessing library for cabal-helper-1.0.0.0..
Building library for cabal-helper-1.0.0.0..
[1 of 3] Compiling Distribution.Helper ( lib/Distribution/Helper.hs, dist/build/Distribution/Helper.o )

lib/Distribution/Helper.hs:591:68: error:
    • Couldn't match expected type ‘cabal-plan-0.6.2.0:Cabal.Plan.PlanJson’
                  with actual type ‘PlanJson’
      NB: ‘PlanJson’
            is defined in ‘Cabal.Plan’ in package ‘cabal-plan-0.6.2.0’
          ‘cabal-plan-0.6.2.0:Cabal.Plan.PlanJson’
            is defined in ‘Cabal.Plan’ in package ‘cabal-plan-0.6.2.0’
    • In the first argument of ‘CabalInstall.planPackages’, namely
        ‘plan’
      In the second argument of ‘(<$>)’, namely
        ‘CabalInstall.planPackages plan’
      In a stmt of a 'do' block:
        Just pkgs <- NonEmpty.nonEmpty <$> CabalInstall.planPackages plan
    |
591 |       Just pkgs <- NonEmpty.nonEmpty <$> CabalInstall.planPackages plan
    |                                                                    ^^^^

lib/Distribution/Helper.hs:597:24: error:
    • Couldn't match expected type ‘cabal-plan-0.6.2.0:Cabal.Plan.PlanJson’
                  with actual type ‘PlanJson’
      NB: ‘PlanJson’
            is defined in ‘Cabal.Plan’ in package ‘cabal-plan-0.6.2.0’
          ‘cabal-plan-0.6.2.0:Cabal.Plan.PlanJson’
            is defined in ‘Cabal.Plan’ in package ‘cabal-plan-0.6.2.0’
    • In the ‘piV2Plan’ field of a record
      In the ‘piImpl’ field of a record
      In the first argument of ‘return’, namely
        ‘ProjInfo
           {piCabalVersion = makeDataVersion pjCabalLibVersion,
            piProjConfModTimes = pcm,
            piPackages = NonEmpty.sortWith pPackageName pkgs,
            piImpl = ProjInfoV2
                       {piV2Plan = plan, piV2PlanModTime = plan_mtime,
                        piV2CompilerId = (Text.unpack compName, makeDataVersion compVer)}}’
    |
597 |           { piV2Plan = plan
    |                        ^^^^

lib/Distribution/Helper.hs:835:59: error:
    • Couldn't match expected type ‘PlanJson’
                  with actual type ‘cabal-plan-0.6.2.0:Cabal.Plan.PlanJson’
      NB: ‘cabal-plan-0.6.2.0:Cabal.Plan.PlanJson’
            is defined in ‘Cabal.Plan’ in package ‘cabal-plan-0.6.2.0’
          ‘PlanJson’
            is defined in ‘Cabal.Plan’ in package ‘cabal-plan-0.6.2.0’
    • In the expression: plan
      In a pattern binding:
        PlanJson {pjCabalLibVersion = Ver pjCabalLibVersion} = plan
      In an equation for ‘mkCompHelperEnv’:
          mkCompHelperEnv
            projloc
            (DistDirCabal SCV2 distdir)
            PreInfoCabal
            ProjInfo {piImpl = ProjInfoV2 {piV2Plan = plan}}
            = CompHelperEnv {..}
            where
                cheProjDir = plCabalProjectDir projloc
                cheCabalVer = CabalVersion $ makeDataVersion pjCabalLibVersion
                cheProjLocalCacheDir = distdir </> "cache"
                chePkgDb = Nothing
                ....
    |
835 |     PlanJson {pjCabalLibVersion=Ver pjCabalLibVersion } = plan
    |                                                           ^^^^
cabal: Failed to build cabal-helper-1.0.0.0 (which is required by
exe:hie-wrapper from haskell-ide-engine-1.0.0.0 and exe:hie from
haskell-ide-engine-1.0.0.0). See the build log above for details.
jneira commented 4 years ago

I've got the same error and i reported in cabal: https://github.com/haskell/cabal/issues/6483 It was close as duplicated legitimately, the cause seems to be some uncanny bug with the v2 install.

Workaround:

@hasufell could you do a direct cabal install (running the failed command inside shake f.e.) without using the script to confirm it is the same error?