on master help sign in
show more specific error on install problems
8eb44cbEvan Czaplicki
builder/src/Reporting/Exit.hs+11−16
@@ -751,7 +751,7 @@ data Install
751 | InstallHadSolverTrouble Solver
751 | InstallHadSolverTrouble Solver
752 | InstallUnknownPackageOnline Pkg.Name [Pkg.Name]
752 | InstallUnknownPackageOnline Pkg.Name [Pkg.Name]
753 | InstallUnknownPackageOffline Pkg.Name [Pkg.Name]
753 | InstallUnknownPackageOffline Pkg.Name [Pkg.Name]
754− | InstallHasBadDetails Pkg.Name Encode.Value
754+ | InstallBadDetails Details
755
755
756
756
757installToReport :: Install -> Help.Report
757installToReport :: Install -> Help.Report
@@ -895,20 +895,8 @@ installToReport exit =
895 , D.reflow $ "Maybe you want one of these instead?"
895 , D.reflow $ "Maybe you want one of these instead?"
896 ]
896 ]
897
897
898− InstallHasBadDetails pkg outline ->
898+ InstallBadDetails details ->
899− Help.report "INSTALL PROBLEM" Nothing
899+ toDetailsReport details
900− (
901− "I found a version of " ++ Pkg.toChars pkg ++ " that claims to be compatible with\
902− \ your existing dependencies, but I ran into an error when I tried to build it locally."
903− )
904− [ D.reflow $
905− "Here is an elm.json that should reproduce the error with a bit more information:"
906− , D.indent 4 $ D.dullyellow $ D.vcat $ map D.fromChars $
907− map BS_UTF8.toString $ BSC.lines $ LBS.toStrict $ B.toLazyByteString $
908− Encode.encode outline
909− , D.reflow $
910− "Maybe that can help figure out what is going on here."
911− ]
912
900
913
901
914
902
@@ -1334,7 +1322,7 @@ toDetailsReport details =
1334 "I need the list of published packages to verify your dependencies"
1322 "I need the list of published packages to verify your dependencies"
1335
1323
1336 DetailsBadDeps cacheDir deps ->
1324 DetailsBadDeps cacheDir deps ->
1337− case deps of
1325+ case List.sortOn toBadDepRank deps of
1338 [] ->
1326 [] ->
1339 Help.report "PROBLEM BUILDING DEPENDENCIES" Nothing
1327 Help.report "PROBLEM BUILDING DEPENDENCIES" Nothing
1340 "I am not sure what is going wrong though."
1328 "I am not sure what is going wrong though."
@@ -1374,6 +1362,13 @@ toDetailsReport details =
1374 ]
1362 ]
1375
1363
1376
1364
1365+toBadDepRank :: DetailsBadDep -> Int -- lower is better
1366+toBadDepRank badDep =
1367+ case badDep of
1368+ BD_BadDownload _ _ _ -> 0
1369+ BD_BadBuild _ _ _ -> 1
1370+
1371+
1377
1372
1378-- PACKAGE PROBLEM
1373-- PACKAGE PROBLEM
1379
1374
terminal/src/Install.hs+1−1
@@ -124,7 +124,7 @@ attemptChanges root env pkg oldOutline toChars changes =
124
124
125attemptChangesHelp :: FilePath -> Solver.Env -> Pkg.Name -> Outline.Outline -> Outline.Outline -> D.Doc -> Task ()
125attemptChangesHelp :: FilePath -> Solver.Env -> Pkg.Name -> Outline.Outline -> Outline.Outline -> D.Doc -> Task ()
126attemptChangesHelp root env pkg oldOutline newOutline question =
126attemptChangesHelp root env pkg oldOutline newOutline question =
127− Task.eio (\_ -> Exit.InstallHasBadDetails pkg (Outline.encode newOutline)) $
127+ Task.eio Exit.InstallBadDetails $
128 BW.withScope $ \scope ->
128 BW.withScope $ \scope ->
129 do approved <- Reporting.ask question
129 do approved <- Reporting.ask question
130 if approved
130 if approved