diff options
| author | sternenseemann <sternenseemann@systemli.org> | 2024-05-26 11:50:07 +0200 |
|---|---|---|
| committer | sternenseemann <sternenseemann@systemli.org> | 2024-05-26 16:01:21 +0200 |
| commit | 120f24202b4a0f0bf6986130ff15eef7c0609f50 (patch) | |
| tree | d0e98ea2e7c9d2566f47bccac7eb32303224c88a /pkgs/development/python-modules/rangehttpserver | |
| parent | 8be53459b17157dd244b42aa6a0b660e768324c0 (diff) | |
haskellPackages.mkDerivation: limit GHC_PACKAGE_PATH to test suite
Previously, we would set GHC_PACKAGE_PATH after configure, the reasons
being that
1. Setup.hs configure forbids this from being set since it can make a
build fail that would otherwise succeed (since it influences how
GHC behaves when invoked by Cabal).
2. Setting GHC_PACKAGE_PATH being set is sound in our case, since
we set it precisely to the packages available to Cabal at configure
time, so there should be no room for a mismatch.
3. Some test suites require GHC_PACKAGE_PATH or GHC_ENVIRONMENT to be
set, so they can invoke GHC(i) with build dependencies available.
Cabal >= 3.12 forbids GHC_PACKAGE_PATH from being set after
<https://github.com/haskell/cabal/commit/d6e38041a7c778fadf8f416>.
Setting GHC_ENVIRONMENT would be possible, but is cumbersome without
cabal-install (which has the handy cabal exec command which takes
care of that). Additionally, it is not clear if it'll remain possible
to do that: <https://github.com/haskell/cabal/issues/7792>.
Our solution to Cabal 3.12's change is to be more targeted about setting
GHC_PACKAGE_PATH: We _just_ set it for the actual test suite executable.
This can be achieved by using --test-wrapper which when given is invoked
by Cabal to run the test suite. Here we can set any environment
variables after Cabal has already done its environment checks. As long
as we don't do anything stupid, this should be unproblematic.
Users can also arbitrarily influence what GHC_PACKAGE_PATH will contain
using the NIX_GHC_PACKAGE_PATH_FOR_TEST environment variable. This is
un(der)documented for now, since I want to keep some wiggle room for
changing stuff in the coming weeks. Also it's rarely necessary to
actually touch this variable.
Diffstat (limited to 'pkgs/development/python-modules/rangehttpserver')
0 files changed, 0 insertions, 0 deletions
