简体   繁体   中英

How to install GHC in Appveyor and put GHC in path?

I'm trying to install GHC on windows with the following script (and put ghc in path), but it fails when I try to run ghci --version . I think there is something wrong with the script.

install:
  - ps: Invoke-WebRequest "https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-i386-unknown-mingw32-win10.tar.xz" -OutFile "ghc-8.0.2-i386-unknown-mingw32-win10.tar.xz"
  - 7z x ghc-8.0.2-i386-unknown-mingw32-win10.tar.xz
  - ps: $env:path += "C:\projects\haskell-interactive-mode\ghc-8.0.2-i386-unknown-mingw32-win10.tar\ghc-8.0.2\bin"
  - ps: ghci --version

I tried your command on local Windows machine and I see that 7z x ghc-8.0.2-i386-unknown-mingw32-win10.tar.xz results in ghc-8.0.2-i386-unknown-mingw32-win10.tar file , not folder . If you unzip it further with 7z x ghc-8.0.2-i386-unknown-mingw32-win10.tar , it unzips into real folder named ghc-8.0.2 with bin subfolder and ghci.exe file.

However I think that simpler it would be use Chocolatey package . This works for me well:

  - choco install ghc
  - refreshenv
  - ghci --version

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