使用stack ghc替代ghc(Using stack ghc as replacement of ghc)
不使用堆栈或cabal分发的包通常具有一组隐含的依赖项。 这有时意味着如果不将包安装到ghcs全局包数据库中,直接在所述包上运行ghc将无法工作。
我想使用
stack ghc
作为stack ghc
的替代,为此我在shell shell文件中定义了以下内容:export PATH="`stack path --compiler-bin`:$PATH"
现在命令
ghc
将使用stack的ghc - 但它不会像stack ghc
那样做。 例如,它不会加载“snapshot”和“global-project”软件包数据库,可以通过以下命令看到:$ ghc -v Glasgow Haskell Compiler, Version 8.0.1, stage 2 booted by GHC version 7.10.3 Using binary package database: ~/.stack/programs/x86_64-linux/ghc-nopie-8.0.1/lib/ghc-8.0.1/package.conf.d/package.cache ... $ stack ghc -- -v Glasgow Haskell Compiler, Version 8.0.1, stage 2 booted by GHC version 7.10.3 Using binary package database: ~/.stack/programs/x86_64-linux/ghc-nopie-8.0.1/lib/ghc-8.0.1/package.conf.d/package.cache Using binary package database: ~/.stack/snapshots/x86_64-linux-nopie/lts-7.9/8.0.1/pkgdb/package.cache Using binary package database: ~/.stack/global-project/.stack-work/install/x86_64-linux-nopie/lts-7.9/8.0.1/pkgdb/package.cache ...
有没有人有关于如何使用
stack ghc
替代ghc
。我目前使用的用例是我已经获得了一个引用
ghc
的make文件 - 但是我的机器上没有这个命令。Packages that are distributed without using stack or cabal usually have a set of implied dependencies. This sometimes mean that running ghc directly on said packages will not work without installing packages into ghcs global package database.
I would like to use
stack ghc
as a replacement forghc
to this end I have defined the following in my shells init file:export PATH="`stack path --compiler-bin`:$PATH"
Now the command
ghc
will use stack's ghc - it does not however do the same asstack ghc
. For one, it does not load the "snapshot" and "global-project" package database as can be seen with the following commands:$ ghc -v Glasgow Haskell Compiler, Version 8.0.1, stage 2 booted by GHC version 7.10.3 Using binary package database: ~/.stack/programs/x86_64-linux/ghc-nopie-8.0.1/lib/ghc-8.0.1/package.conf.d/package.cache ... $ stack ghc -- -v Glasgow Haskell Compiler, Version 8.0.1, stage 2 booted by GHC version 7.10.3 Using binary package database: ~/.stack/programs/x86_64-linux/ghc-nopie-8.0.1/lib/ghc-8.0.1/package.conf.d/package.cache Using binary package database: ~/.stack/snapshots/x86_64-linux-nopie/lts-7.9/8.0.1/pkgdb/package.cache Using binary package database: ~/.stack/global-project/.stack-work/install/x86_64-linux-nopie/lts-7.9/8.0.1/pkgdb/package.cache ...
Does anyone have guidance on how to achieve using
stack ghc
as a replacement forghc
.The use-case I currently have is that I have been given a make-file that refers to
ghc
- but I do not have this command on my machine.
原文:https://stackoverflow.com/questions/43191044