haskell / haskell/haskell-language-server

setInitialDynFlags: No entry for "Use inplace MinGW toolchain" in "~/.stack/programs/x86_64-osx/ghc-9.0.2/lib/ghc-9.0.2/lib/settings"

Open
#4,078 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
3d 21h
Merged PRs (30d)
13

Description

### Your environment

MacOS
GHC 9.4.8 and other from ghcup
How is your project built (alternative: link to the project)? no project, just a .hs file

VS Code + haskell.haskell v2.4.3
HLS 2.5.0.0 (GHC: 9.2.8) from ghcup
Have you configured HLS in any way (especially: a `hie.yaml` file)? no

### Steps to reproduce

1. open a file outside of any project with
```hs
main = pure ()
```

### Expected behaviour

No error messages

### Actual behaviour

Error message
```
Error condition, please check your setup and/or the [issue tracker](https://github.com/haskell/haskell-language-server/issues):
setInitialDynFlags: No entry for "Use inplace MinGW toolchain" in "/Users/cblp/.stack/programs/x86_64-osx/ghc-9.0.2/lib/ghc-9.0.2/lib/settings"
```

### Debug information

```
2024-02-15 21:06:09.9930000 [client] INFO Finding haskell-language-server
2024-02-15 21:06:09.9940000 [client] INFO Searching for server executables haskell-language-server-wrapper,haskell-language-server in $PATH
2024-02-15 21:06:09.9940000 [client] INFO $PATH environment variable: /Users/cblp/.nix-profile/bin:/Users/cblp/Library/Application Support/Coursier/bin:/Users/cblp/felix/bin:/Users/cblp/.local/bin:/Users/cblp/.cargo/bin:/Users/cblp/.cabal/bin:/usr/local/opt/qt/bin:/usr/local/opt/openjdk/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/cblp/.cabal/bin:/Users/cblp/.ghcup/bin
2024-02-15 21:06:09.9980000 [client] INFO Found server executable in $PATH: haskell-language-server-wrapper
2024-02-15 21:06:09.9980000 [client] INFO Activating the language server in working dir: /private/tmp (parent dir of loaded file /private/tmp/a.hs)
2024-02-15 21:06:09.9980000 [client] INFO run command: haskell-language-server-wrapper --lsp
2024-02-15 21:06:09.9980000 [client] INFO debug command: haskell-language-server-wrapper --lsp
2024-02-15 21:06:09.9980000 [client] INFO server cwd: /private/tmp
2024-02-15 21:06:09.9980000 [client] INFO server environment variables:
2024-02-15 21:06:10.0000000 [client] INFO Starting language server
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 2.5.0.0 x86_64 ghc-9.2.8
Current directory: /private/tmp
Operating system: darwin
Arguments: ["--lsp"]
Cradle directory: /private/tmp
Cradle type: Default

Tool versions found on the $PATH
cabal: 3.10.2.1
stack: 2.13.1
ghc: 9.4.8

Consulting the cradle to get project GHC version...
2024-02-15T21:06:10.525985Z | Debug | executing command: ghc --numeric-version
Project GHC version: 9.4.8
haskell-language-server exe candidates: ["haskell-language-server-9.4.8","haskell-language-server"]
Launching haskell-language-server exe at:/Users/cblp/.ghcup/bin/haskell-language-server-9.4.8
2024-02-15T21:06:10.670884Z | Debug | executing command: ghc -v0 -package-env=- -ignore-dot-ghci -e Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath)
2024-02-15T21:06:11.956715Z | Debug | executing command: ghc --print-libdir
2024-02-15T21:07:00.144088Z | Info | haskell-language-server version: 2.5.0.0 (GHC: 9.4.8) (PATH: /Users/cblp/.ghcup/hls/2.5.0.0/lib/haskell-language-server-2.5.0.0/bin/haskell-language-server-9.4.8)
2024-02-15T21:07:00.145903Z | Info | Directory: /private/tmp
2024-02-15T21:07:00.146327Z | Info | Starting (haskell-language-server) LSP server...
GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsLogLevel = Info, argsLogFile = Nothing, argsLogStderr = True, argsLogClient = False, argsThreads = 0, argsProjectGhcVersion = False}
PluginIds: [ pragmas-suggest
, pragmas-completion
, retrie
, ghcide-completions
, alternateNumberFormat
, ghcide-code-actions-bindings
, explicit-fields
, ghcide-hover-and-symbols
, ghcide-code-actions-type-signatures
, floskell
, fourmolu
, ghcide-extend-import-action
, ghcide-code-actions-fill-holes
, importLens
, LSPRecorderCallback
, cabal
, qualifyImportedNames
, moduleName
, splice
, stylish-haskell
, changeTypeSignature
, hlint
, class
, ormolu
, callHierarchy
, stan
, ghcide-type-lenses
, codeRange
, cabal-fmt
, eval
, rename
, ghcide-code-actions-imports-exports
, gadt
, overloaded-record-dot
, ghcide-core
, explicit-fixity
, pragmas-disable ]
2024-02-15T21:07:00.153453Z | Info | Logging heap statistics every 60.00s
2024-02-15T21:07:00.265001Z | Info | Starting LSP server...
If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option!
PluginIds: [ pragmas-suggest
, pragmas-completion
, retrie
, ghcide-completions
, alternateNumberFormat
, ghcide-code-actions-bindings
, explicit-fields
, ghcide-hover-and-symbols
, ghcide-code-actions-type-signatures
, floskell
, fourmolu
, ghcide-extend-import-action
, ghcide-code-actions-fill-holes
, importLens
, LSPRecorderCallback
, cabal
, qualifyImportedNames
, moduleName
, splice
, stylish-haskell
, changeTypeSignature
, hlint
, class
, ormolu
, callHierarchy
, stan
, ghcide-type-lenses
, codeRange
, cabal-fmt
, eval
, rename
, ghcide-code-actions-imports-exports
, gadt
, overloaded-record-dot
, ghcide-core
, explicit-fixity
, pragmas-disable ]
2024-02-15T21:07:00.266148Z | Info | Starting server
2024-02-15T21:07:00.267916Z | Info | Started LSP server in 0.00s
2024-02-15T21:07:02.524938Z | Error | setInitialDynFlags: No entry for "Use inplace MinGW toolchain" in "/Users/cblp/.stack/programs/x86_64-osx/ghc-9.0.2/lib/ghc-9.0.2/lib/settings"
2024-02-15T21:07:02.525661Z | Info | Registering IDE configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-4830842924133653884) "file:///Users/cblp/Yandex.Disk.localized/Documents/capital",NormalizedUri (-7210893057963810972) "file:///Users/cblp/dev/ff",NormalizedUri (-3083590742697588118) "file:///Users/cblp/dev/starway",NormalizedUri 4855477768463435212 "file:///Users/cblp/dev/gi-gtk-declarative",NormalizedUri (-1846484087211356207) "file:///Users/cblp/dev/stellar-desktop/stellar",NormalizedUri 4341702357237335058 "file:///Users/cblp/dev/scalafx-ensemble",NormalizedUri 7713577306917355794 "file:///Users/cblp/dev/StellarQtSDK",NormalizedUri (-6114966919464897164) "file:///Users/cblp/dev/haskell-stellar-sdk",NormalizedUri (-7260383602631498122) "file:///Users/cblp/sqream/compiler-frontend",NormalizedUri 8189053523886333654 "file:///Users/cblp/dev/veche",NormalizedUri (-5688558159784509129) "file:///Users/cblp/dev/elephants",NormalizedUri (-8005928375062178628) "file:///Users/cblp/dev/montelibero-nft",NormalizedUri (-1228988779989240899) "file:///Users/cblp/dev/ekva"], clientSettings = hashed Nothing}
2024-02-15T21:07:02.545346Z | Info | Cradle path: /private/tmp/a.hs
2024-02-15T21:07:02.545517Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for /private/tmp/a.hs.
Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2024-02-15T21:07:02.552460Z | Info | invoking build tool to determine build flags (this may take some time depending on the cache)
[Error - 22:07:02] Request textDocument/foldingRange failed.
Message: codeRange: Rule Failed: GetCodeRange
Code: -32803
[Error - 22:07:23] Request textDocument/foldingRange failed.
Message: codeRange: Rule Failed: GetCodeRange
Code: -32803
2024-02-15T21:08:00.157219Z | Info | Live bytes: 21.55MB Heap size: 580.91MB
[Error - 22:08:07] Request textDocument/foldingRange failed.
Message: codeRange: Rule Failed: GetCodeRange
Code: -32803
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with a standalone .hs file outside a project using the reported macOS, GHC, HLS, Stack, and VS Code versions. Start with the logged setInitialDynFlags failure and the referenced GHC settings file; done means opening the file no longer produces the reported setup error.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.