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

Current master does not build with GHC-8.10.1 #355

Closed
mouse07410 opened this issue Aug 27, 2020 · 5 comments · Fixed by #356
Closed

Current master does not build with GHC-8.10.1 #355

mouse07410 opened this issue Aug 27, 2020 · 5 comments · Fixed by #356
Assignees
Labels
CI Continuous integration component: plugins type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@mouse07410
Copy link

Cabal-3.2.0.0, GHC-8.10.1.

In short:

src/Ide/Plugin/ImportLens.hs:143:33: error:
    • Couldn't match expected type ‘ImportDeclQualifiedStyle’
                  with actual type ‘Bool’
    • In the pattern: True
      In the pattern: ImportDecl {ideclQualified = True}
      In a stmt of a pattern guard for
                     an equation for ‘generateLens’:
        ImportDecl {ideclQualified = True} <- imp
    |
143 |   | ImportDecl{ideclQualified = True} <- imp
    |                                 ^^^^
cabal: Failed to build haskell-language-server-0.3.0.0 (which is required by
exe:haskell-language-server-wrapper from haskell-language-server-0.3.0.0 and
exe:haskell-language-server from haskell-language-server-0.3.0.0). See the
build log above for details.

Full build log:

Build profile: -w ghc-8.10.1 -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.10.1/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )

Main.hs:20:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: main :: IO ()
   |
20 | main = defaultMain
   | ^^^^
Linking /Users/ur20980/Src/haskell-language-server/dist-newstyle/build/x86_64-osx/ghc-8.10.1/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
# cabal (for hls-8.10.1)
# cabal (for hls-8.10.1)
Wrote tarball sdist to
/Users/ur20980/Src/haskell-language-server/dist-newstyle/sdist/haskell-language-server-0.3.0.0.tar.gz
Wrote tarball sdist to
/Users/ur20980/Src/haskell-language-server/dist-newstyle/sdist/ghcide-0.2.0.tar.gz
Wrote tarball sdist to
/Users/ur20980/Src/haskell-language-server/dist-newstyle/sdist/brittany-0.12.1.1.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
 - haskell-language-server-0.3.0.0 (lib) (requires build)
 - haskell-language-server-0.3.0.0 (exe:haskell-language-server-wrapper) (requires build)
 - haskell-language-server-0.3.0.0 (exe:haskell-language-server) (requires build)
Starting     haskell-language-server-0.3.0.0 (lib)
Building     haskell-language-server-0.3.0.0 (lib)

Failed to build haskell-language-server-0.3.0.0.
Build log (
/Users/ur20980/.cabal/logs/ghc-8.10.1/hskll-lngg-srvr-0.3.0.0-1cdc0f32.log ):
Configuring library for haskell-language-server-0.3.0.0..
Preprocessing library for haskell-language-server-0.3.0.0..
Building library for haskell-language-server-0.3.0.0..
[ 1 of 20] Compiling Ide.Logger       ( src/Ide/Logger.hs, dist/build/Ide/Logger.o, dist/build/Ide/Logger.dyn_o )
[ 2 of 20] Compiling Ide.Plugin.Config ( src/Ide/Plugin/Config.hs, dist/build/Ide/Plugin/Config.o, dist/build/Ide/Plugin/Config.dyn_o )
[ 3 of 20] Compiling Ide.PluginUtils  ( src/Ide/PluginUtils.hs, dist/build/Ide/PluginUtils.o, dist/build/Ide/PluginUtils.dyn_o )
[ 4 of 20] Compiling Ide.Types        ( src/Ide/Types.hs, dist/build/Ide/Types.o, dist/build/Ide/Types.dyn_o )
[ 5 of 20] Compiling Ide.Plugin.Formatter ( src/Ide/Plugin/Formatter.hs, dist/build/Ide/Plugin/Formatter.o, dist/build/Ide/Plugin/Formatter.dyn_o )
[ 6 of 20] Compiling Ide.Plugin.StylishHaskell ( src/Ide/Plugin/StylishHaskell.hs, dist/build/Ide/Plugin/StylishHaskell.o, dist/build/Ide/Plugin/StylishHaskell.dyn_o )
[ 7 of 20] Compiling Ide.Plugin.Ormolu ( src/Ide/Plugin/Ormolu.hs, dist/build/Ide/Plugin/Ormolu.o, dist/build/Ide/Plugin/Ormolu.dyn_o )

src/Ide/Plugin/Ormolu.hs:64:16: warning: [-Wname-shadowing]
    This binding for ‘df’ shadows the existing binding
      bound at src/Ide/Plugin/Ormolu.hs:61:7
   |
64 |           Just df -> fromDyn df
   |                ^^
[ 8 of 20] Compiling Ide.Plugin.Fourmolu ( src/Ide/Plugin/Fourmolu.hs, dist/build/Ide/Plugin/Fourmolu.o, dist/build/Ide/Plugin/Fourmolu.dyn_o )

src/Ide/Plugin/Fourmolu.hs:64:16: warning: [-Wname-shadowing]
    This binding for ‘df’ shadows the existing binding
      bound at src/Ide/Plugin/Fourmolu.hs:61:7
   |
64 |           Just df -> fromDyn df
   |                ^^
[ 9 of 20] Compiling Ide.Plugin.Floskell ( src/Ide/Plugin/Floskell.hs, dist/build/Ide/Plugin/Floskell.o, dist/build/Ide/Plugin/Floskell.dyn_o )
[10 of 20] Compiling Ide.Plugin.Brittany ( src/Ide/Plugin/Brittany.hs, dist/build/Ide/Plugin/Brittany.o, dist/build/Ide/Plugin/Brittany.dyn_o )
[11 of 20] Compiling Ide.Plugin       ( src/Ide/Plugin.hs, dist/build/Ide/Plugin.o, dist/build/Ide/Plugin.dyn_o )

src/Ide/Plugin.hs:96:36: warning: [-Wname-shadowing]
    This binding for ‘pid’ shadows the existing binding
      bound at src/Ide/Plugin.hs:88:15
   |
96 |             = maker $ concatMap (\(pid, p) -> justs (pid, selector p)) ls
   |                                    ^^^

src/Ide/Plugin.hs:121:56: warning: [-Wname-shadowing]
    This binding for ‘range’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
121 | makeCodeAction cas lf ideState (CodeActionParams docId range context _) = do
    |                                                        ^^^^^

src/Ide/Plugin.hs:121:62: warning: [-Wname-shadowing]
    This binding for ‘context’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
121 | makeCodeAction cas lf ideState (CodeActionParams docId range context _) = do
    |                                                              ^^^^^^^

src/Ide/Plugin.hs:125:9: warning: [-Wname-shadowing]
    This binding for ‘actions’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
125 |     let actions = filter wasRequested . concat $ map unL $ rights r
    |         ^^^^^^^

src/Ide/Plugin.hs:138:33: warning: [-Wname-shadowing]
    This binding for ‘cmd’ shadows the existing binding
      imported from ‘Development.Shake’ at src/Ide/Plugin.hs:37:1-65
      (and originally defined in ‘Development.Shake.Command’)
    |
138 |     wrapCodeAction _ (CACommand cmd) = return $ Just (CACommand cmd)
    |                                 ^^^

src/Ide/Plugin.hs:139:39: warning: [-Wname-shadowing]
    This binding for ‘action’ shadows the existing binding
      imported from ‘Development.Shake’ at src/Ide/Plugin.hs:37:1-65
      (and originally defined in ‘shake-0.19.1:Development.Shake.Internal.Core.Rules’)
    |
139 |     wrapCodeAction caps (CACodeAction action) = do
    |                                       ^^^^^^

src/Ide/Plugin.hs:147:13: warning: [-Wname-shadowing]
    This binding for ‘cmd’ shadows the existing binding
      imported from ‘Development.Shake’ at src/Ide/Plugin.hs:37:1-65
      (and originally defined in ‘Development.Shake.Command’)
    |
147 |             cmd <- mkLspCommand "hls" "fallbackCodeAction" (action ^. title) (Just cmdParams)
    |             ^^^

src/Ide/Plugin.hs:180:30: warning: [-Wname-shadowing]
    This binding for ‘params’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
180 | makeCodeLens cas lf ideState params = do
    |                              ^^^^^^

src/Ide/Plugin.hs:220:18: warning: [-Wname-shadowing]
    This binding for ‘command’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
