From 0d622cfb452bfd8b4dd5ac849c5f219d90c59939 Mon Sep 17 00:00:00 2001 From: liesnikov <17168103+liesnikov@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:59:01 +0100 Subject: [PATCH] switch to v1-build on the nix ci alex and happy aren't available for cabal v2-build in shellFor due to https://github.com/haskell/cabal/issues/8434 https://github.com/NixOS/nixpkgs/issues/130556 https://github.com/NixOS/nixpkgs/issues/176887 for some reason still needs `cabal update`, but doesn't download anything from there --- .github/workflows/nix-ci.yml | 3 ++- nix/shell.nix | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index 98ceb035..c65c1fa9 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -43,4 +43,5 @@ jobs: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v22 - uses: DeterminateSystems/magic-nix-cache-action@v2 - - run: nix develop -Lv -c bash -c "cabal build" \ No newline at end of file + # for some reason this doesn't work without update, even though it doesn't download anything + - run: nix develop -Lv -c bash -c "cabal update; cabal v1-build" \ No newline at end of file diff --git a/nix/shell.nix b/nix/shell.nix index 9e5e46ef..aaa96f59 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -3,11 +3,24 @@ agda2hs-hs ? (import ./lib.nix { inherit pkgs; }).agda2hs-hs, }: pkgs.haskellPackages.shellFor { + # This doesn't result in a shell where you can use cabal (v2-)build, + # due to build-tool-depends in Agda's .cabal file, so for now only v1-build works + # Making cabal re-install alex and happy from Hackage can work, + # which will be done if the user runs `cabal update` and `cabal build`. + # relevant issues listed in: + # https://gist.github.com/ScottFreeCode/ef9f254e2dd91544bba4a068852fc81f + # main ones are: + # https://github.com/haskell/cabal/issues/8434 + # https://github.com/NixOS/nixpkgs/issues/130556 + # https://github.com/NixOS/nixpkgs/issues/176887 packages = p: [ agda2hs-hs ]; - buildInputs = with pkgs.haskellPackages; [ + nativeBuildInputs = with pkgs.haskellPackages; [ + # related to haskell cabal-install - cabal2nix haskell-language-server + # general goodies pkgs.agda + pkgs.nixfmt-rfc-style + cabal2nix ]; }