fix: lake: dep URL match check in updateGitRepo

see 6176fdba9e (r125905901)
This commit is contained in:
tydeu 2023-09-06 17:39:28 -04:00 committed by Mac Malone
parent c318d5817d
commit 522ea723ad
2 changed files with 12 additions and 1 deletions

View file

@ -45,6 +45,7 @@ def updateGitRepo (repo : GitRepo) (url : String)
(rev? : Option String) (name : String) : LogIO Unit := do
let sameUrl ← EIO.catchExceptions (h := fun _ => pure false) <| show IO Bool from do
let some remoteUrl ← repo.getRemoteUrl? | return false
if remoteUrl = url then return true
return (← IO.FS.realPath remoteUrl) = (← IO.FS.realPath url)
if sameUrl then
updateGitPkg repo rev? name

View file

@ -20,12 +20,22 @@ git add --all
git commit -m "initial commit"
popd
HELLO_URL="file://$(pwd)/hello"
cd test
$LAKE -R -Kurl="$HELLO_URL" update
# test that a second `lake update` is a no-op (with URLs)
# see https://github.com/leanprover/lean4/commit/6176fdba9e5a888225a23e5d558a005e0d1eb2f6#r125905901
$LAKE -R -Kurl="$HELLO_URL" update | diff - /dev/null
rm -rf lake-packages
# Test that Lake produces no warnings on a `lake build` after a `lake update`
# See https://github.com/leanprover/lean4/issues/2427
$LAKE update
$LAKE -R update
# test that a second `lake update` is a no-op (with file paths)
$LAKE -R update | diff - /dev/null
test -d lake-packages/hello
# test that Lake produces no warnings
$LAKE build 3>&1 1>&2 2>&3 | diff - /dev/null