fix: error on unknown package names in lake update - #14630
Conversation
This PR makes `lake update <pkg>...` fail with a clear error when any specified name is not a direct dependency of the root package. Previously, unknown or misspelled names (including case mismatches) were silently ignored. Closes leanprover#12005
Validating only current root requires broke `lake update <pkg>` after a require is removed (e.g. depTree's `lake update c` to drop c from the manifest). Accept names that appear in the existing manifest as well as current root dependencies; still error on truly unknown names.
|
Pushed a fix so selective |
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
tydeu
left a comment
There was a problem hiding this comment.
Thanks, I like the check! However, I have some comments on code location (see below).
|
@tydeu The requested relocation is complete: validation now lives in |
|
LGTM! Thank you! 🎉 |
|
Thanks for the re-review. GitHub still shows the earlier |
This PR makes
lake update <pkg>...fail with a clear error when a specified package name is not known to the current dependency manifest. Previously, unknown or misspelled names (including case mismatches) were silently ignored, which was confusing.Summary
Selective-update names are validated inside
reuseManifestagainst the already loaded manifest, avoiding a duplicate manifest load. This preserves Lake's ability to update a package that remains recorded in the manifest after its directrequirewas removed, while rejecting names that are genuinely unknown. Matching is case-sensitive, following Lake's existing package-name semantics.Unknown names produce a non-zero exit with:
Successful paths are unchanged:
lake update(update all dependencies)lake update <valid-dep>(selective update of a known dependency)requirewas removedChanges
src/lake/Lake/Load/Resolve.lean: validatetoUpdatenames inreuseManifestusing the manifest that function already loaded; the detailed contract docstring lives theretests/lake/tests/updateUnknown/: focused CLI coverage for unknown names, case mismatches, mixed valid/invalid args, successful paths, and a retained manifest packageValidation
Confirmed stock Lake (
v4.32.2) exits 0 with no error forlake update does-not-exist(repro of the bug)Full Lean bootstrap / Lake rebuild was not run locally because Lean is unavailable in the execution environment
The focused test runs under the normal Lake test suite in CI:
AI disclosure
AI tools assisted with locating the Lake update path, drafting the change, and preparing the PR. I reviewed the logic against
reuseManifest, selective-update behavior, and Lake's existingunknown packageerror style.Closes #12005
Closes #2772