Skip to content

Commit

Permalink
Refuse to compile a local dependency when the package names doesn't m…
Browse files Browse the repository at this point in the history
…atch
  • Loading branch information
robinheghan committed Mar 13, 2023
1 parent 63d9a6f commit 8aca973
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions builder/src/Deps/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ resolveToConstraintSource pkgName possibleFP =
let outlinePath = fp </> "gren.json"
bytes <- File.readUtf8 outlinePath
case D.fromByteString Outline.decoder bytes of
Right (Outline.Pkg (Outline.PkgOutline _ _ _ version _ _ _ _)) ->
ok state (Local (C.exactly version) fp) back
Right (Outline.Pkg (Outline.PkgOutline outlineName _ _ version _ _ _ _)) ->
if outlineName /= pkgName
then err $ Exit.SolverBadLocalDep pkgName fp
else ok state (Local (C.exactly version) fp) back
Right _ ->
err $ Exit.SolverBadLocalDep pkgName fp
Left _ ->
Expand Down

0 comments on commit 8aca973

Please sign in to comment.