hs: GHC-toolchain installer broker

[ bsd3, development, library, program ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), containers, data-default, directory, enum-text, filepath, fmt, hs, optparse-applicative, possibly, text, typed-process [details]
License BSD-3-Clause
Copyright 2021 Chris Dornan
Author Chris Dornan <chris@chrisdornan.com>
Maintainer Chris Dornan <chris@chrisdornan.com>
Category Development
Home page https://github.com/cdornan/hs#readme
Bug tracker https://github.com/cdornan/hs/issues
Source repo head: git clone https://github.com/cdornan/hs
Uploaded by ChrisDornan at 2021-07-06T12:20:49Z
Distributions
Executables hs
Downloads 413 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-07-06 [all 1 reports]

Readme for hs-0.1.0.2

[back to package description]

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.