fix: lake: do not delete path dependencies (#5878)
Fixes a serious issue where Lake would delete path dependencies when attempting to cleanup a dependency required with an incorrect name. Closes #5876. Originally part of #5684, but also independently discovered by François.
This commit is contained in:
parent
5e7d02e4ea
commit
4714f84fb9
1 changed files with 5 additions and 4 deletions
|
|
@ -210,10 +210,11 @@ def updateDep
|
|||
| .git (inputRev? := some rev) .. => s!" @ {repr rev}"
|
||||
| _ => ""
|
||||
logError (stdMismatchError depPkg.name.toString rev)
|
||||
if let .error e ← IO.FS.removeDirAll depPkg.dir |>.toBaseIO then -- cleanup
|
||||
-- Deleting git repositories via IO.FS.removeDirAll does not work reliably on Windows
|
||||
logError s!"'{dep.name}' was downloaded incorrectly; \
|
||||
you will need to manually delete '{depPkg.dir}': {e}"
|
||||
if matDep.manifestEntry.src matches .git .. then
|
||||
if let .error e ← IO.FS.removeDirAll depPkg.dir |>.toBaseIO then -- cleanup
|
||||
-- Deleting git repositories via IO.FS.removeDirAll does not work reliably on Windows
|
||||
logError s!"'{dep.name}' was downloaded incorrectly; \
|
||||
you will need to manually delete '{depPkg.dir}': {e}"
|
||||
error s!"{pkg.name}: package '{depPkg.name}' was required as '{dep.name}'"
|
||||
return depPkg
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue