cabal-testsuite doesn't appear to pass `--with-ghc` (reliably) to its tests
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
I was surprised to see that `$PATH` takes higher priority than `--with-ghc` passed to `cabal-tests`:
```
$ PATH=/opt/ghc/7.10.3/bin:$PATH /stuff3/work/GitHub/cabal/dist-newstyle/build/x86_64-linux/ghc-8.2.2/cabal-testsuite-2.3.0.0/build/cabal-tests/cabal-tests --with-cabal /stuff3/work/GitHub/cabal/dist-newstyle/build/x86_64-linux/ghc-8.2.2/cabal-install-2.3.0.0/build/cabal/cabal --with-ghc ghc-7.8.4 PackageTests/CustomPlain/cabal.test.hs
/opt/ghc/bin/runghc -- '--ghc-arg=-i' '--ghc-arg=-no-user-package-db' '--ghc-arg=-package-db' '--ghc-arg=/stuff/dot-cabal/store/ghc-8.2.2/package.db' '--ghc-arg=-package-db' '--ghc-arg=/stuff3/work/GitHub/cabal/dist-newstyle/packagedb/ghc-8.2.2' '--ghc-arg=-package-id' '--ghc-arg=Cabal-2.3.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=async-2.2.1-fa5cfbb0feef5870b57fa727b744daca9bd233adb1001fb79cf0344492625554' '--ghc-arg=-package-id' '--ghc-arg=base-4.10.1.0' '--ghc-arg=-package-id' '--ghc-arg=cabal-testsuite-2.3.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=clock-0.7.2-2bf386cc5218e554a06f3801deee884dbdabb99e801de277e9e710fb0f49c8a9' '--ghc-arg=-package-id' '--ghc-arg=exceptions-0.8.3-151f0e2f5d31fcb4734c4dc0a2b5caa7a141e0c512182bd2b7caef0d1a2d1f1f' '--ghc-arg=-package-id' '--ghc-arg=filepath-1.4.1.2' '--ghc-arg=-package-id' '--ghc-arg=optparse-applicative-0.14.1.0-c5692b9760590762deba76e281e01df09d94e21e029bb30c74f0f8c8b4e476a1' '--ghc-arg=-package-id' '--ghc-arg=process-1.6.1.0' PackageTests/CustomPlain/cabal.test.hs --builddir /stuff3/work/GitHub/cabal/dist-newstyle/build/x86_64-linux/ghc-8.2.2/cabal-testsuite-2.3.0.0 PackageTests/CustomPlain/cabal.test.hs --with-cabal /stuff3/work/GitHub/cabal/dist-newstyle/build/x86_64-linux/ghc-8.2.2/cabal-install-2.3.0.0/build/cabal/cabal --with-ghc ghc-7.8.4
+ /stuff3/work/GitHub/cabal/dist-newstyle/build/x86_64-linux/ghc-8.2.2/cabal-install-2.3.0.0/build/cabal/cabal new-build '-vverbose +markoutput +nowrap' --builddir /stuff3/work/GitHub/cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.dist/work/./dist --project-file cabal.project -j1 -v1
Resolving dependencies...
Build profile: -w ghc-7.10.3 -O1
In order, the following will be built (use -v for more details):
- plain-0.1.0.0 (lib:plain) (first run)
[1 of 1] Compiling Main ( /stuff3/work/GitHub/cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.dist/work/dist/build/x86_64-linux/ghc-7.10.3/plain-0.1.0.0/setup/setup.hs, /stuff3/work/GitHub/cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.dist/work/dist/build/x86_64-linux/ghc-7.10.3/plain-0.1.0.0/setup/Main.o )
Linking /stuff3/work/GitHub/cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.dist/work/./dist/build/x86_64-linux/ghc-7.10.3/plain-0.1.0.0/setup/setup ...
ThisIsCustomYeah
Configuring plain-0.1.0.0...
Warning: No 'build-type' specified. If you do not need a custom Setup.hs or
./configure script then use 'build-type: Simple'.
ThisIsCustomYeah
Preprocessing library plain-0.1.0.0...
[1 of 1] Compiling A ( A.hs, /stuff3/work/GitHub/cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.dist/work/dist/build/x86_64-linux/ghc-7.10.3/plain-0.1.0.0/build/A.o )
In-place registering plain-0.1.0.0...
ThisIsCustomYeah
ThisIsCustomYeah
Creating package registration file:
/stuff3/work/GitHub/cabal/cabal-testsuite/PackageTests/CustomPlain/cabal.dist/work/dist/tmp/package-registration--18983/pkgConf
OK
```
Contributor guide
Assessment
This issue has not been assessed yet.