Skip to content

cabal2nix/test: support Cabal >= 3.14#656

Merged
wolfgangwalther merged 6 commits intomasterfrom
ghc-9.12
Apr 23, 2025
Merged

cabal2nix/test: support Cabal >= 3.14#656
wolfgangwalther merged 6 commits intomasterfrom
ghc-9.12

Conversation

@sternenseemann
Copy link
Member

We don't pass a CWD to readGenericPackageDescription since the whole test suite uses the working directory of the process to find the test data anyways (which we could improve in principle…).

Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM.

Should we add GHC 9.12 for CI at the same time to confirm it builds there as well?

This enables us to do more elaborate overrides (which should be gated
behind a flag, though!) which are unlikely to work with _any_ Nixpkgs
revision.
The minimal flag is intended to disable “superfluous” stuff, i.e.
anything that isn't necessary to build the included packages and run
their tests. It is used to determine withHls for now, but has a less
specific meaning.

The idea is that you use

  nix-shell --arg minimal true --arg pkgs "(import <nixpkgs> {})"

when using a nixpkgs version different from the pin.
This takes a while to compile unfortunately, so it is possible to
disable it using --arg minimal false. Maybe it should be excluded by
default?
We don't pass a CWD to readGenericPackageDescription since the whole
test suite uses the working directory of the process to find the test
data anyways (which we could improve in principle…).
@sternenseemann
Copy link
Member Author

Should we add GHC 9.12 for CI at the same time to confirm it builds there as well?

Done, I've made the haskell-ci changes in this PR as well now.

@wolfgangwalther
Copy link
Contributor

wolfgangwalther commented Apr 23, 2025

This takes a while to compile unfortunately, so it is possible to disable it using --arg minimal false. Maybe it should be excluded by default?

I wonder whether it's possible to set this to minimal for direnv somehow. So, when using direnv, it would be fast, but when doing an explicit nix-shell it would load everything. Personally, that would make it nice UX for me.

haskell-ci takes a while to compile and is probably not always
necessary. We should keep HLS since many editors use direnv to find HLS
and direnv will use the default GHC / HLS from the pinned nixpkgs
revision which should be cached.
@sternenseemann
Copy link
Member Author

Done, kept HLS for now since I think editors will struggle to find it otherwise.

@wolfgangwalther
Copy link
Contributor

wolfgangwalther commented Apr 23, 2025

direnv / nix-shell works very well.

The only thing that doesn't work, yet, is to do nix-shell --argstr ghcVersion 9122 - because the dependencies are still broken (NixOS/nixpkgs#400177), but that's certainly not the default of this PR.

@wolfgangwalther wolfgangwalther merged commit 43fbd58 into master Apr 23, 2025
8 checks passed
@wolfgangwalther wolfgangwalther deleted the ghc-9.12 branch April 23, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants