From f14d5197c25e6bb0bb2e4426f15b2b47fb7516e0 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Mon, 2 Oct 2023 10:47:26 -0400 Subject: [PATCH] be explicit about supporting / testing ghc 8.6.5 --- .gitlab-ci.yml | 4 ++-- flake.nix | 29 ++++++++++++++++++++--------- tahoe-chk.cabal | 2 ++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8252b04..5ac789f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,10 +23,10 @@ hlint: nix run .#hlint -- src/ test/ # Use cabal to build the library and test suite and then run the test suite. -cabal-build-and-test: +"cabal-build-and-test-8.6.5": script: - | - nix run .#cabal-test + nix run .#cabal-test-865 # Use nix to build the library and test suite and run the test suite. nix-build-and-test: diff --git a/flake.nix b/flake.nix index ced2464..68d3408 100644 --- a/flake.nix +++ b/flake.nix @@ -28,20 +28,22 @@ compilerVersion = ghcVersion; packageName = "tahoe-chk"; }; - in { - checks = hslib.checks {}; - devShells = hslib.devShells {}; - packages = hslib.packages {}; - apps.hlint = hslib.apps.hlint {}; - # Using the working directory of `nix run`, do a build with cabal and - # then run the test suite. - apps.cabal-test = { + # string -> flake app + # + # make a flake app that runs the test suite using cabal and the given + # version of ghc. The ghc version is found in the nixpkgs + # `haskell.compiler` attribute set. + mkCabalTest = ghcVersion: { type = "app"; program = "${ pkgs.writeShellApplication { name = "cabal-build-and-test"; - runtimeInputs = with pkgs; [pkg-config haskell.compiler.${ghcVersion} cabal-install]; + runtimeInputs = with pkgs; [ + pkg-config + haskell.compiler.${ghcVersion} + cabal-install + ]; text = '' set -ex @@ -53,6 +55,15 @@ } }/bin/cabal-build-and-test"; }; + in { + checks = hslib.checks {}; + devShells = hslib.devShells {}; + packages = hslib.packages {}; + apps.hlint = hslib.apps.hlint {}; + + # Using the working directory of `nix run`, do a build with cabal and + # then run the test suite. + apps.cabal-test-865 = mkCabalTest "ghc865Binary"; apps.release = { type = "app"; diff --git a/tahoe-chk.cabal b/tahoe-chk.cabal index 383af07..78ce5b2 100644 --- a/tahoe-chk.cabal +++ b/tahoe-chk.cabal @@ -22,6 +22,8 @@ extra-source-files: ChangeLog.md README.md +tested-with: GHC ==8.6.5 + source-repository head type: git location: -- GitLab