220 |         [plugin, command] -> Just (PluginId plugin, CommandId command)
    |                  ^^^^^^^

src/Ide/Plugin.hs:221:21: warning: [-Wname-shadowing]
    This binding for ‘command’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
221 |         [_, plugin, command] -> Just (PluginId plugin, CommandId command)
    |                     ^^^^^^^

src/Ide/Plugin.hs:239:32: warning: [-Wname-shadowing]
    This binding for ‘edit’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
239 |                 forM_ mEdit $ \edit -> do
    |                                ^^^^

src/Ide/Plugin.hs:260:25: warning: [-Wname-shadowing]
    This binding for ‘cmd’ shadows the existing binding
      imported from ‘Development.Shake’ at src/Ide/Plugin.hs:37:1-65
      (and originally defined in ‘Development.Shake.Command’)
    |
260 |           Just (plugin, cmd) -> runPluginCommand pluginMap lf ide plugin cmd cmdParams
    |                         ^^^

src/Ide/Plugin.hs:343:25: warning: [-Wname-shadowing]
    This binding for ‘action’ shadows the existing binding
      imported from ‘Development.Shake’ at src/Ide/Plugin.hs:37:1-65
      (and originally defined in ‘shake-0.19.1:Development.Shake.Internal.Core.Rules’)
    |
343 | wrapUnhandledExceptions action input =
    |                         ^^^^^^

src/Ide/Plugin.hs:382:22: warning: [-Wname-shadowing]
    This binding for ‘title’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
382 | mkLspCommand plid cn title args' = do
    |                      ^^^^^

src/Ide/Plugin.hs:393:18: warning: [-Wname-shadowing]
    This binding for ‘commands’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
393 | allLspCmdIds pid commands = concat $ map go commands
    |                  ^^^^^^^^

src/Ide/Plugin.hs:413:28: warning: [-Wname-shadowing]
    This binding for ‘params’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
413 | makeHover hps _lf ideState params
    |                            ^^^^^^

src/Ide/Plugin.hs:446:29: warning: [-Wname-shadowing]
    This binding for ‘params’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
446 | makeSymbols sps lf ideState params
    |                             ^^^^^^

src/Ide/Plugin.hs:488:37: warning: [-Wname-shadowing]
    This binding for ‘params’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
488 | renameWith providers lspFuncs state params = do
    |                                     ^^^^^^

src/Ide/Plugin.hs:492:13: warning: [-Wname-shadowing]
    This binding for ‘edits’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
492 |         (_, edits) -> return $ Right $ mconcat edits
    |             ^^^^^

src/Ide/Plugin.hs:531:33: warning: [-Wname-shadowing]
    This binding for ‘params’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
531 | makeCompletions sps lf ideState params@(CompletionParams (TextDocumentIdentifier doc) pos _context _mt)
    |                                 ^^^^^^

src/Ide/Plugin.hs:579:19: warning: [-Wname-shadowing]
    This binding for ‘uri’ shadows the existing binding
      imported from ‘Language.Haskell.LSP.Types.Lens’ at src/Ide/Plugin.hs:47:1-90
    |
579 | getPrefixAtPos lf uri pos = do
    |                   ^^^
[12 of 20] Compiling Ide.Plugin.Retrie ( src/Ide/Plugin/Retrie.hs, dist/build/Ide/Plugin/Retrie.o, dist/build/Ide/Plugin/Retrie.dyn_o )

src/Ide/Plugin/Retrie.hs:329:20: warning: [-Wname-shadowing]
    This binding for ‘pm’ shadows the existing binding
      bound at src/Ide/Plugin/Retrie.hs:327:9
    |
329 |         (fixities, pm) <- fixFixities f (fixAnns pm)
    |                    ^^

src/Ide/Plugin/Retrie.hs:333:13: warning: [-Wname-shadowing]
    This binding for ‘getParsedModule’ shadows the existing binding
      imported from ‘Development.IDE.Core.Rules’ at src/Ide/Plugin/Retrie.hs:41:1-43
    |
333 |         let getParsedModule f contents = do
    |             ^^^^^^^^^^^^^^^

src/Ide/Plugin/Retrie.hs:344:26: warning: [-Wname-shadowing]
    This binding for ‘parsed’ shadows the existing binding
      bound at src/Ide/Plugin/Retrie.hs:341:19
    |
344 |               (fixities, parsed) <- fixFixities f (fixAnns parsed)
    |                          ^^^^^^

src/Ide/Plugin/Retrie.hs:356:17: warning: [-Wname-shadowing]
    This binding for ‘parseModule’ shadows the existing binding
      imported from ‘GHC’ at src/Ide/Plugin/Retrie.hs:71:68-78
    |
356 |             let parseModule x = do
    |                 ^^^^^^^^^^^

src/Ide/Plugin/Retrie.hs:357:20: warning: [-Wname-shadowing]
    This binding for ‘fix’ shadows the existing binding
      imported from ‘Retrie.ExactPrint’ at src/Ide/Plugin/Retrie.hs:86:50-52
    |
357 |                   (fix, res) <- getParsedModule nt x
    |                    ^^^
[13 of 20] Compiling Ide.Plugin.Pragmas ( src/Ide/Plugin/Pragmas.hs, dist/build/Ide/Plugin/Pragmas.o, dist/build/Ide/Plugin/Pragmas.dyn_o )
[14 of 20] Compiling Ide.Plugin.ImportLens ( src/Ide/Plugin/ImportLens.hs, dist/build/Ide/Plugin/ImportLens.o, dist/build/Ide/Plugin/ImportLens.dyn_o )

src/Ide/Plugin/ImportLens.hs:143:33: error:
    • Couldn't match expected type ‘ImportDeclQualifiedStyle’
                  with actual type ‘Bool’
    • In the pattern: True
      In the pattern: ImportDecl {ideclQualified = True}
      In a stmt of a pattern guard for
                     an equation for ‘generateLens’:
        ImportDecl {ideclQualified = True} <- imp
    |
143 |   | ImportDecl{ideclQualified = True} <- imp
    |                                 ^^^^
cabal: Failed to build haskell-language-server-0.3.0.0 (which is required by
exe:haskell-language-server-wrapper from haskell-language-server-0.3.0.0 and
exe:haskell-language-server from haskell-language-server-0.3.0.0). See the
build log above for details.

Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shk-0.18.5-2e23059b:Development.Shake.Internal.Args
* Depends on: hls-8.10.1
  at command, called at src/Cabal.hs:28:13 in hls-install-0.8.0.0-inplace:Cabal
* Raised the exception:
Development.Shake.command, system command failed
Command line: cabal v2-install exe:haskell-language-server exe:haskell-language-server-wrapper -w /Users/ur20980/.ghcup/bin/ghc-8.10.1 --write-ghc-environment-files=never --installdir /Users/ur20980/.cabal/bin --max-backjumps=5000 --overwrite-policy=always --project-file=cabal.project -v1
Exit code: 1
Stderr:
cabal: Failed to build haskell-language-server-0.3.0.0 (which is required by
exe:haskell-language-server-wrapper from haskell-language-server-0.3.0.0 and
exe:haskell-language-server from haskell-language-server-0.3.0.0). See the
build log above for details.

In ~/.cabal/logs/ghc-8.10.1/: hskll-log.txt

@Ailrun Ailrun added CI Continuous integration component: plugins type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Aug 27, 2020
@Ailrun Ailrun self-assigned this Aug 27, 2020
@mouse07410
Copy link
Author

I pulled #356 to test it - and so far it fails on GHC-8.6.5 through GHC 8.10.2.

In short:

src/Ide/Plugin/ImportLens.hs:177:5: error:
     error: function-like macro 'MIN_GHC_API_VERSION' is not defined

Longer:

Resolving dependencies...
Build profile: -w ghc-8.10.1 -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.10.1/fake-package-0/x/script/build/script/script-tmp/Main.dyn_o )

Main.hs:20:1: warning: [-Wmissing-signatures]
    Top-level binding with no type signature: main :: IO ()
   |
20 | main = defaultMain
   | ^^^^
