Fix install_version skipping download when files are missing from disk#1485
Fix install_version skipping download when files are missing from disk#1485KristofferC wants to merge 1 commit intomainfrom
install_version skipping download when files are missing from disk#1485Conversation
|
Hm, what is going on there? Do you still have a different channel that keeps that version around? In general, when you remove a channel and it reports that nothing needs to be tidied up, that should (I think) mean that the version that this channel pointed to is still pointed to by some other channel and doesn't need to be removed. And then when the So I don't really understand how this error can occur in the first place? |
|
Oh, wait, is this also a situation where you deleted files manually from disc? I think maybe generally when we detect a situation where the config file and the situation on disc is out of sync we should throw an error that states something like "Your Juliaup configuration is corrupted, please run |
|
If I do |
|
There is a design philosophy difference between Pkg.jl and Juliaup: Juliaup tracks everything that is installed in the config file, and assumes that the config file and the state of downloads is consistent. If that invariant doesn't hold, a lot of things won't work properly. Pkg.jl doesn't have that concept of a global configuration file that tracks which packages are installed, so (AFAIK) it doesn't have this consistency problem. I'm just saying, once the config file and the file system state inside the I think there is a bigger question whether we should move away from this config file design a bit and instead of tracking in the config file which versions are exactly installed, just look at the file system for that info. But that would be a much bigger change. |
|
Can we store (in the Juliaup config file) the hash that we expect? Then we can compute the hash, and if the expected hash (stored in the Juliaup config file) does not match the observed computed hash (obtained by computing the treehash of the directory we have on disk), then we know things are broken, and we automate the process of fixing (e.g. delete the old broken directory and redownload/reextract, or whatever the correct fix is). |
|
Yeah, I like the idea of adding a hash to the config file that allows us to detect whether someone modified a installed Julia folder. Only caveat is I'm not sure whether there are situations where Julia might write into the Julia folder? If I run something with coverage on, for example, are there maybe files written etc? Just not sure. But that is also just an orthogonal question to what this PR here does, i.e. the question what should happen when we detect a mismatch. |
This felt annoying:
I think
addshould check that the folder exist and otherwise redownload. That is what this PR does.