从Linux上的来源构建Haskell GHC

发布于 2025-01-25 08:19:06 字数 908 浏览 5 评论 0原文

似乎有一个循环依赖性建立GHC时:

$ wget https://downloads.haskell.org/~ghc/9.2.2/ghc-9.2.2-src.tar.xz
$ tar -xf ghc-9.2.2-src.tar.xz
$ cd ghc-9.2.2/
$ sed -n "11,12p" INSTALL.md 
N.B. in particular you need GHC installed in order to build GHC,
because the compiler is itself written in Haskell.  For instructions
$ sudo apt install ghc # <----- somehow get an older version to build from source the new one
$ ./configure 
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC Git commit id... given fbaee70d380973f71fa6e9e15be746532e5a4fc5
checking for ghc... /usr/bin/ghc
checking version of ghc... 8.6.5
configure: error: GHC version 8.10 or later is required to compile GHC. # ???!!!

为了构建新的GHC,需要一些 旧版本的GHC版本,但是不太旧apt-get版本 太旧了。有什么想法吗?

It seems there is a circular dependency when building ghc:

$ wget https://downloads.haskell.org/~ghc/9.2.2/ghc-9.2.2-src.tar.xz
$ tar -xf ghc-9.2.2-src.tar.xz
$ cd ghc-9.2.2/
$ sed -n "11,12p" INSTALL.md 
N.B. in particular you need GHC installed in order to build GHC,
because the compiler is itself written in Haskell.  For instructions
$ sudo apt install ghc # <----- somehow get an older version to build from source the new one
$ ./configure 
checking for gfind... no
checking for find... /usr/bin/find
checking for sort... /usr/bin/sort
checking for GHC Git commit id... given fbaee70d380973f71fa6e9e15be746532e5a4fc5
checking for ghc... /usr/bin/ghc
checking version of ghc... 8.6.5
configure: error: GHC version 8.10 or later is required to compile GHC. # ???!!!

So to build a new ghc, some older version of ghc is needed, but not too old.
The apt-get version is too old. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

Bonjour°[大白 2025-02-01 08:19:06

根据@Daniel Wagner的评论发布自我完整性:

$ wget https://downloads.haskell.org/~ghc/9.2.2/ghc-9.2.2-x86_64-ubuntu20.04-linux.tar.xz
$ tar -xf ghc-9.2.2-x86_64-ubuntu20.04-linux.tar.xz
$ cd ghc-9.2.2/
$ ./configure # <----- you still have to do configre + make
$ make
$ sudo make install
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.2

Posting for self completeness according to the comment of @Daniel Wagner:

$ wget https://downloads.haskell.org/~ghc/9.2.2/ghc-9.2.2-x86_64-ubuntu20.04-linux.tar.xz
$ tar -xf ghc-9.2.2-x86_64-ubuntu20.04-linux.tar.xz
$ cd ghc-9.2.2/
$ ./configure # <----- you still have to do configre + make
$ make
$ sudo make install
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.2
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文