[ANN] GHCup 0.2.2.0 release

I’m very pleased to announce the release of :tada: 0.2.2.0 :tada:

:flexed_biceps: Motivation

The work on this release was sponsored by IOG, since their need for shipping alternative compilers coincided with the Installer DSL feature request that had been lingering on the tracker for years.

What I ended up implementing is not quite a DSL, since I wanted to keep the complexity low, both in terms of implementation and in terms of “packaging effort” for end users.

This release is a major rewrite and took around 2 months. While I’ve been investing a lot of time in tests and correctness… there might be things that slipped through.

:up_button: How to update

If you haven’t installed yet, follow the instructions at https://www.haskell.org/ghcup/

Otherwise simply run ghcup upgrade.

:technologist: For end users

New tools

For regular end users, I think the most exciting change is the new “3rdparty” channel, which gives access to non-core tools and compilers such as Agda, ormou, hlint, etc.

After upgrading, add it via:

ghcup config add-release-channel 3rdparty

Then run ghcup tui to get an overview of available tools.

Asciinema video

New online documentation

The documentation uses a new readthedocs format (similar to stack) and is now structured much better: https://www.haskell.org/ghcup/guide/

:package: For upstream projects/packagers

Upstream projects and end users can now in theory ship arbitrary tools through ghcup. Refer to the Adding new tools documentation.

A lot of time has also been invested in supporting Dhall metadata. GHCup can now:

  • consume metadata in the form of resolved Dhall text files (no imports, requires .dhall extension)
  • consume metadata from Dhall binary format (requires .dhallb extension)
  • convert an existing yaml metadata to dhall format (see ghcup generate metadata-to-dhall)
  • dump the Dhall “schema” (the GHCupInfo type) via ghcup generate dhall-schema

The other major feature is revisions. These would allow e.g. the HLS project to add new GHC binaries to an existing release (in case that doesn’t require source code changes) without having to release a new hackage version etc. It also allows any other non source code fixes to bindists

Refer to the Packaging Guide for more information.

:page_facing_up: Full ChangeLog

New feature

  • implement “installer DSL” (custom tool installation) wrt #141
    • run ghcup config add-release-channel 3rdparty to get access to tools like hlint, ormolu, agda etc.
    • refer to the Packaging documentation for more details
    • this caused heavy changes to the internal ghcup layout and database
  • major design change in the TUI (two-pane view)
    • use left/right arrow keys or tab to switch between the tool and version list
  • implement revisions
    • these are “distributor” updates (e.g. fixes to bindists or the metadata) without requiring a proper upstream release
    • refer to the documentation for more details
  • pave the way for OpenBSD support wrt #182
    • we still lack GHC bindists
  • add experimental support for Dhall metadata wrt #60
    • dump the Dhall schema via ghcup generate dhall-schema
  • add ghcup config reset subcommand by Vladislav Sabanov
  • add experimental healthcheck command ghcup check tool ghc <ver>
    • this may only give useful information on newly installed versions since the database needs to be populated

Improvements and bug fixes

  • Introduce --verbosity=<LEVEL> (0-2) option
    • --verbose still exists and is equivalent to --verbosity=1
    • ghcup won’t spam the installed file list on --verbose/--verbosity=1 anymore
  • Store log files under XDG_STATE_HOME instead of XDG_CACHE_HOME when following XDG style by Eisuke Kawashima
  • Make --tool and --show-criteria a ‘many’ parser, fixes #1235
  • Ignore local cache when dlUri has a file: scheme, fixes #1312
  • don’t show update warnings twice (if it’s the same old warning)
  • Fix ghcup whereis on windows by only using forward slashes in the output
  • lots of other things we forgot

Breaking changes

  • ghcup install <ghc-ver> is gone, use cabal install ghc <ghc-ver>
  • ghcup install-cabal <cabal-ver> is gone, use cabal install cabal <cabal-ver>
  • ghcup compile hls --isolate=/tmp/foo installs binaries into /tmp/foo/bin instead of /tmp/foo
  • ghcup list may show -rX suffix on versions when there’s a revision update
    • if you rely on version equality checks in a script and don’t want to deal with parsing those, you may consider ghcup list --show-revisions=none
  • ~/.ghcup/bin/ is now all symlinks (except for ghcup binary itself) and the link targets may have different shape

:speaking_head: Contributors

  • with design discussions and guidance
  • with testing
  • with reviews
  • with code contributions
    • Ai-Ya-Ya
    • Andreas Klebinger
    • Andreas Schacker
    • Divam
    • Eisuke Kawashima
    • Jonathan Knowles
    • Suhani370
    • Tom Ellis
    • Tom Smeding
    • Vladislav Sabanov
42 Likes

When installing pandoc on an M1 mac, I get:

[ Info  ] downloading: https://github.com/jgm/pandoc/releases/download/3.9.0.2/pandoc-3.9.0.2-arm64-macOS.zip as file /Users/dunham/.ghcup/tmp/ghcup-8b56780355948305/pandoc-3.9.0.2-arm64-macOS.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 34.9M  100 34.9M    0     0  41.7M      0 --:--:-- --:--:-- --:--:-- 41.7M
[ Info  ] verifying digest of: pandoc-3.9.0.2-arm64-macOS.zip
[ Info  ] Unpacking: pandoc-3.9.0.2-arm64-macOS.zip to /Users/dunham/.ghcup/tmp/ghcup-8bc4aa665b0b947f
Error: [GHCup-00190] Tar directory does not exist: "pandoc-3.9.0.2"

The directory in that tarfile is named pandoc-3.9.0.2-arm64.

1 Like

Thanks, should be fixed.

2 Likes

Did you mean to write ghcup install ... here, or is there some cabal-GHCup-integration that I wasn’t aware of yet?

3 Likes

A bug when using --install-targets "..." when installing GHC has been fixed in 0.2.3.0.

More bugs were found, specifically two that affected the VSCode Haskell extension. Hence I released the bugfix version 0.2.6.0 (full changelog here)

If you had trouble getting HLS to work, this might fix it:

ghcup upgrade

Thanks to the people at ZuriHac notifying me about those issues and everyone involved testing.

5 Likes