Linking /Users/ur20980/Src/haskell-language-server/dist-newstyle/build/x86_64-osx/ghc-8.10.1/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
# cabal (for hls-8.8.3)
# cabal (for hls-8.8.3)
Wrote tarball sdist to
/Users/ur20980/Src/haskell-language-server/dist-newstyle/sdist/haskell-language-server-0.3.0.0.tar.gz
Wrote tarball sdist to
/Users/ur20980/Src/haskell-language-server/dist-newstyle/sdist/ghcide-0.2.0.tar.gz
Wrote tarball sdist to
/Users/ur20980/Src/haskell-language-server/dist-newstyle/sdist/brittany-0.12.1.1.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - haskell-language-server-0.3.0.0 (lib) (requires build)
 - haskell-language-server-0.3.0.0 (exe:haskell-language-server) (requires build)
 - haskell-language-server-0.3.0.0 (exe:haskell-language-server-wrapper) (requires build)
Starting     haskell-language-server-0.3.0.0 (lib)
Building     haskell-language-server-0.3.0.0 (lib)

Failed to build haskell-language-server-0.3.0.0.
Build log (
/Users/ur20980/.cabal/logs/ghc-8.8.3/hskll-lngg-srvr-0.3.0.0-a6897fe1.log ):
Configuring library for haskell-language-server-0.3.0.0..
Preprocessing library for haskell-language-server-0.3.0.0..
Building library for haskell-language-server-0.3.0.0..

src/Ide/Plugin/ImportLens.hs:177:5: error:
     error: function-like macro 'MIN_GHC_API_VERSION' is not defined
    |
177 | #if MIN_GHC_API_VERSION(8,10,0)
    |     ^
#if MIN_GHC_API_VERSION(8,10,0)
    ^
1 error generated.

src/Ide/Plugin/ImportLens.hs:1:1: error:
    `clang' failed in phase `C pre-processor'. (Exit code: 1)
  |
1 | {-# LANGUAGE CPP                   #-}
  | ^
cabal: Failed to build haskell-language-server-0.3.0.0 (which is required by
exe:haskell-language-server from haskell-language-server-0.3.0.0 and
exe:haskell-language-server-wrapper from haskell-language-server-0.3.0.0). See
the build log above for details.

Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shk-0.18.5-2e23059b:Development.Shake.Internal.Args
* Depends on: hls-8.8.3
  at command, called at src/Cabal.hs:28:13 in hls-install-0.8.0.0-inplace:Cabal
* Raised the exception:
Development.Shake.command, system command failed
Command line: cabal v2-install exe:haskell-language-server exe:haskell-language-server-wrapper -w /Users/ur20980/.ghcup/bin/ghc-8.8.3 --write-ghc-environment-files=never --installdir /Users/ur20980/.cabal/bin --max-backjumps=5000 --overwrite-policy=always --project-file=cabal.project -v1
Exit code: 1
Stderr:
cabal: Failed to build haskell-language-server-0.3.0.0 (which is required by
exe:haskell-language-server from haskell-language-server-0.3.0.0 and
exe:haskell-language-server-wrapper from haskell-language-server-0.3.0.0). See
the build log above for details.

@Ailrun
Copy link
Member

Ailrun commented Aug 27, 2020

@mouse07410 It was my mistake. I forgot to put the language pragma. I believe now it works.

@mouse07410
Copy link
Author

It was my mistake. I forgot to put the language pragma.

I will not confess how many I make. ;-)

I believe now it works.

Unfortunately, it still doesn't:

Building library for haskell-language-server-0.3.0.0..

src/Ide/Plugin/ImportLens.hs:178:5: error:
     error: function-like macro 'MIN_GHC_API_VERSION' is not defined
    |
178 | #if MIN_GHC_API_VERSION(8,10,0)
    |     ^
#if MIN_GHC_API_VERSION(8,10,0)
    ^
1 error generated.
`clang' failed in phase `C pre-processor'. (Exit code: 1)

@mouse07410
Copy link
Author

BTW, on a semi-related note:

$ git fetch --all
. . . . .
Fetching submodule ghcide
fatal: remote error: upload-pack: not our ref 6f767a928fdad6d2c3400e9c9768ebc3505af4cd
fatal: the remote end hung up unexpectedly
Errors during submodule fetch:
	ghcide
error: Could not fetch origin

@mouse07410
Copy link
Author

@Ailrun it looks like #356 (comment) applied to #356 fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration component: plugins type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants