@@ -71,8 +71,7 @@ abbrev DepStackT m := CallStackT Name m
7171
7272@[inline] nonrec def DepStackT.run
7373 (x : DepStackT m α) (stack : DepStack := {})
74- : m α :=
75- x.run stack
74+ : m α := x.run stack
7675
7776/-- Log dependency cycle and error. -/
7877@[specialize] def depCycleError [MonadError m] (cycle : Cycle Name) : m α :=
@@ -86,8 +85,7 @@ abbrev ResolveT m := DepStackT <| StateT Workspace m
8685
8786@[inline] nonrec def ResolveT.run
8887 (ws : Workspace) (x : ResolveT m α) (stack : DepStack := {})
89- : m (α × Workspace) :=
90- x.run stack |>.run ws
88+ : m (α × Workspace) := x.run stack |>.run ws
9189
9290/-- Recursively run a `ResolveT` monad starting from the workspace's root. -/
9391@[specialize] private def Workspace.runResolveT
@@ -102,7 +100,7 @@ abbrev ResolveT m := DepStackT <| StateT Workspace m
102100/-
103101Recursively visits each node in a package's dependency graph, starting from
104102the workspace package `root`. Each dependency missing from the workspace is
105- resolved using the `resolve ` function and added into the workspace.
103+ resolved using the `load ` function and added into the workspace.
106104
107105Recursion occurs breadth-first. Each direct dependency of a package is
108106resolved in reverse order before recursing to the dependencies' dependencies.
@@ -121,7 +119,7 @@ where
121119 -- Materialize and load the missing direct dependencies of `pkg`
122120 pkg.depConfigs.forRevM fun dep => do
123121 let ws ← getWorkspace
124- if ws.packageMap.contains dep.name then
122+ if ws.packages.any (·.baseName == dep.name) then
125123 return -- already handled in another branch
126124 if pkg.baseName = dep.name then
127125 error s! "{ pkg.prettyName} : package requires itself (or a package with the same name)"
0 commit comments