Skip to content

Commit

Permalink
Merge pull request #6092 from commercialhaskell/fix6086-part2
Browse files Browse the repository at this point in the history
Fix #6086 Improve allow-newer-dep messages
  • Loading branch information
mpilgrem authored Apr 9, 2023
2 parents f94be12 + c2871b5 commit b02a250
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions src/Stack/Build/ConstructPlan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -907,16 +907,37 @@ addPackageDeps package = do
pure True
else pure False
if allowNewer
then do
warn_ True $
fillSep
[ style Shell "allow-newer"
, "enabled"
]
case allowNewerDeps of
Nothing -> pure True
Just boundsIgnoredDeps ->
pure $ packageName package `elem` boundsIgnoredDeps
then case allowNewerDeps of
Nothing -> do
warn_ True $
fillSep
[ style Shell "allow-newer"
, "enabled"
]
pure True
Just boundsIgnoredDeps -> do
let pkgName = packageName package
pkgName' = fromString $ packageNameString pkgName
isBoundsIgnoreDep = pkgName `elem` boundsIgnoredDeps
reason = if isBoundsIgnoreDep
then fillSep
[ style Current pkgName'
, flow "is an"
, style Shell "allow-newer-dep"
, flow "and"
, style Shell "allow-newer"
, "enabled"
]
else fillSep
[ style Current pkgName'
, flow "is not an"
, style Shell "allow-newer-dep"
, flow "although"
, style Shell "allow-newer"
, "enabled"
]
warn_ isBoundsIgnoreDep reason
pure isBoundsIgnoreDep
else do
when (isJust allowNewerDeps) $
warn_ False $
Expand Down

0 comments on commit b02a250

Please sign in to comment.