Skip to content

ghcup seems to struggle with backslashes on Windows

After trying to install hls-1.7.0.0 with ghcup today, a lot of ghcup commands started running into a parse error:

λ ghcup list
ghcup: ParseErrorBundle {bundleErrors = TrivialError 3 (Just (Tokens ('\\' :| "Haskell\\\\ghcup\\bin\\haskell-lang"))) (fromList [Tokens ('h' :| "askell-language-server-wrapper-")]) :| [], bundlePosState = PosState {pstateInput = "C:\\\\Haskell\\\\ghcup\\bin\\haskell-language-server-wrapper-1.7.0.0", pstateOffset = 0, pstateSourcePos = SourcePos {sourceName = "", sourceLine = Pos 1, sourceColumn = Pos 1}, pstateTabWidth = Pos 8, pstateLinePrefix = ""}}

I think this is because ghcup comes across the filepath C:\\\\Haskel\\\\ghcup\\bin\\... and struggles with all those backslashes. Note that I didn't change anything in PATH, in fact I nuked ghcup and re-installed it from scratch with the default install directory C:\Haskell and this issue happened again. The only ghcup environment variable that was set that I could find was GHCUP_INSTALL_BASE_PREFIX, which was equal to C:\\Haskell\. I tried changing it to C:\Haskell but that didn't make a difference.

Edited by sheaf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information