MyNixOS website logo
Description

GHC-toolchain installer broker.

A tool for keeping track of where GHC installations have been placed and reporting that to the build managers (like stack and cabal-install).

hs: a Haskell installation-manager broker

Build managers like cabal-install and stack need access to installed toolchains managed by installation managers like stack and ghcup. hs keeps track of the toolchains installed by the managers and locates them on request for the build managers.

$ hs whereis ghc-8.10.4
/Users/chris/.stack/programs/x86_64-osx/ghc-8.10.4

We have a prototype integration for stack (watch this space) and a collection of wrappers for each tool that cabal-install can use, like the following for ghc-pkg-8.10.4:

#!/usr/bin/env bash
hs run ghc-pkg-8.10.4 --ask-install -- "$@"

Used in this way, hs will try to locate ghc-pkg-8.10.4, asking the user if to proceed with an installation with the preferred installation manager (stack or ghcup) if it cannot locate the installation.

To list the installation in your development environment try this:

$ stack list
8.6.5      stack /Users/chris/.stack/programs/x86_64-osx/ghc-8.6.5
8.8.3      stack /Users/chris/.stack/programs/x86_64-osx/ghc-8.8.3
8.8.4      stack /Users/chris/.stack/programs/x86_64-osx/ghc-8.8.4
8.10.4     stack /Users/chris/.stack/programs/x86_64-osx/ghc-8.10.4
8.10.5     ghcup /Users/chris/.ghcup/ghc/8.10.5
9.0.1      ghcup /Users/chris/.ghcup/ghc/9.0.1

To configure the defaults you can do these.

# ghcup to carry out installations requested from the build tools
$ hs use ghcup stack
# ask before installing any missing toolchains
$ hs use-install-mode ask-install
# specify the deafult toolchain when no version specified
$ hs use-compiler 8.10.4

To dump a new set of wrappers into ~/.hs/bin with your preferred ask-install installation option:

$ hs dump-ghc-wrappers ask-install

With the path set up right your stack and cabal-install projects should play nicely together.

Share and Enjoy!

Installation Instructions

  1. Build and install hs on your path.

  2. Build and install this patched version of stack-2.8.0 and put it on the path.

  3. Put these wrapper scripts on your path.

Metadata

Version

0.1.0.2

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows