Recommended approach to use Stack as global package manager

半城伤御伤魂 提交于 2019-12-05 04:06:13

Well, stack install in any project will install to ~/.local/bin therefore making whatever executable you install be globally accessible.

The global project is used when running stack without a project, it is located in ~/.stack/global-project/stack.yaml.

If you want all of your globally accessible tools to have the same dependencies (perhaps to ensure that the ghc version matches or something), then you could make a project intended to build all of these tools. It's up to you whether or not it is the "global project" - there's not much special about it, it's just a default if you run stack and aren't in a project.

In order to record "what haskell executables do I want installed globally", you might consider creating a shell file like

#!/bin/sh
stack install hindent

And then running this whenever you change the versions of the installed tools.

Also, for tools like intero that need to match the ghc version, you can do stack install --copy-compiler-tool intero, and it will be available on the PATH when stack is used with that ghc version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!