[英]cabal install ghc impossible happened: heap overflow
I'm trying to follow along with the Plutus Pioneer lectures, and I'm getting this error My system: Ubuntu Linux Docker image running on MacOS.我正在尝试跟随 Plutus Pioneer 讲座,但出现此错误我的系统:在 MacOS 上运行的 Ubuntu Linux Docker 映像。 I installed the Haskell package on the image from here: https://www.haskell.org/platform/linux.html我从这里在图像上安装了 Haskell 包: https : //www.haskell.org/platform/linux.html
using this line in my Dockerfile: RUN apt-get install -y haskell-platform
在我的 Dockerfile 中使用这一行: RUN apt-get install -y haskell-platform
This seems to install Cabal version 2.4.这似乎安装了 Cabal 2.4 版。
When I clone the code repository for the lectures: https://github.com/input-output-hk/plutus-pioneer-program and then go to the week01 directory and try cabal build
like in the lecture, I get dependencies not found errors.当我克隆讲座的代码存储库时: https : //github.com/input-output-hk/plutus-pioneer-program然后转到 week01 目录并像讲座中一样尝试cabal build
,我找不到依赖项错误。 The first missing dependency is 'aeson', which seems to install if I run cabal install aeson
.第一个缺少的依赖项是“aeson”,如果我运行cabal install aeson
,它似乎会安装。
The subsequent build attempts fail on dependency 'base' being the wrong version.随后的构建尝试因依赖项 'base' 版本错误而失败。
Then I thought maybe if I update Cabal to version 3.4 it might help, so I tried cabal install cabal-install
, but this also has errors:然后我想如果我将 Cabal 更新到 3.4 版可能会有所帮助,所以我尝试了cabal install cabal-install
,但这也有错误:
Theexception was:ExitFailure (-9)
This may be due to an out-of-memory condition.
So I googled some more and tried this command line: cabal install --ghc-options="+RTS -M600M" -j1 cabal-install
from here https://stackoverflow.com/a/46148345/52236所以我搜索了更多并尝试了这个命令行: cabal install --ghc-options="+RTS -M600M" -j1 cabal-install
from here https://stackoverflow.com/a/46148345/52236
This seems to get further, but now I'm at this error:这似乎更进一步,但现在我遇到了这个错误:
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.5 for x86_64-unknown-linux): heap overflow
If anyone has any idea how to fix this it would be appreciated.如果有人知道如何解决这个问题,我们将不胜感激。 Do I need to add more RAM to my Docker Ubuntu image?我是否需要为我的 Docker Ubuntu 映像添加更多 RAM? It currently has 1.9GB of memory and 1.7GB free.它目前有 1.9GB 的内存和 1.7GB 的可用空间。 thanks, m谢谢,米
I fixed this by increasing the RTS param:我通过增加 RTS 参数来解决这个问题:
cabal install --ghc-options="+RTS -M1000M" -j1 cabal-install
Well, actually it compiled everything, but cabal --version
still says 2.4, not 3.4.好吧,实际上它编译了所有内容,但是cabal --version
仍然说 2.4,而不是 3.4。 There was this warning too:也有这个警告:
Warning: could not create a symlink in /root/.cabal/bin for cabal because the
file exists there already but is not managed by cabal. You can create a
symlink for this executable manually if you wish. The executable file has been
installed at /root/.cabal/bin/cabal
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.