elan icon indicating copy to clipboard operation
elan copied to clipboard

Deleting from `~/.elan/toolchains` but leaving matching `~/.elan/update-hashes` leaves elan in broken state.

Open kim-em opened this issue 1 year ago • 1 comments

% elan toolchain install leanprover/lean4:v4.0.0
% rm -rf ~/.elan/toolchains/leanprover--lean4---v4.0.0
% lake +leanprover/lean4:v4.0.0 env                   
error: toolchain 'leanprover/lean4:v4.0.0' is not installed
% elan toolchain install leanprover/lean4:v4.0.0

  leanprover/lean4:v4.0.0 unchanged - (toolchain not installed)
% lake +leanprover/lean4:v4.0.0 env                     
error: toolchain 'leanprover/lean4:v4.0.0' is not installed

We had this happen on Hoskinson overnight!

It would be great if elan could detect this condition (toolchain apparently present in update-hashes, but missing in toolchain) and cope, either by cleaning up or explaining how to clean up.

To be fair, this is users abusing elan, but it's an easy failure mode for someone wanting to delete big files.

kim-em avatar Sep 14 '23 23:09 kim-em

update-hashes will be gone with #106

Kha avatar Sep 15 '23 00:09 Kha