Stop trying to check free space on Mono #3850
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Mac and Linux users have reported spurious errors about free disk space when installing:
Cause
Mono's
DriveInfo.GetDrives()
doesn't include mounted filesystems other than/
, which makes it useless and unusable:I tested #3631 on a single partition system, which made it appear to work fine because
/
is hard-coded to be part of this list, but if you have more partitions mounted than that, only/
will be checked, which can be wrong, and we have no way of detecting that it's wrong.This can cause both false positives (user is told they don't have enough free space when they do) and false negatives (user is allowed to proceed with a nearly full disk and the install fails). So the free space check isn't reliable on Mono.
Changes
Now our
DirectoryInfo.GetDrive()
extension method always returnsnull
on Mono 😞, because finding a directory's drive can't be done on Mono (but should be possible if Mono's code for this wasn't 💩). This will bypass the free space checks. Windows users will still be alerted before they fill up their disks, but Mac and Linux users will be back to installing without this guard rail, potentially filling their disks in the middle of downloading or installing.I'm not going to bother trying to send a patch to Mono because they're not merging fixes anymore and because this code is probably so old that changing it would spook them. 👻
Fixes #3768.
Fixes #3848.
Side fix
The localization DLL for Korean GUI strings has the same name as the one for Core, which causes this compile warning and probably breaks something in the UI somewhere:
Now it's changed to
CKAN.GUI.Properties.Resources.ko-KR.resources
, consistent with all the other languages.