on master help sign in
Error when changing elm.json by hand and skipping transitive deps
c54cbe5Evan Czaplicki
builder/src/Deps/Verify.hs+5−2
@@ -79,8 +79,11 @@ verifyApp info =
79 Nothing ->
79 Nothing ->
80 throw E.BadDeps
80 throw E.BadDeps
81
81
82− Just solution ->
82+ Just newSolution ->
83− return solution
83+ if Map.size oldSolution == Map.size newSolution then
84+ return newSolution
85+ else
86+ throw (E.AppMissingTrans (Map.toList (Map.difference newSolution oldSolution)))
84
87
85
88
86verifyPkg :: PkgInfo -> Task.Task (Map Name Version)
89verifyPkg :: PkgInfo -> Task.Task (Map Name Version)
builder/src/Reporting/Exit/Deps.hs+26−10
@@ -22,8 +22,9 @@ data Exit
22 = CorruptVersionCache FilePath Pkg.Name
22 = CorruptVersionCache FilePath Pkg.Name
23 | PackageNotFound Pkg.Name [Pkg.Name]
23 | PackageNotFound Pkg.Name [Pkg.Name]
24 -- verify
24 -- verify
25− | AppBadElm Pkg.Version
26 | PkgBadElm Con.Constraint
25 | PkgBadElm Con.Constraint
26+ | AppBadElm Pkg.Version
27+ | AppMissingTrans [(Pkg.Name, Pkg.Version)]
27 | BadDeps
28 | BadDeps
28 | BuildFailure FilePath Pkg.Name Pkg.Version
29 | BuildFailure FilePath Pkg.Name Pkg.Version
29
30
@@ -59,8 +60,19 @@ toReport exit =
59 , "But check <https://package.elm-lang.org> to see all possibilities!"
60 , "But check <https://package.elm-lang.org> to see all possibilities!"
60 ]
61 ]
61
62
63+ PkgBadElm constraint ->
64+ Help.report "ELM VERSION MISMATCH" (Just "elm.json")
65+ "Your elm.json says this package needs a version of Elm in this range:"
66+ [ D.indent 4 $ D.dullyellow $ D.fromString $ Con.toString constraint
67+ , D.fillSep
68+ [ "But", "you", "are", "using", "Elm"
69+ , D.red (D.fromString (Pkg.versionToString Compiler.version))
70+ , "right", "now."
71+ ]
72+ ]
73+
62 AppBadElm version ->
74 AppBadElm version ->
63− Help.report "ELM VERSION MISMATCH" Nothing
75+ Help.report "ELM VERSION MISMATCH" (Just "elm.json")
64 "Your elm.json says this application needs a different version of Elm."
76 "Your elm.json says this application needs a different version of Elm."
65 [ D.fillSep
77 [ D.fillSep
66 [ "It", "requires"
78 [ "It", "requires"
@@ -71,19 +83,23 @@ toReport exit =
71 ]
83 ]
72 ]
84 ]
73
85
74− PkgBadElm constraint ->
86+ AppMissingTrans missingDeps ->
75− Help.report "ELM VERSION MISMATCH" Nothing
87+ let
76− "Your elm.json says this package needs a version of Elm in this range:"
88+ toEntry (pkg, vsn) =
89+ "\"" ++ Pkg.toString pkg ++ "\": \"" ++ Pkg.versionToString vsn ++ "\""
90+ in
91+ Help.report "MISSING DEPENDENCIES" (Just "elm.json")
92+ "Your elm.json is missing some \"transitive-dependencies\" entries:"
77− [ D.indent 4 $ D.dullyellow $ D.fromString $ Con.toString constraint
93+ [ D.indent 4 $ D.dullyellow $ D.vcat $ map (D.fromString . toEntry) missingDeps
78 , D.fillSep
94 , D.fillSep
79− [ "But", "you", "are", "using", "Elm"
95+ ["This","usually","means","you","are","editing","elm.json","by","hand."
80− , D.red (D.fromString (Pkg.versionToString Compiler.version))
96+ ,"It","is","much","more","reliable","to","use","the"
81− , "right", "now."
97+ ,D.green "elm install","command","instead."
82 ]
98 ]
83 ]
99 ]
84
100
85 BadDeps ->
101 BadDeps ->
86− Help.report "CLASHING PACKAGE DEPENDENCIES" Nothing
102+ Help.report "CLASHING PACKAGE DEPENDENCIES" (Just "elm.json")
87 "The dependencies in your elm.json are not compatible."
103 "The dependencies in your elm.json are not compatible."
88 [ D.reflow $
104 [ D.reflow $
89 "Did you change them by hand? Try to change it back! It is much\
105 "Did you change them by hand? Try to change it back! It is much\