haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.63k stars 697 forks source link

Report when `--with-cabal` path doesn't exist #9778

Open philderbeast opened 8 months ago

philderbeast commented 8 months ago

Could we please check that what is given as --with-cabal exists when that is possible with cabal-tests? Here I made the mistake of building locally with ghc-9.4.8 not having remembered that I'd switched from ghc-9.8.1. It would be much nicer to read something like the following than the dieWithException dump with a line number, output that runs to about 40 lines in my terminal at full screen (with the zoom I like to read at).

the path supplied as '--with-cabal' does not exist

$ ls ./dist-newstyle/build/x86_64-linux/
ghc-9.4.8/

$ cabal run cabal-testsuite:cabal-tests -- --with-cabal=./dist-newstyle/build/x86_64-linux/ghc-9.8.1/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal cabal-testsuite/PackageTests/CopyHie/setup.test.hs
Warning: this is a debug build of cabal-install with assertions enabled.
No Cabal library specified, using boot Cabal library with cabal-install tests
/home/philderbeast/.ghcup/ghc/9.4.8/bin/runghc-9.4.8 -- '--ghc-arg=-i' '--ghc-arg=-hide-all-packages' '--ghc-arg=-no-user-package-db' '--ghc-arg=-package-db' '--ghc-arg=/home/philderbeast/.cabal/store/ghc-9.4.8/package.db' '--ghc-arg=-package-db' '--ghc-arg=/home/philderbeast/dev/src/cabalism/cabal/dist-newstyle/packagedb/ghc-9.4.8' '--ghc-arg=-package-id' '--ghc-arg=Cabal-3.11.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=Cabal-syntax-3.11.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=base-4.17.2.1' '--ghc-arg=-package-id' '--ghc-arg=bytestring-0.11.5.3' '--ghc-arg=-package-id' '--ghc-arg=cabal-testsuite-3-inplace' '--ghc-arg=-package-id' '--ghc-arg=directory-1.3.8.1-0f7543c7a36e8872aef2776431a2ac5ff8e0f087c38e535362e973649119fa64' '--ghc-arg=-package-id' '--ghc-arg=exceptions-0.10.5' '--ghc-arg=-package-id' '--ghc-arg=filepath-1.4.300.1-de3c7dc5ca566ddf0dcf5e6cbd1f946f273ae166a9fbdac629232625ed0c325e' '--ghc-arg=-package-id' '--ghc-arg=process-1.6.18.0-471defa6b4e3554e73d84d1184870b84de8b57b297ada8c7318b335cd8b25a61' '--ghc-arg=-package-id' '--ghc-arg=time-1.12.2' '--ghc-arg=-package-id' '--ghc-arg=transformers-0.5.6.2' '--ghc-arg=-package-id' '--ghc-arg=unix-2.8.5.0-292ab3d9d702c08eed334dea12f62ba6a79bfd018f0c70d60479c9b15ceff7e6' cabal-testsuite/PackageTests/CopyHie/setup.test.hs --builddir /home/philderbeast/dev/src/cabalism/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.8/cabal-testsuite-3 cabal-testsuite/PackageTests/CopyHie/setup.test.hs --with-cabal ./dist-newstyle/build/x86_64-linux/ghc-9.8.1/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal
setup.test.hs: VerboseException [("dieWithException",SrcLoc {srcLocPackage = "Cabal-3.11.0.0-inplace", srcLocModule = "Distribution.Simple.Program.Db", srcLocFile = "src/Distribution/Simple/Program/Db.hs", srcLocStartLine = 372, srcLocStartCol = 16, srcLocEndLine = 372, srcLocEndCol = 32})] 1709568919.669901272s (Verbosity {vLevel = Normal, vFlags = fromList [], vQuiet = False}) (ConfigureProgram "cabal" "./dist-newstyle/build/x86_64-linux/ghc-9.8.1/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal")
cabal-tests: callProcess: /home/philderbeast/.ghcup/ghc/9.4.8/bin/runghc-9.4.8 "--" "--ghc-arg=-i" "--ghc-arg=-hide-all-packages" "--ghc-arg=-no-user-package-db" "--ghc-arg=-package-db" "--ghc-arg=/home/philderbeast/.cabal/store/ghc-9.4.8/package.db" "--ghc-arg=-package-db" "--ghc-arg=/home/philderbeast/dev/src/cabalism/cabal/dist-newstyle/packagedb/ghc-9.4.8" "--ghc-arg=-package-id" "--ghc-arg=Cabal-3.11.0.0-inplace" "--ghc-arg=-package-id" "--ghc-arg=Cabal-syntax-3.11.0.0-inplace" "--ghc-arg=-package-id" "--ghc-arg=base-4.17.2.1" "--ghc-arg=-package-id" "--ghc-arg=bytestring-0.11.5.3" "--ghc-arg=-package-id" "--ghc-arg=cabal-testsuite-3-inplace" "--ghc-arg=-package-id" "--ghc-arg=directory-1.3.8.1-0f7543c7a36e8872aef2776431a2ac5ff8e0f087c38e535362e973649119fa64" "--ghc-arg=-package-id" "--ghc-arg=exceptions-0.10.5" "--ghc-arg=-package-id" "--ghc-arg=filepath-1.4.300.1-de3c7dc5ca566ddf0dcf5e6cbd1f946f273ae166a9fbdac629232625ed0c325e" "--ghc-arg=-package-id" "--ghc-arg=process-1.6.18.0-471defa6b4e3554e73d84d1184870b84de8b57b297ada8c7318b335cd8b25a61" "--ghc-arg=-package-id" "--ghc-arg=time-1.12.2" "--ghc-arg=-package-id" "--ghc-arg=transformers-0.5.6.2" "--ghc-arg=-package-id" "--ghc-arg=unix-2.8.5.0-292ab3d9d702c08eed334dea12f62ba6a79bfd018f0c70d60479c9b15ceff7e6" "cabal-testsuite/PackageTests/CopyHie/setup.test.hs" "--builddir" "/home/philderbeast/dev/src/cabalism/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.8/cabal-testsuite-3" "cabal-testsuite/PackageTests/CopyHie/setup.test.hs" "--with-cabal" "./dist-newstyle/build/x86_64-linux/ghc-9.8.1/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal" (exit 1): failed
alt-romes commented 8 months ago

I'm in support. Probably an easy thing to do too.