mirror of
https://github.com/gren-lang/compiler.git
synced 2024-09-11 08:45:42 +03:00
Merge pull request #200 from gren-lang/refuse-to-compile-transient-local-deps
Refuse to compile a dependency with local dependencies.
This commit is contained in:
commit
a1edf1fcaa
@ -249,10 +249,15 @@ addVersion reportKey (Goals rootPlatform pending solved) name source =
|
||||
if C.goodGren gren
|
||||
then
|
||||
if Platform.compatible rootPlatform platform
|
||||
then do
|
||||
depsConstraintSources <- Map.traverseWithKey resolveToConstraintSource deps
|
||||
newPending <- foldM (addConstraint name solved) pending (Map.toList depsConstraintSources)
|
||||
return (Goals rootPlatform newPending (Map.insert name source solved))
|
||||
then
|
||||
if any PossibleFilePath.is deps
|
||||
then
|
||||
solverError $
|
||||
Exit.SolverTransientLocalDep name
|
||||
else do
|
||||
depsConstraintSources <- Map.traverseWithKey resolveToConstraintSource deps
|
||||
newPending <- foldM (addConstraint name solved) pending (Map.toList depsConstraintSources)
|
||||
return (Goals rootPlatform newPending (Map.insert name source solved))
|
||||
else
|
||||
solverError $
|
||||
Exit.SolverIncompatiblePlatforms name rootPlatform platform
|
||||
|
@ -1005,6 +1005,7 @@ data Solver
|
||||
| SolverBadLocalDepExpectedPkg FilePath Pkg.Name
|
||||
| SolverBadLocalDepInvalidGrenJson FilePath Pkg.Name
|
||||
| SolverLocalDepNotFound FilePath Pkg.Name
|
||||
| SolverTransientLocalDep Pkg.Name
|
||||
| SolverBadGitOperationUnversionedPkg Pkg.Name Git.Error
|
||||
| SolverBadGitOperationVersionedPkg Pkg.Name V.Version Git.Error
|
||||
| SolverIncompatibleSolvedVersion Pkg.Name Pkg.Name C.Constraint V.Version
|
||||
@ -1086,6 +1087,17 @@ toSolverReport problem =
|
||||
[ D.reflow
|
||||
"Verify that the path is correct."
|
||||
]
|
||||
SolverTransientLocalDep pkgName ->
|
||||
Help.report
|
||||
"PROBLEM SOLVING PACKAGE CONSTRAINTS"
|
||||
Nothing
|
||||
( Pkg.toChars pkgName
|
||||
++ " has defined one or more local dependencies."
|
||||
)
|
||||
[ D.reflow
|
||||
"Dependencies are not allowed to define their own local dependencies. Contact the package \
|
||||
\author to resolve this issue."
|
||||
]
|
||||
SolverBadGitOperationUnversionedPkg pkg gitError ->
|
||||
toGitErrorReport "PROBLEM SOLVING PACKAGE CONSTRAINTS" gitError $
|
||||
"I need the gren.json of "
|
||||
|
Loading…
Reference in New Issue
Block a user