Skip to content

Commit

Permalink
chore: incorporate review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tydeu committed Apr 29, 2024
1 parent 4ff8a62 commit f6ba82b
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/lake/Lake/Load/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,21 @@ private def resolveDepsAcyclic
let cycle := cycle.map (s!" {·}")
error s!"dependency cycle detected:\n{"\n".intercalate cycle}"

def stdMismatchError (newName : String) (rev : String) :=
s!"the 'std' package has been renamed to '{newName}' and moved to the
'leanprover-community' organization; downstream packages which wish to
update to the new std should replace
require std from
git \"https://github.com/leanprover/std4\"{rev}
in their Lake configuration file with
require {newName} from
git \"https://github.com/leanprover-community/{newName}\"{rev}
"

/--
Rebuild the workspace's Lake manifest and materialize missing dependencies.
Expand Down Expand Up @@ -192,10 +207,11 @@ def Workspace.updateAndMaterialize
let depPkg ← liftM <| loadDepPackage dep leanOpts reconfigure
if depPkg.name ≠ dep.name then
if dep.name = .mkSimple "std" then
logError s!"the 'std' package has been renamed to '{depPkg.name}'; \
users should switch packages depending on new versions of std/{depPkg.name} \
to 'require {depPkg.name}' instead of 'require std' and also update the \
GitHub URL accordingly"
let rev :=
match dep.manifestEntry with
| .git (inputRev? := some rev) .. => s!" @ {repr rev}"
| _ => ""
logError (stdMismatchError depPkg.name.toString rev)
try
IO.FS.removeDirAll depPkg.dir -- cleanup
catch e =>
Expand Down

0 comments on commit f6ba82b

Please sign in to comment.