Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6086 Improve allow-newer-dep messages #6092

Merged
merged 1 commit into from
Apr 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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