File tree Expand file tree Collapse file tree 4 files changed +23
-14
lines changed
Distribution/Solver/Modular
tests/UnitTests/Distribution/Solver/Modular
PackageTests/Backpack/Includes2 Expand file tree Collapse file tree 4 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ module Distribution.Solver.Modular.Package
18
18
, unPN
19
19
) where
20
20
21
- import Data.List as L
21
+ import Prelude ()
22
+ import Distribution.Solver.Compat.Prelude
22
23
23
24
import Distribution.Package -- from Cabal
24
25
import Distribution.Deprecated.Text (display )
@@ -57,14 +58,12 @@ data I = I Ver Loc
57
58
-- | String representation of an instance.
58
59
showI :: I -> String
59
60
showI (I v InRepo ) = showVer v
60
- showI (I v (Inst uid)) = showVer v ++ " /installed" ++ shortId uid
61
+ showI (I v (Inst uid)) = showVer v ++ " /installed" ++ extractPackageAbiHash uid
61
62
where
62
- -- A hack to extract the beginning of the package ABI hash
63
- shortId = snip (splitAt 4 ) (++ " ..." )
64
- . snip ((\ (x, y) -> (reverse x, y)) . break (== ' -' ) . reverse ) (' -' : )
65
- . display
66
- snip p f xs = case p xs of
67
- (ys, zs) -> (if L. null zs then id else f) ys
63
+ extractPackageAbiHash xs =
64
+ case first reverse $ break (== ' -' ) $ reverse (display xs) of
65
+ (ys, [] ) -> ys
66
+ (ys, _) -> ' -' : ys
68
67
69
68
-- | Package instance. A package name and an instance.
70
69
data PI qpn = PI qpn I
Original file line number Diff line number Diff line change @@ -708,6 +708,18 @@ tests = [
708
708
" minimize conflict set with --minimize-conflict-set"
709
709
, testNoMinimizeConflictSet
710
710
" show original conflict set with --no-minimize-conflict-set"
711
+ , runTest $
712
+ let db = [ Right $ exAv " my-package" 1 [ExFix " other-package" 3 ]
713
+ , Left $ exInst " other-package" 2 " other-package-2.0.0" [] ]
714
+ msg = " rejecting: other-package-2.0.0/installed-2.0.0"
715
+ in mkTest db " show full installed package version (issue #5892)" [" my-package" ] $
716
+ solverFailure (isInfixOf msg)
717
+ , runTest $
718
+ let db = [ Right $ exAv " my-package" 1 [ExFix " other-package" 3 ]
719
+ , Left $ exInst " other-package" 2 " other-package-AbCdEfGhIj0123456789" [] ]
720
+ msg = " rejecting: other-package-2.0.0/installed-AbCdEfGhIj0123456789"
721
+ in mkTest db " show full installed package ABI hash (issue #5892)" [" my-package" ] $
722
+ solverFailure (isInfixOf msg)
711
723
]
712
724
]
713
725
where
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ Warning: solver failed to find a solution:
101
101
Could not resolve dependencies:
102
102
[__0] trying: exe-0.1.0.0 (user goal)
103
103
[__1] next goal: src (dependency of exe)
104
- [__1] rejecting: src-<VERSION>/installed-<HASH>... (conflict: src => mylib==0.1.0.0 /installed-0.1... , src => mylib==0.1.0.0 /installed-0.1... )
104
+ [__1] rejecting: src-<VERSION>/installed-<HASH> (conflict: src => mylib==<VERSION> /installed-<HASH> , src => mylib==<VERSION> /installed-<HASH> )
105
105
[__1] fail (backjumping, conflict set: exe, src)
106
106
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: exe (2), src (2)
107
107
Trying configure anyway.
Original file line number Diff line number Diff line change @@ -33,13 +33,11 @@ normalizeOutput nenv =
33
33
. resub (posixRegexEscape (normalizerRoot nenv)) " <ROOT>/"
34
34
. resub (posixRegexEscape (normalizerTmpDir nenv)) " <TMPDIR>/"
35
35
. appEndo (F. fold (map (Endo . packageIdRegex) (normalizerKnownPackages nenv)))
36
- -- Look for foo- 0.1/installed-0d6...
36
+ -- Look for 0.1/installed-0d6uzW7Ubh1Fb4TB5oeQ3G
37
37
-- These installed packages will vary depending on GHC version
38
- -- Makes assumption that installed packages don't have numbers
39
- -- in package name segment.
40
38
-- Apply this before packageIdRegex, otherwise this regex doesn't match.
41
- . resub " ([a-zA-Z]+(-[a-zA-Z])*)-[ 0-9]+(\\ .[0-9]+)*/installed-[A-Za-z0-9.]+"
42
- " \\ 1- <VERSION>/installed-<HASH>... "
39
+ . resub " [ 0-9]+(\\ .[0-9]+)*/installed-[A-Za-z0-9.+ ]+"
40
+ " <VERSION>/installed-<HASH>"
43
41
-- Normalize architecture
44
42
. resub (posixRegexEscape (display (normalizerPlatform nenv))) " <ARCH>"
45
43
-- Some GHC versions are chattier than others
You can’t perform that action at this time.
0 commit comments