Repository navigation
Closed
Description
T4154 failed on Windows in #5186 because it accessed the package index from Hackage, and the output showed more versions of time than expected:
stderr:
*** Exception: Expected cabal to reject the setup dependency on the installed time,
actual output:
"C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.0.2\bin\ghc.exe" "--print-global-package-db"
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent cabal update
index-state(hackage.haskell.org) = 2018-03-05T01:59:08Z
Failed to query pkg-config, Cabal will continue without solving for pkg-config constraints: dieVerbatim: user error (CallStack (from HasCallStack):
die', called at .\Distribution\Simple\Program\Db.hs:423:28 in Cabal-2.3.0.0-6e1C1nBFJd7KTLWUhJzMW6:Distribution.Simple.Program.Db
requireProgram, called at .\Distribution\Solver\Types\PkgConfigDb.hs:65:21 in cabal-install-2.3.0.0-87cSSu67wwjHwxtCcREn7E:Distribution.Solver.Types.PkgConfigDb
cabal.exe: The program 'pkg-config' is required but it could not be found.
)
-----BEGIN CABAL OUTPUT-----
Resolving dependencies...
-----END CABAL OUTPUT-----
CallStack (from HasCallStack):
die', called at .\Distribution\Client\ProjectPlanning.hs:550:42 in cabal-install-2.3.0.0-87cSSu67wwjHwxtCcREn7E:Distribution.Client.ProjectPlanning
-----BEGIN CABAL OUTPUT-----
cabal.exe: Could not resolve dependencies:
[__0] trying: time-99999 (user goal)
[__1] trying: time:setup.Cabal-1.24.2.0/installed-1.2... (dependency of time)
[__2] next goal: time:setup.time (dependency of time:setup.Cabal)
[__2] rejecting: time:setup.time~>time-99999 (conflict: time:setup.Cabal => time:setup.time==1.6.0.1/installed-1.6...)
[__2] rejecting: time:setup.time-99999 (multiple instances)
[__2] rejecting: time:setup.time-1.9.1, time:setup.time-1.9, time:setup.time-1.8.0.4, time:setup.time-1.8.0.3, time:setup.time-1.8.0.2, time:setup.time-1.8.0.1, time:setup.time-1.8, time:setup.time-1.7.0.1, time:setup.time-1.7, time:setup.time-1.6.0.1/installed-1.6..., time:setup.time-1.6.0.1, time:setup.time-1.6, time:setup.time-1.5.0.1, time:setup.time-1.5, time:setup.time-1.4.2, time:setup.time-1.4.1, time:setup.time-1.4.0.2, time:setup.time-1.4.0.1, time:setup.time-1.4, time:setup.time-1.3, time:setup.time-1.2.0.5, time:setup.time-1.2.0.4, time:setup.time-1.2.0.3, time:setup.time-1.2.0.2, time:setup.time-1.2.0.1, time:setup.time-1.2, time:setup.time-1.1.4, time:setup.time-1.1.3, time:setup.time-1.1.2.4, time:setup.time-1.1.2.3, time:setup.time-1.1.2.2, time:setup.time-1.1.2.1, time:setup.time-1.1.2.0, time:setup.time-1.0 (constraint from command line flag requires ==99999)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: time:setup.time (222), time:setup.Cabal (61), time (44), time:setup.base (28), base (27)
-----END CABAL OUTPUT-----
*** unexpected failure for PackageTests\Regression\T4154\install-time-with-constraint.test.hs
Full AppVeyor log: https://ci.appveyor.com/project/23Skidoo/cabal/build/%234991%20(master)
Travis log (Linux, GHC 8.0.2): https://travis-ci.org/haskell/cabal/jobs/349104904
I didn't have time to look into this further, but I saw that cabal-testsuite avoids creating the default repository configuration for tests:
cabal/cabal-testsuite/Test/Cabal/Monad.hs
Lines 342 to 346 in 87c05e6
| -- NB: it's important to initialize this ourselves, as | |
| -- the default configuration hardcodes Hackage, which we do | |
| -- NOT want to assume for these tests (no test should | |
| -- hit Hackage.) | |
| liftIO $ createDirectoryIfMissing True (testHomeDir env </> ".cabal") |
Activity
hvr commentedon Mar 5, 2018
that's btw something that can easily be avoided on Appveyor, since appveyor has
pkg-configinstalled; iirc all one needs to make sure is thatC:\msys64\mingw64\bin;C:\msys64\usr\binis added toPATH.sebright commentedon Mar 12, 2018
I think the problem is that cabal uses the APPDATA directory to locate the config file, so it reads the user's config file, which points to Hackage. This is similar to #2678. We could set the CABAL_CONFIG environment variable, unless the tests also need to access other files from the cabal directory. Maybe we should add a way to override the location of the whole directory.
Set CABAL_DIR in cabal-tests (fixes haskell#5187).
Set CABAL_DIR in cabal-tests (fixes haskell#5187).
Set CABAL_DIR in cabal-tests (fixes haskell#5187).
Set CABAL_DIR in cabal-tests (fixes haskell#5187).
Set CABAL_DIR in cabal-tests (fixes haskell#5187).
Set CABAL_DIR in cabal-tests (fixes #5187).