Skip to content

Instantly share code, notes, and snippets.

@ysae
Last active November 8, 2016 16:37
Show Gist options
  • Save ysae/1e65abea7d877336d9a77cc7e05e2eac to your computer and use it in GitHub Desktop.
Save ysae/1e65abea7d877336d9a77cc7e05e2eac to your computer and use it in GitHub Desktop.
Haskell Stack under windows10

Установка haskell stack под windows 10

Программу установил с помощью пакетного менеджера chocolatey.

choco.exe install haskell-stack

Сразу же выставил системную переменную STACK_ROOT в корень диска, как рекомендуют в руководстве по установке.

При запуске stack init консоль надолго задумалась:

C:\Users\easy\sandbox>stack init
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- helloworkl\helloworkl.cabal
- dummy-app\dummy-app.cabal

Selecting the best among 9 snapshots...

Downloaded lts-7.5 build plan.
Updating package index Hackage (mirrored at https://github.com/commercialhaskell/all-cabal-hashes.git) ...

Потому команду пришлось прервать (Ctrl-C).

Оказалось что all-cabal-hashes болшой, и потому нужно долго ждать. Для чистоты эксперимента снес stack (choco uninstall haskell-stack), вручную поубирал все инсталляции cabak, ghc и stack, которые были на машине, и начал заново

> stack init

C:\Users\easy\sandbox>stack init
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- helloworkl\helloworkl.cabal
- dummy-app\dummy-app.cabal

Selecting the best among 9 snapshots...

Fetching package index ...remote: Counting objects: 810582, done.
remote: Compressing objects: 100% (157/157), done.
Receiving objects:   1% (11820/810582), 6.79 MiB | 27.00 KiB/s

Проработва час, команда обламалась.

Fetching package index ...remote: Counting objects: 810582, done.
remote: Compressing objects: 100% (157/157), done.
error: RPC failed; result=18, HTTP code = 200MiB | 0 bytes/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Process exited with ExitFailure 128: C:\Users\easy\AppData\Local\Programs\Git\cmd\git.EXE fetch --tags
Failed to fetch package index, retrying.
removeDirectoryRecursive: permission denied (╨Ю╤В╨║╨░╨╖╨░╨╜╨╛ ╨▓ ╨┤╨╛╤Б╤В╤Г╨┐╨╡.)

Запустил заново, глянув через process explorer, что исполняется:

cwd: D:\STACK_ROOT\indices\Hackage\git-update\
cmd: "C:\Users\easy\AppData\Local\Programs\Git\cmd\git.EXE" "clone" "https://github.com/commercialhaskell/all-cabal-hashes.git" "all-cabal-hashes\\" "-b" "display"

На этот раз все прошло успешно:

C:\Users\easy\sandbox>stack init
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- helloworkl\helloworkl.cabal
- dummy-app\dummy-app.cabal

Selecting the best among 9 snapshots...

Fetched package index.
Populated index cache.
* Matches lts-7.5

Selected resolver: lts-7.5
Initialising configuration using resolver: lts-7.5
Total number of user packages considered: 2
Writing configuration to file: stack.yaml
All done.

В stack_root\config.yaml заполнил значения:

templates:
  params:
    author-email: [email protected]
    author-name: Andy Legkiy
    copyright: Copyright (c) Andy Legkiy
    github-username: ysae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment