简体   繁体   中英

Windows 10 ghc 8.4.3 Add Library Search Path Error

I have run into a strange ghci addLibrarySearchPath error message with Haskell Platform 8.4.2 and 8.4.3 full on a Windows 10 Pro version 1803 machine. Here is an example transcript on a fresh installation of Haskell Platform 8.4.3, where ghci was started immediately after the installation finished:

C:\Users\Admin>ghci
GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
Prelude> import System.Random
Prelude System.Random> randomIO
ghc.exe: addLibrarySearchPath: D:\GitHub\haskell-platform\build\ghc-bindist\local\mingw\lib (Win32 error 3): The system cannot find the path specified.
-7101299332192590302

The message pops up the first time certain IO actions happen in a ghci session (it's not just those from System.Random). I have read of similar errors when ghc is looking for paths in an older Haskell Platform location, such as the error described in https://ghc.haskell.org/trac/ghc/ticket/14183 . However, in my case, that D:\\GitHub folder has never existed at all - it's a removal drive that has nothing installed on it. The fixes I've read for the similar addLibrarySearchPath errors involved redoing cabal sandboxes or reinstalling; no sandbox has been made in this case and reinstalling made no difference. Between uninstalling and reinstalling, I cleared away the local, cabal, and ghc folders that always get left behind in AppData\\Roaming. While the error message technically doesn't stop ghci from working after it shows up, I would really like to know what's causing it.

Any insight on this would be greatly appreciated. The problem does not happen with Haskell Platform either 8.2.1 or 8.2.2 full. It's only the two later platform versions that exhibit the behavior.

Well, it seems I found the answer.

After additional testing on two more machines, the error messages are due to something in the full version of Haskell Platform, since it is not possible to reproduce with the core option for the same versions. There is now an issue related to it on the Haskell Platform GitHub issues page:

https://github.com/haskell/haskell-platform/issues/312#issuecomment-402349871

So, if anyone else has addLibrarySearchPath errors referencing a D:/GitHub/... folder, you can avoid it by using the core version instead of full and manually installing extra libraries. Of course, most people on Windows use core anyway, but I was using full because I wanted the network library (for which the manual installation process is tedious).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM