我在一个有768 MB内存和512 MB交换空间的容器上运行。我不能增加这两种情况。cabal install criterion总是给
Failed during the building phase.
The exception was: ExitFailure (-9)
This may be due to an out-of-memory condition.在Compiling Criterion.Types期间。有什么办法可以绕过这件事吗?还是我必须在没有标准的情况下做下去?
发布于 2017-09-11 04:46:12
在GHC上设置RTS标志以限制其内存使用(--ghc-options="+RTS -M600M"),并避免并行运行多个作业(-j1)。
发布于 2022-01-18 05:44:26
回答@DavidAzar对答案的评论:
@李耀夏的解决方案奏效了,但后来我遇到了更多的问题。这都是我从我的粗略笔记,因为我跟踪我的方式通过问题。因此,可能会有一个更精简的解决方案。
实际上,它编译了所有的东西,但是cabal --version仍然是2.4,而不是3.4。也许它不在路上?
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这里似乎有一个解决方案:https://stackoverflow.com/a/17030330/52236,但在重新执行阴谋安装和重新编译过程之前,我必须弄清楚如何删除现有的符号链接。
这里也有这样的解决方案,我将首先尝试:updating cabal-install, but version is not changed
unminimize从bash,安装所有正常的东西到ubuntu。cabal buildghc --version仍然输出8.6.5。另一个符号链接问题?lrwxrwxrwx 1 root root 9 Mar 24 2020 ghc -> ghc-8.6.5
-rwxr-xr-x 1 root root 226 Mar 24 2020 ghc-8.6.5
lrwxrwxrwx 1 root root 13 Mar 24 2020 ghc-pkg -> ghc-pkg-8.6.5
-rwxr-xr-x 1 root root 258 Mar 24 2020 ghc-pkg-8.6.5
lrwxrwxrwx 1 root root 10 Mar 24 2020 ghci -> ghci-8.6.5
-rwxr-xr-x 1 root root 55 Mar 24 2020 ghci-8.6.5首先,为ghcup创建了一个新的符号链接:
ln -s /root/.ghcup/bin/ghcup ghcup(虽然我记不起我需要的是什么?)
解决方案: Docker -> Preferences -> Resources ->增加内存和交换空间。在我的例子中,从2-8GB内存,从1到2GB交换空间。
现在,它为第一周构建了Plutus先锋代码。
https://stackoverflow.com/questions/46147137
复制相似问题