ghcup

DEPRECATED IN FAVOR OF haskell/ghcup-hs
授权协议 BSD-3-Clause License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 席成仁
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

THIS PROJECT IS NOW DEPRECATED IN FAVOR OF ghcup-hs

--

ghcup makes it easy to install specific versions of ghc on GNU/Linux as well as macOS (aka Darwin), and can also bootstrap a fresh Haskell developer environment from scratch.It follows the unix UNIX philosophy of do one thing and do it well.

Similar in scope to rustup, pyenv and jenv.

Ubuntu users may prefer hvr's ppa.

This project was started when CM was switching from stack to cabal nix-style builds.

Table of Contents

Installation

Choose one of the following installation methods.

Simple bootstrap of ghcup, GHC and cabal-install

# complete bootstrap
curl https://gitlab.haskell.org/haskell/ghcup/raw/master/bootstrap-haskell -sSf | sh

# prepare your environment
. "$HOME/.ghcup/env"
echo '. $HOME/.ghcup/env' >> "$HOME/.bashrc" # or similar

# now create a project, such as:
mkdir myproject && cd myproject
cabal init -n --is-executable
cabal v2-run

Manual install

Just place the ghcup shell script into your PATH anywhere.

E.g.:

( mkdir -p ~/.ghcup/bin && curl https://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup) && echo "Success"

Then adjust your PATH in ~/.bashrc (or similar, depending on your shell) like so, for example:

export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"

Security aware users may want to use the files from the release pageand verify the gpg signatures.

Usage

See ghcup --help.

Common use cases are:

# install the last known "best" GHC version
ghcup install
# install a specific GHC version
ghcup install 8.2.2
# set the currently "active" GHC version
ghcup set 8.4.4
# install cabal-install
ghcup install-cabal
# update cabal-install
cabal new-install cabal-install

Generally this is meant to be used with cabal-install, whichhandles your haskell packages and can demand that a specific version of ghc is available, which ghcup can do.

Manpages

For man pages to work you need man-db as your man provider, then issue man ghc. Manpages only work for the currently set ghc.MANPATH may be required to be unset.

Design goals

  1. simplicity
  2. non-interactive
  3. portable
  4. do one thing and do it well (UNIX philosophy)

Non-goals

  1. invoking sudo, apt-get or any package manager
  2. handling system packages
  3. handling cabal projects
  4. being a stack alternative

How

Installs a specified GHC version into ~/.ghcup/ghc/<ver>, and places ghc-<ver> symlinks in ~/.ghcup/bin/.

Optionally, an unversioned ghc link can point to a default version of your choice.

This uses precompiled GHC binaries that have been compiled on fedora/debian by upstream GHC.

Alternatively, you can also tell it to compile from source (note that this might fail due to missing requirements).

In addition this script can also install cabal-install.

Known users

Known problems

Limited distributions supported

Currently only GNU/Linux distributions compatible with the upstream GHC binaries are supported.

Precompiled binaries

Since this uses precompiled binaries you may run intoseveral problems.

Missing libtinfo (ncurses)

You may run into problems with ncurses and missing libtinfo, in caseyour distribution doesn't use the legacy way of buildingncurses and has no compatibility symlinks in place.

Ask your distributor on how to solve this ortry to compile from source via ghcup compile <version>.

Libnuma required

This was a bug in the build system of some GHC versions that lead tounconditionally enabled libnuma support. To mitigate this you might have to install the libnumapackage of your distribution. See here for a discussion.

Compilation

Although this script can compile GHC for you, it's just a very thinwrapper around the build system. It makes no effort in tryingto figure out whether you have the correct toolchain andthe correct dependencies. Refer to the official docson how to prepare your environment for building GHC.

FAQ

  1. Why reimplement stack?

ghcup is not a reimplementation of stack. The only common part is automatic installation of GHC, but even that differs in scope and design.

  1. Why not contribute to stack and create a library for the common part?

While this might be an interesting idea, ghcup is about simplicity.

  1. Why write a >1000k LOC bash script?

ghcup is POSIX sh.

  1. Why write a >1000k LOC POSIX sh script?

Mainly because the implementation is fairly straight-forward and the script is highly portable. No need to bootstrap anything or set up yet another CI to build ghcup binaries for all possible arches and distros just to perform a very simple task: identify distro and platform and download a GHC bindist.

  1. Why not support windows?

Consider using Chocolatey or ghcups.

 相关资料
  • 问题内容: 我有一个使用Hibernate为HSQL db生成表的应用程序(因为我的应用程序仍在开发中)。在我的域模型中,我已经设定 当我使用DBVisualizer打开数据库时,可以看到所有设置都正确,除了它无法正常工作外,我的列接受的长度超过10个字符的值。当我尝试在DBVisualier中手动运行查询时,它会失败,但是应该进入休眠状态。 同样非常奇怪的是,当我使用文件(而不是在内存db中)以

  • 问题内容: 我正在使用Apache POI填充Excel文件的单元格,并且文档中有很多公式单元格。但是,当我在Excel中打开文档时,它们的值不会刷新。 据我了解,我需要使用a 刷新公式单元格。但是,有没有办法一次更新所有公式单元格?其中有 很多 ,尽管列出详尽的清单并非没有问题,但我当然不愿意这样做。 问题答案: 当然。无论如何,刷新工作簿中的所有公式可能是更典型的用例。 如果您使用的是HSSF

  • 问题内容: 我们在内存中使用hdsqldb运行针对数据库运行的junit测试。在通过弹簧配置运行每个测试之前,已设置数据库。一切正常。现在,当测试失败时,可以方便地检查内存数据库中的值。这可能吗?如果可以,怎么办?我们的网址是: jdbc.url = jdbc:hsqldb:mem:testdb; sql.enforce_strict_size = true 每次测试后,数据库都会被破坏。但是,当

  • 问题内容: 我正在编写一个在Linux上运行的Java应用程序(使用Sun的JDK)。它一直在创建目录,我想防止这样做。有什么方法可以阻止Java创建这些文件? 问题答案: 尝试JVM选项 -XX:-UsePerfData 更多信息 来自链接https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html的以下内容可能会有所帮

  • 问题内容: 使用和我可以进入有问题的等待线程,但不知道如何对其进行故障排除或造成此故障的原因。参见下面的Maven依赖项和结果以及带有的等待线程。进一步分析,对于所选版本,Eclipselink和hsqldb之间似乎存在问题。由于升级这两个库而导致出现此问题,因为它们以前分别适用于Eclipselink和hsqldb的2.0.1和1.8.0.10版本。 而堆栈跟踪是: 问题答案: 确实确实看起来像

  • 问题内容: 调用Simple 会产生字节,但是exel会抛出警告。 遗失文件资料 仔细搜索一下,给了我这个链接,并查看了工作表的Javadocs和POI HOW-TO的类似说法。基本上,我不能不丢失一些信息,而应该使用该方法。 虽然写入确实可以正常工作,但我确实需要将字节发送过来。有什么办法可以做到吗?那就是得到字节而没有任何警告。 问题答案: 正如邮件列表中所说的 调用不会返回重建一个完整的Ex