Skip to content

Commit

Permalink
switch to v1-build on the nix ci
Browse files Browse the repository at this point in the history
alex and happy aren't available for cabal v2-build in shellFor due to
haskell/cabal#8434
NixOS/nixpkgs#130556
NixOS/nixpkgs#176887

for some reason still needs `cabal update`, but doesn't download
anything from there
  • Loading branch information
liesnikov authored and jespercockx committed Jan 23, 2025
1 parent 4b75622 commit 0d622cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
# 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"
17 changes: 15 additions & 2 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
}

0 comments on commit 0d622cf

Please sign in to comment.