From 67e5c6713a78d140d4e68f55d078e08664484c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Sat, 16 Nov 2024 12:15:07 +0100 Subject: [PATCH 1/5] Build nix develop for all GHCs --- .github/workflows/ci.yml | 23 +++++++++++++++++++++-- rhine/rhine.cabal | 10 +++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 132035d7..59d0b372 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,10 +133,28 @@ jobs: run: nix flake check - name: Build all packages run: nix build --accept-flake-config + + build-devshell: + name: Nix Flake Develop + needs: + - generateMatrix + - build-flake + strategy: + matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v30 + - uses: DeterminateSystems/magic-nix-cache-action@v8 + - uses: cachix/cachix-action@v15 + with: + name: rhine + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Run tests run: | - nix develop --accept-flake-config -c cabal update - nix develop --accept-flake-config -c cabal test all + ghc="ghc$(echo ${{ matrix.ghc }} | tr -d '.')" # Removes the dot from the ghc version and prepends "ghc" + nix develop .#${ghc} --accept-flake-config -c cabal update + nix develop .#${ghc} --accept-flake-config -c cabal test all cabal-check: name: Check and format all cabal files @@ -154,6 +172,7 @@ jobs: needs: - build-cabal - build-flake + - build-devshell runs-on: - ubuntu-latest steps: diff --git a/rhine/rhine.cabal b/rhine/rhine.cabal index 345f769d..a9dc9a42 100644 --- a/rhine/rhine.cabal +++ b/rhine/rhine.cabal @@ -31,11 +31,11 @@ data-files: test/assets/*.txt tested-with: - ghc ==9.2.8 - ghc ==9.4.7 - ghc ==9.6.4 - ghc ==9.8.2 - ghc ==9.10.1 + ghc ==9.2 + ghc ==9.4 + ghc ==9.6 + ghc ==9.8 + ghc ==9.10 source-repository head type: git From c2b98de02fd6001ceee4356e67d28461aade5885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Sat, 16 Nov 2024 14:12:41 +0100 Subject: [PATCH 2/5] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/7f2d3d2febedabd8f5c9761373c99b9dcfa917e1' (2024-11-14) → 'github:NixOS/nixpkgs/dfaa4cb76c2d450d8f396bb6b9f43cede3ade129' (2024-11-16) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7e6dd274..44e5fee5 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1731569569, - "narHash": "sha256-yUjNI34R68uLg95nHzINg8ulpL77p4kOqUsCkMm1F28=", + "lastModified": 1731745710, + "narHash": "sha256-SVeiClbgqL071JpAspOu0gCkPSAL51kSIRwo4C/pghA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7f2d3d2febedabd8f5c9761373c99b9dcfa917e1", + "rev": "dfaa4cb76c2d450d8f396bb6b9f43cede3ade129", "type": "github" }, "original": { From 55a085fd5bf47e453aa6c5e5c0d6e1f472b294ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Sat, 16 Nov 2024 14:05:19 +0100 Subject: [PATCH 3/5] Remove broken dev tools for older GHCs --- flake.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 63909265..2d6fbd8c 100644 --- a/flake.nix +++ b/flake.nix @@ -70,6 +70,10 @@ (hfinal: hprev: lib.optionalAttrs (lib.versionOlder hprev.ghc.version "9.4") { time-domain = doJailbreak hprev.time-domain; }) + (hfinal: hprev: lib.optionalAttrs (lib.versionOlder hprev.ghc.version "9.6") { + cabal-gild = doJailbreak hprev.cabal-gild; + fourmolu = doJailbreak hprev.fourmolu; + }) (hfinal: hprev: lib.optionalAttrs (lib.versionAtLeast hprev.ghc.version "9.10") { # Remove these as nixpkgs progresses! finite-typelits = doJailbreak hprev.finite-typelits; @@ -180,10 +184,12 @@ (_: hp: hp.shellFor { packages = ps: map (pname: ps.${pname}) pnames; nativeBuildInputs = with hp; [ + haskell-language-server + ] ++ lib.optional (lib.versionAtLeast hp.ghc.version "9.4") [ + fourmolu cabal-gild + ] ++ lib.optional (lib.versionAtLeast hp.ghc.version "9.6") [ cabal-install - fourmolu - haskell-language-server ]; }) (hpsFor pkgs)); From f250c212cc3d3354daa04df9c5eda55bccde8e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Fri, 22 Nov 2024 11:57:01 +0100 Subject: [PATCH 4/5] Update 9.10 overrides --- flake.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 2d6fbd8c..257e9771 100644 --- a/flake.nix +++ b/flake.nix @@ -76,15 +76,9 @@ }) (hfinal: hprev: lib.optionalAttrs (lib.versionAtLeast hprev.ghc.version "9.10") { # Remove these as nixpkgs progresses! - finite-typelits = doJailbreak hprev.finite-typelits; + finite-typelits = hprev.finite-typelits_0_2_1_0; - vector-sized = hprev.callHackageDirect - { - pkg = "vector-sized"; - ver = "1.6.1"; - sha256 = "sha256-//EOAwpEEQkdYF88U/bp0uybKleYHRmTWaKsxIZvCeQ="; - } - { }; + vector-sized = hprev.vector-sized_1_6_1; microstache = doJailbreak hprev.microstache; gloss-rendering = doJailbreak hprev.gloss-rendering; From d3b66b745b2c57f83957b3563223a96ab66bac37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Fri, 22 Nov 2024 15:37:57 +0100 Subject: [PATCH 5/5] Free disk space for devshell job --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59d0b372..6a26401c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,6 +144,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Free disk space + run: | + if [ "$(uname --kernel-name)" = "Linux" ]; then + sudo rm -rf /usr/local/* /usr/share/* /opt/* + docker rmi $(docker image ls -aq) + fi - uses: cachix/install-nix-action@v30 - uses: DeterminateSystems/magic-nix-cache-action@v8 - uses: cachix/cachix-action@v15