File tree Expand file tree Collapse file tree 4 files changed +14
-20
lines changed
Distribution/Solver/Modular
tests/UnitTests/Distribution/Solver/Modular
PackageTests/Backpack/Includes2 Expand file tree Collapse file tree 4 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ module Distribution.Solver.Modular.Package
18
18
, unPN
19
19
) where
20
20
21
- import Prelude ()
22
- import Distribution.Solver.Compat.Prelude
21
+ import Data.List as L
23
22
24
23
import Distribution.Package -- from Cabal
25
24
import Distribution.Deprecated.Text (display )
@@ -58,12 +57,14 @@ data I = I Ver Loc
58
57
-- | String representation of an instance.
59
58
showI :: I -> String
60
59
showI (I v InRepo ) = showVer v
61
- showI (I v (Inst uid)) = showVer v ++ " /installed" ++ extractPackageAbiHash uid
60
+ showI (I v (Inst uid)) = showVer v ++ " /installed" ++ shortId uid
62
61
where
63
- extractPackageAbiHash xs =
64
- case first reverse $ break (== ' -' ) $ reverse (display xs) of
65
- (ys, [] ) -> ys
66
- (ys, _) -> ' -' : ys
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
67
68
68
69
-- | Package instance. A package name and an instance.
69
70
data PI qpn = PI qpn I
Original file line number Diff line number Diff line change @@ -708,15 +708,6 @@ 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.0" []
714
- , Left $ exInst " other-package" 1 " other-package-AbCdEfGhIj0123456789" [] ]
715
- msg = " rejecting: other-package-2.0.0/installed-2.0.0.0, "
716
- ++ " other-package-1.0.0/installed-AbCdEfGhIj0123456789 "
717
- ++ " (conflict: my-package => other-package==3.0.0)"
718
- in mkTest db " show full installed package ABI hash (issue #5892)" [" my-package" ] $
719
- solverFailure (isInfixOf msg)
720
711
]
721
712
]
722
713
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==<VERSION> /installed-<HASH> , src => mylib==<VERSION> /installed-<HASH> )
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... )
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,11 +33,13 @@ 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 0.1/installed-0d6uzW7Ubh1Fb4TB5oeQ3G
36
+ -- Look for foo- 0.1/installed-0d6...
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.
38
40
-- Apply this before packageIdRegex, otherwise this regex doesn't match.
39
- . resub " [ 0-9]+(\\ .[0-9]+)*/installed-[A-Za-z0-9.+ ]+"
40
- " <VERSION>/installed-<HASH>"
41
+ . resub " ([a-zA-Z]+(-[a-zA-Z])*)-[ 0-9]+(\\ .[0-9]+)*/installed-[A-Za-z0-9.]+"
42
+ " \\ 1- <VERSION>/installed-<HASH>... "
41
43
-- Normalize architecture
42
44
. resub (posixRegexEscape (display (normalizerPlatform nenv))) " <ARCH>"
43
45
-- Some GHC versions are chattier than others
You can’t perform that action at this time.
0 commit comments